wifi: iwlwifi: mld: move aux_sta member from iwl_mld_link to iwl_mld_vif
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Fri, 9 May 2025 10:44:50 +0000 (13:44 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 10 May 2025 18:42:59 +0000 (21:42 +0300)
This change reflects the correct ownership of aux_sta,
as it is not a property of the link but rather of the virtual interface.
Updated the initialization, cleanup and access logic for the aux_sta member
to align with its new location within iwl_mld_vif.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-12-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
drivers/net/wireless/intel/iwlwifi/mld/link.c
drivers/net/wireless/intel/iwlwifi/mld/link.h
drivers/net/wireless/intel/iwlwifi/mld/roc.c
drivers/net/wireless/intel/iwlwifi/mld/sta.c
drivers/net/wireless/intel/iwlwifi/mld/sta.h
drivers/net/wireless/intel/iwlwifi/mld/tx.c

index fdb7a3b3107db153cbd6d81fb38ae6e05ecd3202..3aacca5ed6a3a610b7e718e8296fe20f43e220d7 100644 (file)
@@ -22,6 +22,9 @@ void iwl_mld_cleanup_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
        struct iwl_mld *mld = mld_vif->mld;
        struct iwl_mld_link *link;
 
+       if (mld_vif->aux_sta.sta_id != IWL_INVALID_STA)
+               iwl_mld_free_internal_sta(mld, &mld_vif->aux_sta);
+
        /* EMLSR is turned back on during recovery */
        vif->driver_flags &= ~IEEE80211_VIF_EML_ACTIVE;
 
@@ -408,6 +411,7 @@ iwl_mld_init_vif(struct iwl_mld *mld, struct ieee80211_vif *vif)
                wiphy_delayed_work_init(&mld_vif->emlsr.tmp_non_bss_done_wk,
                                        iwl_mld_emlsr_tmp_non_bss_done_wk);
        }
+       iwl_mld_init_internal_sta(&mld_vif->aux_sta);
 
        return 0;
 }
