diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-05-06 11:52:24 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-05-06 11:52:24 +0000 |
commit | 9060d40b474ce3646f0d9bd40f5a2b2d61f68c78 (patch) | |
tree | e427cc76cbfcfd02c20665632b3770f5ba8a3d96 /package/madwifi/files/lib | |
parent | fab34735f341da202bf0b98c6e2cd67cb7578669 (diff) | |
download | upstream-9060d40b474ce3646f0d9bd40f5a2b2d61f68c78.tar.gz upstream-9060d40b474ce3646f0d9bd40f5a2b2d61f68c78.tar.bz2 upstream-9060d40b474ce3646f0d9bd40f5a2b2d61f68c78.zip |
madwifi: make country code and outdoor flag changeable without reloading the driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15633 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/madwifi/files/lib')
-rwxr-xr-x | package/madwifi/files/lib/wifi/madwifi.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 8c4a75426e..2fe866410e 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -67,15 +67,18 @@ disable_atheros() ( enable_atheros() { local device="$1" - # Can only set the country code to one setting for the entire system. The last country code is the one that will be applied. + + config_get regdomain "$device" regdomain + [ -n "$regdomain" ] && echo "$regdomain" > /proc/sys/dev/$device/regdomain + config_get country "$device" country [ -z "$country" ] && country="0" - local cc="0" - [ -e /proc/sys/dev/$device/countrycode ] && cc="$(cat /proc/sys/dev/$device/countrycode)" - if [ ! "$cc" = "$country" ] ; then - rmmod ath_pci - insmod ath_pci countrycode=$country - fi + echo "$country" > /proc/sys/dev/$device/countrycode + + config_get outdoor "$device" outdoor + [ -z "$outdoor" ] && outdoor="0" + echo "$outdoor" > /proc/sys/dev/$device/outdoor + config_get channel "$device" channel config_get vifs "$device" vifs config_get txpower "$device" txpower |