summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorVasilis Tsiligiannis <acinonyx@openwrt.gr>2009-07-12 15:37:59 +0000
committerVasilis Tsiligiannis <acinonyx@openwrt.gr>2009-07-12 15:37:59 +0000
commita4ed68fbe47ef5a14cbe1d316a2ac159747a0f66 (patch)
tree54d244488e1c48e182a8be7a27ee2bfefbc0f2e1 /package
parentfc5ad602888f7843a8cc4d079d6ed98c1cc95467 (diff)
downloadmtk-20170518-a4ed68fbe47ef5a14cbe1d316a2ac159747a0f66.zip
mtk-20170518-a4ed68fbe47ef5a14cbe1d316a2ac159747a0f66.tar.gz
mtk-20170518-a4ed68fbe47ef5a14cbe1d316a2ac159747a0f66.tar.bz2
madwifi.sh channel fix
In the madwifi.sh there is to read "only need to change freq band and channel on the first vif". This is wrong. For example if you create a new Ad-Hoc network and an AP interface, the channel is reseted to 1, regardless of the UCI setting. So remove this wrong code. Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> SVN-Revision: 16814
Diffstat (limited to 'package')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh39
1 files changed, 17 insertions, 22 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index 8097806..fc692c0 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -126,7 +126,6 @@ enable_atheros() {
config_get distance "$device" distance
[ -n "$distance" ] && sysctl -w dev."$device".distance="$distance" >&-
- local first=1
for vif in $vifs; do
local start_hostapd= vif_txpower= nosbeacon=
config_get ifname "$vif" ifname
@@ -146,29 +145,26 @@ enable_atheros() {
}
config_set "$vif" ifname "$ifname"
- # only need to change freq band and channel on the first vif
- [ "$first" = 1 ] && {
config_get hwmode "$device" hwmode
[ -z "$hwmode" ] && config_get hwmode "$device" mode
- pureg=0
- case "$hwmode" in
- *b) hwmode=11b;;
- *bg) hwmode=11g;;
- *g) hwmode=11g; pureg=1;;
- *gdt) hwmode=11gdt;;
- *a) hwmode=11a;;
- *adt) hwmode=11adt;;
- *ast) hwmode=11ast;;
- *fh) hwmode=fh;;
- *) hwmode=auto;;
- esac
- iwpriv "$ifname" mode "$hwmode"
- iwpriv "$ifname" pureg "$pureg"
-
- iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
- }
-
+ pureg=0
+ case "$hwmode" in
+ *b) hwmode=11b;;
+ *bg) hwmode=11g;;
+ *g) hwmode=11g; pureg=1;;
+ *gdt) hwmode=11gdt;;
+ *a) hwmode=11a;;
+ *adt) hwmode=11adt;;
+ *ast) hwmode=11ast;;
+ *fh) hwmode=fh;;
+ *) hwmode=auto;;
+ esac
+ iwpriv "$ifname" mode "$hwmode"
+ iwpriv "$ifname" pureg "$pureg"
+
+ iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
+
config_get_bool hidden "$vif" hidden 0
iwpriv "$ifname" hide_ssid "$hidden"
@@ -339,7 +335,6 @@ enable_atheros() {
fi
;;
esac
- first=0
done
}