summaryrefslogtreecommitdiff
path: root/package/mac80211/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-11-06 18:49:17 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-11-06 18:49:17 +0000
commitd7205a90219ae93bb6ac87360a27ec3c6e242cd1 (patch)
treee1abc5ba89d149fe6a0e23d9e8f89839f752c6ea /package/mac80211/files
parent6037187a801737b2829aff1b1fcddb2b2816c9b6 (diff)
downloadmtk-20170518-d7205a90219ae93bb6ac87360a27ec3c6e242cd1.zip
mtk-20170518-d7205a90219ae93bb6ac87360a27ec3c6e242cd1.tar.gz
mtk-20170518-d7205a90219ae93bb6ac87360a27ec3c6e242cd1.tar.bz2
mac80211: change wireless ifname numbering schema Instead of simply counting up until we hit a free iface, group ifnames by wiphy so that the first wlanX on a phy gets the phy number and following ifaces an index-suffix, e.g. wlan0 for network 1 on phy 1 and wlan0-1 for network 2 on phy 1. This fixes state var confusion when operating multiple radios and allows to reliably take down and restart one radio only, even if the number of networks changes in between. This should, along with other changes in LuCI, fix #10335.
SVN-Revision: 28784
Diffstat (limited to 'package/mac80211/files')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 1ae0c20..738c2aa 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -329,13 +329,9 @@ enable_mac80211() {
wifi_fixup_hwmode "$device" "g"
for vif in $vifs; do
- while [ -d "/sys/class/net/wlan$i" ]; do
- i=$(($i + 1))
- done
-
config_get ifname "$vif" ifname
[ -n "$ifname" ] || {
- ifname="wlan$i"
+ [ $i -gt 0 ] && ifname="wlan${phy#phy}-$i" || ifname="wlan${phy#phy}"
}
config_set "$vif" ifname "$ifname"
@@ -351,7 +347,6 @@ enable_mac80211() {
# Hostapd will handle recreating the interface and
# it's accompanying monitor
apidx="$(($apidx + 1))"
- i=$(($i + 1))
[ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed
;;
mesh)
@@ -404,6 +399,8 @@ enable_mac80211() {
# wifi-device) if the latter doesn't exist
txpower="${txpower:-$vif_txpower}"
[ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
+
+ i=$(($i + 1))
done
local start_hostapd=