aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-08-21 14:54:51 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-08-21 14:54:51 +0000
commit3104611a8f599b29edf310614c8949b05f4c3fbd (patch)
tree9a4f4181bb8728b5219ab5f9edd9fdb388a94c39 /package/madwifi
parent0809d8a292b49effefff1d18db1c84a5065527f4 (diff)
downloadupstream-3104611a8f599b29edf310614c8949b05f4c3fbd.tar.gz
upstream-3104611a8f599b29edf310614c8949b05f4c3fbd.tar.bz2
upstream-3104611a8f599b29edf310614c8949b05f4c3fbd.zip
madwifi: keep a/g mode and pureg setting in sync across vaps
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12363 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/madwifi')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh37
1 files changed, 19 insertions, 18 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index bec72383b3..cc340977b2 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -94,25 +94,26 @@ enable_atheros() {
}
config_set "$vif" ifname "$ifname"
+ # only need to change freq band and channel on the first vif
+ config_get agmode "$device" agmode
+ [ -z "$agmode" ] && config_get agmode "$device" mode
+
+ pureg=0
+ case "$agmode" in
+ *b) agmode=11b;;
+ *bg) agmode=11g;;
+ *g) agmode=11g; pureg=1;;
+ *gdt) agmode=11gdt;;
+ *a) agmode=11a;;
+ *adt) agmode=11adt;;
+ *ast) agmode=11ast;;
+ *fh) agmode=fh;;
+ *) agmode=auto;;
+ esac
+ iwpriv "$ifname" mode "$agmode"
+ iwpriv "$ifname" pureg "$pureg"
+
[ "$first" = 1 ] && {
- # only need to change freq band and channel on the first vif
- config_get agmode "$device" agmode
- [ -z "$agmode" ] && config_get agmode "$device" mode
-
- pureg=0
- case "$agmode" in
- *b) agmode=11b;;
- *bg) agmode=11g;;
- *g) agmode=11g; pureg=1;;
- *gdt) agmode=11gdt;;
- *a) agmode=11a;;
- *adt) agmode=11adt;;
- *ast) agmode=11ast;;
- *fh) agmode=fh;;
- *) agmode=auto;;
- esac
- iwpriv "$ifname" mode "$agmode"
- iwpriv "$ifname" pureg "$pureg"
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
}