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
}
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