From 5e35b4562fb73aaa1c75a3404fed2efb6afe03f8 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 17 Oct 2016 15:59:13 +0200 Subject: 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 --- package/kernel/mac80211/files/lib/wifi/mac80211.sh | 43 +++++++++++----------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'package/kernel/mac80211/files') diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 9b15de55a8..4bfc7424b2 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -92,7 +92,7 @@ detect_mac80211() { htmode="VHT80" } - [ -n $htmode ] && append ht_capab " option htmode $htmode" "$N" + [ -n $htmode ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode" if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then path="$(readlink -f /sys/class/ieee80211/${dev}/device)" @@ -104,30 +104,29 @@ detect_mac80211() { case "$path" in platform*/pci*) path="${path##platform/}";; esac - dev_id=" option path '$path'" + dev_id="set wireless.radio${devidx}.path='$path'" else - dev_id=" option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)" + dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)" fi - cat <