Skip to content

Commit

Permalink
mac80211: ignore AP power level when tx power type is "fixed"
Browse files Browse the repository at this point in the history
In some cases a user might want to connect to a far away access point,
which announces a low tx power limit. Using the AP's power limit can
make the connection significantly more unstable or even impossible, and
mac80211 currently provides no way to disable this behavior.

To fix this, use the currently unused distinction between limited and
fixed tx power to decide whether a remote AP's power limit should be
accepted.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
Felix Fietkau authored and xanmod committed Oct 30, 2023
1 parent 43e8b77 commit ef1443c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
if (sdata->deflink.user_power_level != IEEE80211_UNSET_POWER_LEVEL)
power = min(power, sdata->deflink.user_power_level);

if (sdata->deflink.ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
if (sdata->deflink.ap_power_level != IEEE80211_UNSET_POWER_LEVEL &&
sdata->vif.bss_conf.txpower_type != NL80211_TX_POWER_FIXED)
power = min(power, sdata->deflink.ap_power_level);

if (power != sdata->vif.bss_conf.txpower) {
Expand Down

0 comments on commit ef1443c

Please sign in to comment.