diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-08-21 14:54:51 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-08-21 14:54:51 +0000 |
commit | 4419978f8408d073307e69a929b739e4eff27922 (patch) | |
tree | 551f87c39644466665ecced3e251f64b2e0d74b1 /package/madwifi | |
parent | 2a05d8cbba5480e0f2ad9da7adec463a934c7bd8 (diff) | |
download | mtk-20170518-4419978f8408d073307e69a929b739e4eff27922.zip mtk-20170518-4419978f8408d073307e69a929b739e4eff27922.tar.gz mtk-20170518-4419978f8408d073307e69a929b739e4eff27922.tar.bz2 |
madwifi: keep a/g mode and pureg setting in sync across vaps
SVN-Revision: 12363
Diffstat (limited to 'package/madwifi')
-rwxr-xr-x | package/madwifi/files/lib/wifi/madwifi.sh | 37 |
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 bec7238..cc34097 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 } |