madwifi: keep a/g mode and pureg setting in sync across vaps
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 21 Aug 2008 14:54:51 +0000 (14:54 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 21 Aug 2008 14:54:51 +0000 (14:54 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12363 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/madwifi/files/lib/wifi/madwifi.sh

index bec7238..cc34097 100755 (executable)
@@ -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 
                }
        
This page took 0.023862 seconds and 4 git commands to generate.