summaryrefslogtreecommitdiff
path: root/package/kernel/broadcom-wl/files/lib
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2016-10-17 15:59:13 +0200
committerFelix Fietkau <nbd@nbd.name>2016-11-03 11:08:01 +0100
commit5e35b4562fb73aaa1c75a3404fed2efb6afe03f8 (patch)
tree6158914891186bf0015814228d513d7693da2c61 /package/kernel/broadcom-wl/files/lib
parentba3540db6223a0107fd78decafea702a0537af7a (diff)
downloadmtk-20170518-5e35b4562fb73aaa1c75a3404fed2efb6afe03f8.zip
mtk-20170518-5e35b4562fb73aaa1c75a3404fed2efb6afe03f8.tar.gz
mtk-20170518-5e35b4562fb73aaa1c75a3404fed2efb6afe03f8.tar.bz2
base-files, mac80211, broadcom-wl: use uci to populate wireless config
Previously, wifi detect simply dumped its generated wireless configuration to STDOUT. A second step was needed to append the configuration to /etc/config/wireless (or create it, if it didn't exist). With this patch, The wifi detection script will now use uci to update the wireless configuration directly. This patch also makes the initially created wifi-iface a named section ('default_radio$X' for mac80211 and 'default_wl$X' for broadcom). With this change, uci will not print the cfgHASH to STDOUT (which would now corrupt the wireless configuration). It will also prevent adding duplicated wifi interface configurations, if the wifi configuration is run concurrently. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/kernel/broadcom-wl/files/lib')
-rw-r--r--package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
index deb4ddf..2780fa1 100644
--- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -456,22 +456,22 @@ detect_broadcom() {
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 ${channel:-11}
- option txantenna 3
- option rxantenna 3
- # REMOVE THIS LINE TO ENABLE WIFI:
- option disabled 1
-
-config wifi-iface
- option device wl${i}
- option network lan
- option mode ap
- option ssid Lede${i#0}
- option encryption none
+ uci -q batch <<-EOF
+ set wireless.wl${i}=wifi-device
+ set wireless.wl${i}.type=broadcom
+ set wireless.wl${i}.channel=${channel:-11}
+ set wireless.wl${i}.txantenna=3
+ set wireless.wl${i}.rxantenna=3
+ set wireless.wl${i}.disabled=1
+
+ set wireless.default_wl${i}=wifi-iface
+ set wireless.default_wl${i}.device=wl${i}
+ set wireless.default_wl${i}.network=lan
+ set wireless.default_wl${i}.mode=ap
+ set wireless.default_wl${i}.ssid=Lede${i#0}
+ set wireless.default_wl${i}.encryption=none
EOF
+ uci -q commit wireless
done
}