diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2013-11-11 22:00:39 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2013-11-11 22:00:39 +0000 |
commit | 84dc70b8a0986afe34123adb86a6cd9cccf8b5f5 (patch) | |
tree | 50bab839c405ae9328f7632fe546ba86f0d49c56 /package/kernel/broadcom-wl/files | |
parent | e0aeebea8ecb0076e65597eef9f4581a04c015d1 (diff) | |
download | master-187ad058-84dc70b8a0986afe34123adb86a6cd9cccf8b5f5.tar.gz master-187ad058-84dc70b8a0986afe34123adb86a6cd9cccf8b5f5.tar.bz2 master-187ad058-84dc70b8a0986afe34123adb86a6cd9cccf8b5f5.zip |
broadcom-wl: simplify processing of 'hwmode'
Default gmode to "GOnly" unless explicitly overwridden. This corrects
processing for 11ng to specify "GOnly" for gmode instead of "Auto"
(which translated to "bg").
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38754 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/broadcom-wl/files')
-rw-r--r-- | package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 191092af38..7721b87191 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -165,32 +165,34 @@ enable_broadcom() { ;; esac - [ ${channel:-0} -ge 1 -a ${channel:-0} -le 14 ] && band=2 - [ ${channel:-0} -ge 36 ] && band=1 + local gmode=2 nmode=0 nreqd= + case "$hwmode" in + *a) gmode=;; + *b) gmode=0;; + *bg) gmode=1;; + *g) gmode=2;; + *gst) gmode=4;; + *lrs) gmode=5;; + *) nmode=1; nreqd=0;; + esac case "$hwmode" in - *na) nmode=1; nreqd=0;; - *a) nmode=0;; - *ng) gmode=1; nmode=1; nreqd=0;; - *n) nmode=1; nreqd=1;; - *b) gmode=0; nmode=0;; - *bg) gmode=1; nmode=0;; - *g) gmode=2; nmode=0;; - *gst) gmode=4; nmode=0;; - *lrs) gmode=5; nmode=0;; - *) case "$band" in - 2) gmode=1; nmode=1; nreqd=0;; - 1) nmode=1; nreqd=0;; - *) gmode=1; nmode=1; nreqd=0;; - esac - ;; + n|11n) nmode=1; nreqd=1;; + *n*) nmode=1; nreqd=0;; esac # Use 'nmode' for N-Phy only - [ "$(wlc ifname $device phytype)" = 4 ] || nmode= + [ "$(wlc ifname "$device" phytype)" = 4 ] || nmode= + + local band chanspec + [ ${channel:-0} -ge 1 -a ${channel:-0} -le 14 ] && band=2 + [ ${channel:-0} -ge 36 ] && { + band=1 + gmode= + } # Use 'chanspec' instead of 'channel' for 'N' modes (See bcmwifi.h) - [ ${nmode:-0} -ne 0 -a -n "$band" ] && { + [ ${nmode:-0} -ne 0 -a -n "$band" -a -n "$channel" ] && { case "$htmode" in HT40-) chanspec=$(printf 0x%x%x%02x $band 0xe $(($channel - 2))); channel=;; HT40+) chanspec=$(printf 0x%x%x%02x $band 0xd $(($channel + 2))); channel=;; @@ -352,7 +354,7 @@ enable_broadcom() { wlc ifname "$device" stdin <<EOF $ifdown -${nmode:+band ${band:-0}} +band ${band:-0} ${nmode:+nmode $nmode} ${nmode:+${nreqd:+nreqd $nreqd}} ${gmode:+gmode $gmode} |