diff options
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.sh | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 5f45ba2e26..a41254d6db 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -98,6 +98,7 @@ hostapd_common_add_device_config() { config_add_int local_pwr_constraint config_add_string require_mode config_add_boolean legacy_rates + config_add_int cell_density config_add_string acs_chan_bias config_add_array hostapd_options @@ -115,7 +116,7 @@ hostapd_prepare_device_config() { local base_cfg= json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density hostapd_set_log_options base_cfg @@ -124,8 +125,7 @@ hostapd_prepare_device_config() { set_default doth 1 set_default legacy_rates 1 set_default airtime_mode 0 - - [ "$hwmode" = "b" ] && legacy_rates=1 + set_default cell_density 0 [ -n "$country" ] && { append base_cfg "country_code=$country" "$N" @@ -146,16 +146,57 @@ hostapd_prepare_device_config() { json_get_values rate_list supported_rates [ -n "$hwmode" ] && append base_cfg "hw_mode=$hwmode" "$N" - [ "$legacy_rates" -eq 0 ] && set_default require_mode g - - [ "$hwmode" = "g" ] && { - [ "$legacy_rates" -eq 0 ] && set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" - [ -n "$require_mode" ] && set_default basic_rate_list "6000 12000 24000" - } - - case "$require_mode" in - n) append base_cfg "require_ht=1" "$N";; - ac) append base_cfg "require_vht=1" "$N";; + if [ "$hwmode" = "g" ] || [ "$hwmode" = "a" ]; then + [ -n "$require_mode" ] && legacy_rates=0 + case "$require_mode" in + n) append base_cfg "require_ht=1" "$N";; + ac) append base_cfg "require_vht=1" "$N";; + esac + fi + case "$hwmode" in + b) + if [ "$cell_density" -eq 1 ]; then + set_default rate_list "5500 11000" + set_default basic_rate_list "5500 11000" + elif [ "$cell_density" -ge 2 ]; then + set_default rate_list "11000" + set_default basic_rate_list "11000" + fi + ;; + g) + if [ "$cell_density" -eq 0 ] || [ "$cell_density" -eq 1 ]; then + if [ "$legacy_rates" -eq 0 ]; then + set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "6000 12000 24000" + elif [ "$cell_density" -eq 1 ]; then + set_default rate_list "5500 6000 9000 11000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "5500 11000" + fi + elif [ "$cell_density" -ge 3 ] && [ "$legacy_rates" -ne 0 ] || [ "$cell_density" -eq 2 ]; then + if [ "$legacy_rates" -eq 0 ]; then + set_default rate_list "12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "12000 24000" + else + set_default rate_list "11000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "11000" + fi + elif [ "$cell_density" -ge 3 ]; then + set_default rate_list "24000 36000 48000 54000" + set_default basic_rate_list "24000" + fi + ;; + a) + if [ "$cell_density" -eq 1 ]; then + set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "6000 12000 24000" + elif [ "$cell_density" -eq 2 ]; then + set_default rate_list "12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "12000 24000" + elif [ "$cell_density" -ge 3 ]; then + set_default rate_list "24000 36000 48000 54000" + set_default basic_rate_list "24000" + fi + ;; esac for r in $rate_list; do |