X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/5ffe37bed2a46faa1a417a7fe13a6a4c960a7333..a551eef759b5b191427d4e0f6864b1761e8d2734:/package/madwifi/files/lib/wifi/madwifi.sh diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 5742c68e5..6baf482dc 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -74,7 +74,9 @@ enable_atheros() { local device="$1" config_get channel "$device" channel config_get vifs "$device" vifs - + + [ auto = "$channel" ] && channel=0 + local first=1 for vif in $vifs; do nosbeacon= @@ -177,12 +179,62 @@ enable_atheros() { config_get txpwr "$vif" txpower [ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}" + config_get rate "$vif" rate + [ -n "$rate" ] && iwconfig "$ifname" rate "${rate%%.*}" + + config_get mcast_rate "$vif" mcast_rate + [ -n "$mcast_rate" ] && iwpriv "$ifname" mcast_rate "${mcast_rate%%.*}" + config_get frag "$vif" frag [ -n "$frag" ] && iwconfig "$ifname" frag "${frag%%.*}" config_get rts "$vif" rts [ -n "$rts" ] && iwconfig "$ifname" rts "${rts%%.*}" + config_get_bool doth "$vif" 80211h + [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" + + config_get_bool comp "$vif" compression + [ -n "$comp" ] && iwpriv "$ifname" compression "$comp" + + config_get_bool burst "$vif" bursting + [ -n "$burst" ] && iwpriv "$ifname" burst "$burst" + + config_get_bool wmm "$vif" wmm + [ -n "$wmm" ] && iwpriv "$ifname" wmm "$wmm" + + config_get_bool xr "$vif" xr + [ -n "$xr" ] && iwpriv "$ifname" xr "$xr" + + config_get_bool ar "$vif" ar + [ -n "$ar" ] && iwpriv "$ifname" ar "$ar" + + config_get_bool turbo "$vif" turbo + [ -n "$turbo" ] && iwpriv "$ifname" turbo "$turbo" + + config_get maclist "$vif" maclist + [ -n "$maclist" ] && { + # flush MAC list + iwpriv "$ifname" maccmd 3 + for mac in $maclist; do + iwpriv "$ifname" addmac "$mac" + done + } + + config_get macpolicy "$vif" macpolicy + case "$macpolicy" in + allow) + iwpriv "$ifname" maccmd 1 + ;; + deny) + iwpriv "$ifname" maccmd 2 + ;; + *) + # default deny policy if mac list exists + [ -n "$maclist" ] && iwpriv "$ifname" maccmd 2 + ;; + esac + ifconfig "$ifname" up iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null @@ -256,7 +308,7 @@ detect_atheros() { cat <