aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-12-27 12:59:47 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-12-27 12:59:47 +0000
commit6ffd9465e0b8f2c61f023330c8eac8181d93b0ea (patch)
tree9596ea3db55404cb1b861c46babf0b8032a5821f /package/network/services
parentfe91518d6f881057c57db1191af8d48c6800cc35 (diff)
downloadupstream-6ffd9465e0b8f2c61f023330c8eac8181d93b0ea.tar.gz
upstream-6ffd9465e0b8f2c61f023330c8eac8181d93b0ea.tar.bz2
upstream-6ffd9465e0b8f2c61f023330c8eac8181d93b0ea.zip
hostapd: add support for configuring supported rates
patch by Wilco Baan Hofman from #18627 Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43782 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/hostapd/files/netifd.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index 78c8aa7dd2..1ec9e45fed 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -1,4 +1,4 @@
-hostapd_add_rate() {
+wpa_supplicant_add_rate() {
local var="$1"
local val="$(($2 / 1000))"
local sub="$((($2 / 100) % 10))"
@@ -6,7 +6,7 @@ hostapd_add_rate() {
[ $sub -gt 0 ] && append $var "."
}
-hostapd_add_basic_rate() {
+hostapd_add_rate() {
local var="$1"
local val="$(($2 / 100))"
append $var "$val" " "
@@ -49,6 +49,7 @@ hostapd_add_log_config() {
hostapd_common_add_device_config() {
config_add_array basic_rate
+ config_add_array supported_rates
config_add_string country
config_add_boolean country_ie doth
@@ -82,13 +83,21 @@ hostapd_prepare_device_config() {
local brlist= br
json_get_values basic_rate_list basic_rate
for br in $basic_rate_list; do
- hostapd_add_basic_rate brlist "$br"
+ hostapd_add_rate brlist "$br"
done
case "$require_mode" in
g) brlist="60 120 240" ;;
n) append base_cfg "require_ht=1" "$N";;
ac) append base_cfg "require_vht=1" "$N";;
esac
+
+ local rlist= r
+ json_get_values rate_list supported_rates
+ for r in $rate_list; do
+ hostapd_add_rate rlist "$r"
+ done
+
+ [ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
[ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
[ -n "$beacon_int" ] && append base_cfg "beacon_int=$beacon_int" "$N"
@@ -146,6 +155,7 @@ hostapd_common_add_bss_config() {
config_add_int mcast_rate
config_add_array basic_rate
+ config_add_array supported_rates
}
hostapd_set_bss_options() {
@@ -572,14 +582,14 @@ wpa_supplicant_add_network() {
[ -n "$basic_rate" ] && {
local br rate_list=
for br in $basic_rate; do
- hostapd_add_rate rate_list "$br"
+ wpa_supplicant_add_rate rate_list "$br"
done
[ -n "$rate_list" ] && append network_data "rates=$rate_list" "$N$T"
}
[ -n "$mcast_rate" ] && {
local mc_rate=
- hostapd_add_rate mc_rate "$mcast_rate"
+ wpa_supplicant_add_rate mc_rate "$mcast_rate"
append network_data "mcast_rate=$mc_rate" "$N$T"
}