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.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28784
3c298f89-4303-0410-b956-
a3cf2f4a3e73
wifi_fixup_hwmode "$device" "g"
for vif in $vifs; do
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" ] || {
config_get ifname "$vif" ifname
[ -n "$ifname" ] || {
+ [ $i -gt 0 ] && ifname="wlan${phy#phy}-$i" || ifname="wlan${phy#phy}"
}
config_set "$vif" ifname "$ifname"
}
config_set "$vif" ifname "$ifname"
# Hostapd will handle recreating the interface and
# it's accompanying monitor
apidx="$(($apidx + 1))"
# Hostapd will handle recreating the interface and
# it's accompanying monitor
apidx="$(($apidx + 1))"
[ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed
;;
mesh)
[ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed
;;
mesh)
# wifi-device) if the latter doesn't exist
txpower="${txpower:-$vif_txpower}"
[ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
# wifi-device) if the latter doesn't exist
txpower="${txpower:-$vif_txpower}"
[ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
done
local start_hostapd=
done
local start_hostapd=