mac80211: fix txpower when using DFS channels
With this patch, txpower for the PHY is applied when configuring the PHY instead of the VIF. Otherwise, the configured txpower is not applied for the first initialized VIF when using DFS channels, as it is currently applied too early when the CAC hasn't finished. Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net Signed-off-by: David Bauer <mail@david-bauer.net> Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
This commit is contained in:
parent
a15f658ed0
commit
6ec288a178
1 changed files with 7 additions and 2 deletions
|
@ -743,7 +743,7 @@ mac80211_setup_vif() {
|
||||||
|
|
||||||
json_select config
|
json_select config
|
||||||
json_get_vars mode
|
json_get_vars mode
|
||||||
json_get_var vif_txpower txpower
|
json_get_var vif_txpower
|
||||||
json_get_var vif_enable enable 1
|
json_get_var vif_enable enable 1
|
||||||
|
|
||||||
[ "$vif_enable" = 1 ] || action=down
|
[ "$vif_enable" = 1 ] || action=down
|
||||||
|
@ -753,7 +753,6 @@ mac80211_setup_vif() {
|
||||||
json_select ..
|
json_select ..
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set_default vif_txpower "$txpower"
|
|
||||||
[ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00"
|
[ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00"
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
|
@ -908,6 +907,12 @@ drv_mac80211_setup() {
|
||||||
iw phy "$phy" set antenna_gain $antenna_gain
|
iw phy "$phy" set antenna_gain $antenna_gain
|
||||||
iw phy "$phy" set distance "$distance"
|
iw phy "$phy" set distance "$distance"
|
||||||
|
|
||||||
|
if [ -n "$txpower" ]; then
|
||||||
|
iw phy "$phy" set txpower fixed "${txpower%%.*}00"
|
||||||
|
else
|
||||||
|
iw phy "$phy" set txpower auto
|
||||||
|
fi
|
||||||
|
|
||||||
[ -n "$frag" ] && iw phy "$phy" set frag "${frag%%.*}"
|
[ -n "$frag" ] && iw phy "$phy" set frag "${frag%%.*}"
|
||||||
[ -n "$rts" ] && iw phy "$phy" set rts "${rts%%.*}"
|
[ -n "$rts" ] && iw phy "$phy" set rts "${rts%%.*}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue