diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-07-06 14:11:33 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-07-12 13:31:40 +0200 |
commit | 9aa0561534e8ea210d5a57c40ae0fcad5cada212 (patch) | |
tree | 0274202d7d4294171c5563cc1cb925f7af835c06 /package/network/services/hostapd/patches | |
parent | 349e2b7e658290f967a4aab4fd9d754572f9b0b2 (diff) | |
download | upstream-9aa0561534e8ea210d5a57c40ae0fcad5cada212.tar.gz upstream-9aa0561534e8ea210d5a57c40ae0fcad5cada212.tar.bz2 upstream-9aa0561534e8ea210d5a57c40ae0fcad5cada212.zip |
hostapd: make it possible to update station airtime weights via ubus
This allows dynamic tuning based on other runtime information
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/services/hostapd/patches')
-rw-r--r-- | package/network/services/hostapd/patches/600-ubus_support.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 71537c9ec6..005ed54e0c 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -473,3 +473,44 @@ /* Proceed only if DFS is not offloaded to the driver */ if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) return 0; +--- a/src/ap/airtime_policy.c ++++ b/src/ap/airtime_policy.c +@@ -112,8 +112,14 @@ static void set_sta_weights(struct hosta + { + struct sta_info *sta; + +- for (sta = hapd->sta_list; sta; sta = sta->next) +- sta_set_airtime_weight(hapd, sta, weight); ++ for (sta = hapd->sta_list; sta; sta = sta->next) { ++ unsigned int sta_weight = weight; ++ ++ if (sta->dyn_airtime_weight) ++ sta_weight = (weight * sta->dyn_airtime_weight) / 256; ++ ++ sta_set_airtime_weight(hapd, sta, sta_weight); ++ } + } + + +@@ -244,7 +250,10 @@ int airtime_policy_new_sta(struct hostap + unsigned int weight; + + if (hapd->iconf->airtime_mode == AIRTIME_MODE_STATIC) { +- weight = get_weight_for_sta(hapd, sta->addr); ++ if (sta->dyn_airtime_weight) ++ weight = sta->dyn_airtime_weight; ++ else ++ weight = get_weight_for_sta(hapd, sta->addr); + if (weight) + return sta_set_airtime_weight(hapd, sta, weight); + } +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -324,6 +324,7 @@ struct sta_info { + #endif /* CONFIG_TESTING_OPTIONS */ + #ifdef CONFIG_AIRTIME_POLICY + unsigned int airtime_weight; ++ unsigned int dyn_airtime_weight; + struct os_reltime backlogged_until; + #endif /* CONFIG_AIRTIME_POLICY */ + |