mac80211: fix applying tx/rx antenna changes afer hostapd reload change

Tear down all interfaces if the antenna settings change, so that the
capabilities can be recalculated properly

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2023-08-08 20:12:11 +02:00
parent 9b56c27a8a
commit afa229038c

View File

@ -1089,14 +1089,18 @@ drv_mac80211_setup() {
json_get_values scan_list scan_list
json_select ..
json_select data && {
json_get_var prev_rxantenna rxantenna
json_get_var prev_txantenna txantenna
json_select ..
}
find_phy || {
echo "Could not find PHY for device '$1'"
wireless_set_retry 0
return 1
}
wireless_set_data phy="$phy"
local wdev
local cwdev
local found
@ -1130,6 +1134,9 @@ drv_mac80211_setup() {
[ "$txantenna" = "all" ] && txantenna=0xffffffff
[ "$rxantenna" = "all" ] && rxantenna=0xffffffff
[ "$rxantenna" = "$prev_rxantenna" -a "$txantenna" = "$prev_txantenna" ] || mac80211_reset_config "$phy"
wireless_set_data phy="$phy" txantenna="$txantenna" rxantenna="$rxantenna"
iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
iw phy "$phy" set antenna_gain $antenna_gain >/dev/null 2>&1
iw phy "$phy" set distance "$distance" >/dev/null 2>&1