config_get channel "$device" channel
config_get vifs "$device" vifs
config_get txpower "$device" txpower
+ config_get country "$device" country
find_mac80211_phy "$device" || return 0
config_get phy "$device" phy
local i=0
fixed=""
+ [ -n "$country" ] && iw reg set "$country"
[ "$channel" = "auto" -o "$channel" = "0" ] || {
fixed=1
}
else
offset="0"
fi
- vif_mac="$( printf %02x $(($mac_1 + $offset)) ):$mac_2"
+ vif_mac="$( printf %02x $((0x$mac_1 + $offset)) ):$mac_2"
}
ifconfig "$ifname" hw ether "$vif_mac"
if [ -n "$keymgmt" ]; then
for idx in 1 2 3 4; do
local zidx
- zidx = $((idx - 1))
+ zidx=$(($idx - 1))
config_get key "$vif" "key${idx}"
if [ -n "$key" ]; then
append keystring "${zidx}:${key} "
config_get rts "$vif" rts
if [ -n "$rts" ]; then
- iw phy "$phy" set rts "${frag%%.*}"
+ iw phy "$phy" set rts "${rts%%.*}"
fi
ifconfig "$ifname" up
check_device() {
config_get phy "$1" phy
[ -z "$phy" ] && {
- find_mac80211_phy "$1" || return 0
+ find_mac80211_phy "$1" >/dev/null || return 0
config_get phy "$1" phy
}
[ "$phy" = "$dev" ] && found=1