Skip to contentSkip to conversation

mac80211: fix user-power when emulating chanctx

PATCH New [email protected] 1 participant 1 message Oct 10, 2024 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix user-power when emulating chanctx

From: Ben Greear <[email protected]>

ieee80211_calc_hw_conf_chan was ignoring the configured user_txpower. If it is set, use it to potentially decrease txpower as requested.

---
 net/mac80211/main.c | 2 ++
 1 file changed, 2 insertions(+)
net/mac80211/main.c +2 -0
index bac640310d86..ca20d08a9d21 100644
@@ -167,6 +167,8 @@ static u32 ieee80211_calc_hw_conf_chan(struct ieee80211_local *local,
 	}
 
 	power = ieee80211_chandef_max_power(&chandef);
+	if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
+		power = min(local->user_power_level, power);
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
Signature · 1 line
2.42.0