aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpackage/base-files/files/etc/init.d/boot6
-rw-r--r--package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh30
-rw-r--r--package/kernel/mac80211/files/lib/wifi/mac80211.sh43
3 files changed, 37 insertions, 42 deletions
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 904f7db75e..03b0fa0419 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -41,11 +41,7 @@ boot() {
# allow wifi modules time to settle
sleep 1
- /sbin/wifi detect > /tmp/wireless.tmp
- [ -s /tmp/wireless.tmp ] && {
- cat /tmp/wireless.tmp >> /etc/config/wireless
- }
- rm -f /tmp/wireless.tmp
+ /sbin/wifi detect
/bin/config_generate
uci_apply_defaults
diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
index deb4ddf1d2..2780fa1679 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
}
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 <<EOF
-config wifi-device radio$devidx
- option type mac80211
- option channel ${channel}
- option hwmode 11${mode_band}
-$dev_id
-$ht_capab
- # REMOVE THIS LINE TO ENABLE WIFI:
- option disabled 1
-
-config wifi-iface
- option device radio$devidx
- option network lan
- option mode ap
- option ssid LEDE
- option encryption none
-
+ uci -q batch <<-EOF
+ set wireless.radio${devidx}=wifi-device
+ set wireless.radio${devidx}.type=mac80211
+ set wireless.radio${devidx}.channel=${channel}
+ set wireless.radio${devidx}.hwmode=11${mode_band}
+ ${dev_id}
+ ${ht_capab}
+ set wireless.radio${devidx}.disabled=1
+
+ set wireless.default_radio${devidx}=wifi-iface
+ set wireless.default_radio${devidx}.device=radio${devidx}
+ set wireless.default_radio${devidx}.network=lan
+ set wireless.default_radio${devidx}.mode=ap
+ set wireless.default_radio${devidx}.ssid=LEDE
+ set wireless.default_radio${devidx}.encryption=none
EOF
- devidx=$(($devidx + 1))
+ uci -q commit wireless
+
+ devidx=$(($devidx + 1))
done
}
-