diff mbox series

[32/76] wifi: mac80211: mlme: do IEEE80211_STA_RESET_SIGNAL_AVE per link

Message ID 20220713114425.3604eb6f0df1.I2398433851572c95290b613422cc08d5b5cc9625@changeid
State New
Headers show
Series wifi: more MLO work | expand

Commit Message

Johannes Berg July 13, 2022, 9:44 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Remove the IEEE80211_STA_RESET_SIGNAL_AVE flag and use
a bool instead, but invert the polarity (now calling it
tracking_signal_avg) so we don't have to initialize it,
and put that into the link instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/ieee80211_i.h | 2 +-
 net/mac80211/mlme.c        | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 699dabaa9f0d..711129edd923 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -361,7 +361,6 @@  enum ieee80211_sta_flags {
 	IEEE80211_STA_MFP_ENABLED	= BIT(6),
 	IEEE80211_STA_UAPSD_ENABLED	= BIT(7),
 	IEEE80211_STA_NULLFUNC_ACKED	= BIT(8),
-	IEEE80211_STA_RESET_SIGNAL_AVE	= BIT(9),
 	IEEE80211_STA_DISABLE_WMM	= BIT(14),
 	IEEE80211_STA_ENABLE_RRM	= BIT(15),
 };
@@ -885,6 +884,7 @@  struct ieee80211_link_data_managed {
 	s16 p2p_noa_index;
 
 	bool have_beacon;
+	bool tracking_signal_avg;
 
 	bool csa_waiting_bcn;
 	bool csa_ignored_same_chan;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 52dc336cadfa..bcc817de6bd0 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2316,8 +2316,6 @@  static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
 
 	ieee80211_check_rate_mask(sdata);
 
-	sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE;
-
 	if (sdata->vif.p2p ||
 	    sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {
 		const struct cfg80211_bss_ies *ies;
@@ -2522,6 +2520,7 @@  static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	sdata->vif.bss_conf.beacon_rate = NULL;
 
 	sdata->deflink.u.mgd.have_beacon = false;
+	sdata->deflink.u.mgd.tracking_signal_avg = false;
 
 	ifmgd->flags = 0;
 	sdata->deflink.u.mgd.conn_flags = 0;
@@ -4051,8 +4050,8 @@  static void ieee80211_handle_beacon_sig(struct ieee80211_sub_if_data *sdata,
 {
 	/* Track average RSSI from the Beacon frames of the current AP */
 
-	if (ifmgd->flags & IEEE80211_STA_RESET_SIGNAL_AVE) {
-		ifmgd->flags &= ~IEEE80211_STA_RESET_SIGNAL_AVE;
+	if (!sdata->deflink.u.mgd.tracking_signal_avg) {
+		sdata->deflink.u.mgd.tracking_signal_avg = true;
 		ewma_beacon_signal_init(&sdata->deflink.u.mgd.ave_beacon_signal);
 		sdata->deflink.u.mgd.last_cqm_event_signal = 0;
 		sdata->deflink.u.mgd.count_beacon_signal = 1;