From 56ae52b0080c73fd3fd181cad0a3a79253aafc1b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 6 May 2009 11:52:24 +0000 Subject: madwifi: make country code and outdoor flag changeable without reloading the driver SVN-Revision: 15633 --- package/madwifi/files/lib/wifi/madwifi.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to '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 8c4a754..2fe8664 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 -- cgit v1.1