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"
# 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)
iw phy "$phy" interface add "$ifname" type managed $wdsflag
config_get_bool powersave "$vif" powersave 0
[ "$powersave" -gt 0 ] && powersave="on" || powersave="off"
- iwconfig "$ifname" power "$powersave"
+ iw "$ifname" set power_save "$powersave"
;;
esac
[ -n "$fixed" -a -n "$channel" ] && iw dev "$ifname" set channel "$channel"
fi
- config_get vif_txpower "$vif" txpower
- # use vif_txpower (from wifi-iface) to override txpower (from
- # 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=
[ ! "$mode" = "ap" ] || continue
ifconfig "$ifname" up
+ config_get vif_txpower "$vif" txpower
+ # use vif_txpower (from wifi-iface) to override txpower (from
+ # wifi-device) if the latter doesn't exist
+ txpower="${txpower:-$vif_txpower}"
+ [ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
+
if [ ! "$mode" = "ap" ]; then
ifconfig "$ifname" up
case "$mode" in