wifi: iwlwifi: mld: Fix ROC activity cleanup in iwl_mld_vif
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Fri, 9 May 2025 10:44:49 +0000 (13:44 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 10 May 2025 18:42:55 +0000 (21:42 +0300)
The roc_activity member in the iwl_mld_vif structure was previously
set to zero during cleanup as was present in struct_group, which
incorrectly indicated ROC_ACTIVITY_HOTSPOT.
To fix this issue, remove roc_activity member from struct_group.
Notify mac80211 of ROC expiration during vif cleanup to maintain
synchronization between the driver and mac80211.
While on it, update it's type to enum iwl_roc_activity.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/iface.c
drivers/net/wireless/intel/iwlwifi/mld/iface.h

index c083ba416d403d8b37c0a5374bb4c1c6ad04829b..fdb7a3b3107db153cbd6d81fb38ae6e05ecd3202 100644 (file)
@@ -25,6 +25,9 @@ void iwl_mld_cleanup_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
        /* EMLSR is turned back on during recovery */
        vif->driver_flags &= ~IEEE80211_VIF_EML_ACTIVE;
 
+       if (mld_vif->roc_activity != ROC_NUM_ACTIVITIES)
+               ieee80211_remain_on_channel_expired(mld->hw);
+
        mld_vif->roc_activity = ROC_NUM_ACTIVITIES;
 
        for_each_mld_vif_valid_link(mld_vif, link) {
index 1ae522431f3f1e172cd60cf613ea5275d21d72fe..3437f0c422cf81708cefc3e982dfda5b716426cf 100644 (file)
@@ -10,6 +10,7 @@
 #include "link.h"
 #include "session-protect.h"
 #include "d3.h"
+#include "fw/api/time-event.h"
 
 enum iwl_mld_cca_40mhz_wa_status {
        CCA_40_MHZ_WA_NONE,
@@ -125,8 +126,6 @@ struct iwl_mld_emlsr {
  *     Only valid for STA. (FIXME: needs to be per link)
  * @num_associated_stas: number of associated STAs. Relevant only for AP mode.
  * @ap_ibss_active: whether the AP/IBSS was started
- * @roc_activity: the id of the roc_activity running. Relevant for p2p device
- *     only. Set to %ROC_NUM_ACTIVITIES when not in use.
  * @cca_40mhz_workaround: When we are connected in 2.4 GHz and 40 MHz, and the
  *     environment is too loaded, we work around this by reconnecting to the
  *     same AP with 20 MHz. This manages the status of the workaround.
@@ -142,6 +141,8 @@ struct iwl_mld_emlsr {
  * @use_ps_poll: use ps_poll frames
  * @disable_bf: disable beacon filter
  * @dbgfs_slink: debugfs symlink for this interface
+ * @roc_activity: the id of the roc_activity running. Relevant for p2p device
+ *     only. Set to %ROC_NUM_ACTIVITIES when not in use.
  */
 struct iwl_mld_vif {
        /* Add here fields that need clean up on restart */
@@ -153,7 +154,6 @@ struct iwl_mld_vif {
                struct ieee80211_key_conf __rcu *bigtks[2];
                u8 num_associated_stas;
                bool ap_ibss_active;
-               u32 roc_activity;
                enum iwl_mld_cca_40mhz_wa_status cca_40mhz_workaround;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
                bool beacon_inject_active;
@@ -176,6 +176,7 @@ struct iwl_mld_vif {
        bool disable_bf;
        struct dentry *dbgfs_slink;
 #endif
+       enum iwl_roc_activity roc_activity;
 };
 
 static inline struct iwl_mld_vif *