X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fmac80211%2Ffiles%2Flib%2Fwifi%2Fmac80211.sh;h=1ad3eb5086a5dc902ffaa4170c50437af15c4604;hb=bd93518c7bf055677fea8b489d1da76f9038f58b;hp=4d6d50f0bc6534ab2da1e10bfe4dda036dae5b5a;hpb=6bcc6634022213a80cd4302c2a9822ace3d55f24;p=openwrt.git diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 4d6d50f0bc..1ad3eb5086 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -6,13 +6,25 @@ mac80211_hostapd_setup_base() { local ifname="$2" cfgfile="/var/run/hostapd-$phy.conf" + config_get device "$vif" device 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 + + 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" ] && { @@ -30,7 +42,22 @@ mac80211_hostapd_setup_base() { [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N" } } - cat > "$cfgfile" <> "$cfgfile" <