]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: Fix setting txpower with emulate_chanctx
authorBen Greear <greearb@candelatech.com>
Tue, 24 Sep 2024 01:13:25 +0000 (18:13 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 8 Oct 2024 19:15:19 +0000 (21:15 +0200)
Propagate hw conf into the driver when txpower changes
and driver is emulating channel contexts.

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

index 847304a3a29a9631174cb63823f119f844f57759..7cefe763b772004aa60f900269d2122ec28be387 100644 (file)
@@ -3046,6 +3046,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
        enum nl80211_tx_power_setting txp_type = type;
        bool update_txp_type = false;
        bool has_monitor = false;
+       int old_power = local->user_power_level;
 
        lockdep_assert_wiphy(local->hw.wiphy);
 
@@ -3128,6 +3129,10 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
                }
        }
 
+       if (local->emulate_chanctx &&
+           (old_power != local->user_power_level))
+               ieee80211_hw_conf_chan(local);
+
        return 0;
 }