X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=package%2Fmac80211%2Ffiles%2Flib%2Fwifi%2Fmac80211.sh;h=86ec75cec300d05c4f1eb179ac19369a12adf46c;hb=3aa922d33cf8b0e63925a45a8ae38e2bfcd9a96f;hp=46c8c2af4cc33bc318ee1eca575d6d44b88ab3b5;hpb=3e7589ce1a6d3a6e9e43ce5b1dd5e058a32ec646;p=oweals%2Fopenwrt.git diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 46c8c2af4c..86ec75cec3 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -6,13 +6,24 @@ mac80211_hostapd_setup_base() { local ifname="$2" cfgfile="/var/run/hostapd-$phy.conf" + macfile="/var/run/hostapd-$phy.maclist" + [ -e "$macfile" ] && rm -f "$macfile" + 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 [ -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 +41,40 @@ mac80211_hostapd_setup_base() { [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N" } } - cat > "$cfgfile" <> $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 + } + + cat >> "$cfgfile" <