linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.12] mac80211: fix a tx power handling regression
@ 2013-09-29 12:48 Felix Fietkau
  2013-09-30  9:09 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Fietkau @ 2013-09-29 12:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

commit 1ea6f9c0d48b11b6ec3ec4b5579ec74fc3951cf8
"mac80211: handle TX power per virtual interface"

This commit added support for tracking tx power configuration for
multiple interfaces, however instead of using the maximum value of all
virtual interfaces, it uses the minimum.

This causes the configured tx power to be reset to the absolute minimum
for all virtual interfaces, whenever an interface is created and destroyed
immediately afterwards.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 21d5d44..87c5509 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -97,7 +97,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
 	struct ieee80211_sub_if_data *sdata;
 	struct cfg80211_chan_def chandef = {};
 	u32 changed = 0;
-	int power;
+	int power = 0;
 	u32 offchannel_flag;
 
 	offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
@@ -142,16 +142,16 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
 		changed |= IEEE80211_CONF_CHANGE_SMPS;
 	}
 
-	power = ieee80211_chandef_max_power(&chandef);
-
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 		if (!rcu_access_pointer(sdata->vif.chanctx_conf))
 			continue;
-		power = min(power, sdata->vif.bss_conf.txpower);
+		power = max(power, sdata->vif.bss_conf.txpower);
 	}
 	rcu_read_unlock();
 
+	power = min(power, ieee80211_chandef_max_power(&chandef));
+
 	if (local->hw.conf.power_level != power) {
 		changed |= IEEE80211_CONF_CHANGE_POWER;
 		local->hw.conf.power_level = power;
-- 
1.8.0.2


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

end of thread, other threads:[~2013-10-01 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-29 12:48 [PATCH 3.12] mac80211: fix a tx power handling regression Felix Fietkau
2013-09-30  9:09 ` Johannes Berg
2013-09-30  9:43   ` Felix Fietkau
2013-09-30 10:38     ` Johannes Berg
2013-09-30 10:51       ` Felix Fietkau
2013-10-01 12:32         ` 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).