summaryrefslogtreecommitdiff
path: root/package/broadcom-wl
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-28 18:21:34 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-28 18:21:34 +0000
commitc8f24b9ffdfb1b0979735668d1323cfa6856dca9 (patch)
treef966c714177f7f616e5bab5b6d2366e0fe3321d7 /package/broadcom-wl
parenta323d417b63e05680b5bc777824169916b104aa1 (diff)
broadcom-wl: read channel using wlc on detect
Hardcoding channel number to 11 is a bad idea, it may be even not available on some devices. If there are two single-band radios, the one for 5GHz doesn't have 11 channel. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36479 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-wl')
-rw-r--r--package/broadcom-wl/files/lib/wifi/broadcom.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh
index 57e11e4b14..72b85aaf88 100644
--- a/package/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -370,12 +370,15 @@ detect_broadcom() {
local i=-1
while grep -qs "^ *wl$((++i)):" /proc/net/dev; do
+ local channel
+
config_get type wl${i} type
[ "$type" = broadcom ] && continue
+ channel=`wlc ifname wl${i} channel`
cat <<EOF
config wifi-device wl${i}
option type broadcom
- option channel 11
+ option channel ${channel:-11}
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1