Skip to contentSkip to conversation

mac80211: ignore AP power level when tx power type is "fixed"

RFC In review Felix Fietkau 2 participants 2 messages Dec 5, 2015 – Dec 11, 2015 mac80211

lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: ignore AP power level when tx power type is "fixed"

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.

---
 net/mac80211/iface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/iface.c +2 -1
index d6a1a46..f3ee9ab 100644
@@ -61,7 +61,8 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
 	if (sdata->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
 		power = min(power, sdata->user_power_level);
 
-	if (sdata->ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
+	if (sdata->ap_power_level != IEEE80211_UNSET_POWER_LEVEL &&
+	    sdata->vif.bss_conf.txpower_type != NL80211_TX_POWER_FIXED)
 		power = min(power, sdata->ap_power_level);
 
 	if (power != sdata->vif.bss_conf.txpower) {
Signature · 1 line
2.2.2
maintainer
#1 lore raw
Quoted 11 lines · Felix Fietkau

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.

This seems reasonable. Maybe we should document it though?

johannes