]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mac80211: fix user-power when emulating chanctx
authorBen Greear <greearb@candelatech.com>
Thu, 10 Oct 2024 20:39:54 +0000 (13:39 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Oct 2024 15:53:38 +0000 (17:53 +0200)
ieee80211_calc_hw_conf_chan was ignoring the configured
user_txpower.  If it is set, use it to potentially decrease
txpower as requested.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://patch.msgid.link/20241010203954.1219686-1-greearb@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c

index 89084690350fd7cb6f7311298cd2497098384c2b..ee1211a213d702acd8d35f0e2bc8ce626b33a584 100644 (file)
@@ -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) {