diff mbox series

[06/14] wifi: mac80211: ieee80211_recalc_txpower receives a link

Message ID 20241007144851.705bbf953d0a.I8a429dede07bab5801f4c730a6abff7ce23b22d3@changeid
State New
Headers show
Series mac80211/cfg80211 updates 07-10-2024 | expand

Commit Message

Miri Korenblit Oct. 7, 2024, noon UTC
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Handle the tx power per-link. Don't change the behavior for now. Just
change the signature of the function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/cfg.c         | 7 ++++---
 net/mac80211/chan.c        | 4 ++--
 net/mac80211/ieee80211_i.h | 2 +-
 net/mac80211/iface.c       | 8 ++++----
 4 files changed, 11 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 548b9bbdac04..27468a463d8b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3096,7 +3096,7 @@  static int ieee80211_set_tx_power(struct wiphy *wiphy,
 			sdata->vif.bss_conf.txpower_type = txp_type;
 		}
 
-		ieee80211_recalc_txpower(sdata, update_txp_type);
+		ieee80211_recalc_txpower(&sdata->deflink, update_txp_type);
 
 		return 0;
 	}
@@ -3127,7 +3127,7 @@  static int ieee80211_set_tx_power(struct wiphy *wiphy,
 	list_for_each_entry(sdata, &local->interfaces, list) {
 		if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
-		ieee80211_recalc_txpower(sdata, update_txp_type);
+		ieee80211_recalc_txpower(&sdata->deflink, update_txp_type);
 	}
 
 	if (has_monitor) {
@@ -3139,7 +3139,8 @@  static int ieee80211_set_tx_power(struct wiphy *wiphy,
 				update_txp_type = true;
 			sdata->vif.bss_conf.txpower_type = txp_type;
 
-			ieee80211_recalc_txpower(sdata, update_txp_type);
+			ieee80211_recalc_txpower(&sdata->deflink,
+						 update_txp_type);
 		}
 	}
 
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 4b07bdfdf658..a4cc91beee74 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -905,7 +905,7 @@  static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
 	}
 
 	if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) {
-		ieee80211_recalc_txpower(sdata, false);
+		ieee80211_recalc_txpower(&sdata->deflink, false);
 		ieee80211_recalc_chanctx_min_def(local, new_ctx, NULL, false);
 	}
 
@@ -1712,7 +1712,7 @@  static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local)
 								  link,
 								  changed);
 
-			ieee80211_recalc_txpower(sdata, false);
+			ieee80211_recalc_txpower(&sdata->deflink, false);
 		}
 
 		ieee80211_recalc_chanctx_chantype(local, ctx);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ea74b625aa6c..67de4675c33a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2034,7 +2034,7 @@  int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
 void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
 
 bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
-void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
+void ieee80211_recalc_txpower(struct ieee80211_link_data *link,
 			      bool update_bss);
 void ieee80211_recalc_offload(struct ieee80211_local *local);
 
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 6ef0990d3d29..e4a8ed102736 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -74,12 +74,12 @@  bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
 	return false;
 }
 
-void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
+void ieee80211_recalc_txpower(struct ieee80211_link_data *link,
 			      bool update_bss)
 {
-	if (__ieee80211_recalc_txpower(sdata) ||
-	    (update_bss && ieee80211_sdata_running(sdata)))
-		ieee80211_link_info_change_notify(sdata, &sdata->deflink,
+	if (__ieee80211_recalc_txpower(link->sdata) ||
+	    (update_bss && ieee80211_sdata_running(link->sdata)))
+		ieee80211_link_info_change_notify(link->sdata, link,
 						  BSS_CHANGED_TXPOWER);
 }