linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: ignore AP power level when tx power type is "fixed"
@ 2015-12-05 14:07 Felix Fietkau
  2015-12-11 14:13 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2015-12-05 14:07 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

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>
---
 net/mac80211/iface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index d6a1a46..f3ee9ab 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -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) {
-- 
2.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] mac80211: ignore AP power level when tx power type is "fixed"
  2015-12-05 14:07 [RFC] mac80211: ignore AP power level when tx power type is "fixed" Felix Fietkau
@ 2015-12-11 14:13 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-12-11 14:13 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless

On Sat, 2015-12-05 at 15:07 +0100, Felix Fietkau wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-11 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-05 14:07 [RFC] mac80211: ignore AP power level when tx power type is "fixed" Felix Fietkau
2015-12-11 14:13 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).