index 3437f0c422cf81708cefc3e982dfda5b716426cf..15b43711035131cacb1a3fa4274d8798339b6071 100644 (file)
@@ -143,6 +143,7 @@ struct iwl_mld_emlsr {
  * @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.
+ * @aux_sta: station used for remain on channel. Used in P2P device.
  */
 struct iwl_mld_vif {
        /* Add here fields that need clean up on restart */
@@ -177,6 +178,7 @@ struct iwl_mld_vif {
        struct dentry *dbgfs_slink;
 #endif
        enum iwl_roc_activity roc_activity;
+       struct iwl_mld_int_sta aux_sta;
 };
 
 static inline struct iwl_mld_vif *
index 80f7290ef8b271398c3f1961973dc93d592e1f8d..d0f56189ad3fd0504a71c5b041e0f1914094b61b 100644 (file)
@@ -782,7 +782,6 @@ iwl_mld_init_link(struct iwl_mld *mld, struct ieee80211_bss_conf *link,
 
        iwl_mld_init_internal_sta(&mld_link->bcast_sta);
        iwl_mld_init_internal_sta(&mld_link->mcast_sta);
-       iwl_mld_init_internal_sta(&mld_link->aux_sta);
        iwl_mld_init_internal_sta(&mld_link->mon_sta);
 
        if (!mld->fw_status.in_hw_restart)
index 86ca5b9286f887024b0b7566c392981862e0c2ab..39f04aae5579a6f2a34a481b78a6f09259f45880 100644 (file)
@@ -39,7 +39,6 @@ struct iwl_probe_resp_data {
  * @vif: the vif this link belongs to
  * @bcast_sta: station used for broadcast packets. Used in AP, GO and IBSS.
  * @mcast_sta: station used for multicast packets. Used in AP, GO and IBSS.
- * @aux_sta: station used for remain on channel. Used in P2P device.
  * @mon_sta: station used for TX injection in monitor interface.
  * @link_id: over the air link ID
  * @ap_early_keys: The firmware cannot install keys before bcast/mcast STAs,
@@ -73,7 +72,6 @@ struct iwl_mld_link {
        struct ieee80211_vif *vif;
        struct iwl_mld_int_sta bcast_sta;
        struct iwl_mld_int_sta mcast_sta;
-       struct iwl_mld_int_sta aux_sta;
        struct iwl_mld_int_sta mon_sta;
        u8 link_id;
 
@@ -107,8 +105,6 @@ iwl_mld_cleanup_link(struct iwl_mld *mld, struct iwl_mld_link *link)
                iwl_mld_free_internal_sta(mld, &link->bcast_sta);
        if (link->mcast_sta.sta_id != IWL_INVALID_STA)
                iwl_mld_free_internal_sta(mld, &link->mcast_sta);
-       if (link->aux_sta.sta_id != IWL_INVALID_STA)
-               iwl_mld_free_internal_sta(mld, &link->aux_sta);
        if (link->mon_sta.sta_id != IWL_INVALID_STA)
                iwl_mld_free_internal_sta(mld, &link->mon_sta);
 }
index b87faca23cebe245dd4897b082102b36c56224ef..ac52cc06e4d61517ffd88a2b4ec8959b42b49b62 100644 (file)
@@ -37,7 +37,7 @@ int iwl_mld_start_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 {
        struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw);
        struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif);
-       struct iwl_mld_int_sta *aux_sta;
+       struct iwl_mld_int_sta *aux_sta = &mld_vif->aux_sta;
        struct iwl_roc_req cmd = {
                .action = cpu_to_le32(FW_CTXT_ACTION_ADD),
        };
@@ -79,9 +79,6 @@ int iwl_mld_start_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        if (WARN_ON(mld_vif->roc_activity != ROC_NUM_ACTIVITIES))
                return -EBUSY;
 
-       /* No MLO on P2P device */
-       aux_sta = &mld_vif->deflink.aux_sta;
-
        ret = iwl_mld_add_aux_sta(mld, aux_sta);
        if (ret)
                return ret;
@@ -136,9 +133,9 @@ static void iwl_mld_destroy_roc(struct iwl_mld *mld,
         * we can flush the Tx on the queues
         */
 
-       iwl_mld_flush_link_sta_txqs(mld, mld_vif->deflink.aux_sta.sta_id);
+       iwl_mld_flush_link_sta_txqs(mld, mld_vif->aux_sta.sta_id);
 
-       iwl_mld_remove_aux_sta(mld, vif, &vif->bss_conf);
+       iwl_mld_remove_aux_sta(mld, vif);
 }
 
 int iwl_mld_cancel_roc(struct ieee80211_hw *hw,
index 317388ad21707c9eadff6526489b626f6840f97c..bc5313f44fdee300c1319ebc50e334998dc79015 100644 (file)
@@ -1160,19 +1160,15 @@ void iwl_mld_remove_mcast_sta(struct iwl_mld *mld,
 }
 
 void iwl_mld_remove_aux_sta(struct iwl_mld *mld,
-                           struct ieee80211_vif *vif,
-                           struct ieee80211_bss_conf *link)
+                           struct ieee80211_vif *vif)
 {
-       struct iwl_mld_link *mld_link = iwl_mld_link_from_mac80211(link);
-
-       if (WARN_ON(!mld_link))
-               return;
+       struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif);
 
        /* TODO: Hotspot 2.0 */
        if (WARN_ON(vif->type != NL80211_IFTYPE_P2P_DEVICE))
                return;
 
-       iwl_mld_remove_internal_sta(mld, &mld_link->aux_sta, false,
+       iwl_mld_remove_internal_sta(mld, &mld_vif->aux_sta, false,
                                    IWL_MAX_TID_COUNT);
 }
 
index c45d815d0c73a7d1187e6954429e93f945d4cf7e..1897b121aae28dfb0029d0a1455b2f762409c49c 100644 (file)
@@ -260,8 +260,7 @@ void iwl_mld_remove_mcast_sta(struct iwl_mld *mld,
                              struct ieee80211_bss_conf *link);
 
 void iwl_mld_remove_aux_sta(struct iwl_mld *mld,
-                           struct ieee80211_vif *vif,
-                           struct ieee80211_bss_conf *link);
+                           struct ieee80211_vif *vif);
 
 void iwl_mld_remove_mon_sta(struct iwl_mld *mld,
                            struct ieee80211_vif *vif,
index e478afbc61f483ae0ff4ea7ec195a048cbc32eb7..96ea6320c084f6c7f5936fd02db6d84e8bf5d966 100644 (file)
@@ -645,7 +645,7 @@ iwl_mld_get_tx_queue_id(struct iwl_mld *mld, struct ieee80211_txq *txq,
 
                WARN_ON(!ieee80211_is_mgmt(fc));
 
-               return mld_vif->deflink.aux_sta.queue_id;
+               return mld_vif->aux_sta.queue_id;
        case NL80211_IFTYPE_MONITOR:
                mld_vif = iwl_mld_vif_from_mac80211(info->control.vif);
                return mld_vif->deflink.mon_sta.queue_id;