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
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
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"
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