]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 09:59:29 +0000 (10:59 +0100)
[ Upstream commit 9b15c6cf8d2e82c8427cd06f535d8de93b5b995c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/main.c

index e8c4e9c0c5a09578dc351cd7acd198bed82076bd..71d10bdee430981136859592299a5b2aa316fc7d 100644 (file)
@@ -140,6 +140,8 @@ static u32 ieee80211_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) {