X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fmac80211%2Ffiles%2Flib%2Fwifi%2Fmac80211.sh;h=6b907b6a2fc2b1aea1e7df49eccd7e089f78a327;hb=36f95026ed1c52ad17e32b876914a9fc7461b45c;hp=13d6584b09b8101fc0febf0177f321dab93201bb;hpb=8d510f3c87ec5b56a8c887959c0350efdb0995d1;p=openwrt.git diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 13d6584b09..6b907b6a2f 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -13,9 +13,21 @@ mac80211_hostapd_setup_base() { config_get country "$device" country config_get hwmode "$device" hwmode config_get channel "$device" channel + config_get beacon_int "$device" beacon_int + config_get basic_rate_list "$device" basic_rate config_get_bool noscan "$device" noscan + config_get_bool short_preamble "$device" short_preamble "0" + + hostapd_set_log_options base_cfg "$device" + [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device" - [ "$channel" = auto ] && channel= + + [ "$channel" = auto ] && { + channel=$(iw phy "$phy" info | \ + sed -ne '/MHz/ { /disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }') + config_set "$device" channel "$channel" + } + [ -n "$hwmode" ] && { config_get hwmode_11n "$device" hwmode_11n [ -n "$hwmode_11n" ] && { @@ -34,6 +46,11 @@ mac80211_hostapd_setup_base() { } } + local country_ie=0 + [ -n "$country" ] && country_ie=1 + config_get_bool country_ie "$device" country_ie "$country_ie" + [ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N" + config_get macfilter "$vif" macfilter case "$macfilter" in allow) @@ -51,6 +68,18 @@ mac80211_hostapd_setup_base() { echo "$mac" >> $macfile done } + + local br brval brstr + [ -n "$basic_rate_list" ] && { + for br in $basic_rate_list; do + brval="$(($br / 100))" + [ -n "$brstr" ] && brstr="$brstr " + brstr="$brstr$brval" + done + } + + append base_cfg "preamble=$short_preamble" "$N" + cat >> "$cfgfile" <