]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API
authorJohannes Berg <johannes.berg@intel.com>
Wed, 11 Oct 2023 10:07:28 +0000 (13:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:56:53 +0000 (11:56 +0100)
[ Upstream commit 391762969769b089c808defc8fce5544a945f9eb ]

This API is type unsafe and needs an extra parameter to know
what kind of station was passed, so it has two, but really it
only needs two values. Just pass the values instead of doing
this type-unsafe dance, which will also make it better to use
for multi-link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.aeb3bf4204cd.I5b0e6d64a67455784bc8fbdaf9ceaf03699d9ce1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Stable-dep-of: 43874283ce6c ("wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index eb1fe0082eaf6afc5c19521542de8e590da20350..069aba0e064aae658009a5bea40c0960f307946d 100644 (file)
@@ -5584,7 +5584,8 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                WARN_ON_ONCE(sta != mvmvif->ap_sta && !sta->tdls);
 
                if (drop) {
-                       if (iwl_mvm_flush_sta(mvm, mvmsta, false))
+                       if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id,
+                                             mvmsta->tfd_queue_msk))
                                IWL_ERR(mvm, "flush request fail\n");
                } else {
                        if (iwl_mvm_has_new_tx_api(mvm))
@@ -5621,7 +5622,8 @@ void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 
                mvmsta = iwl_mvm_sta_from_mac80211(sta);
 
-               if (iwl_mvm_flush_sta(mvm, mvmsta, false))
+               if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id,
+                                     mvmsta->tfd_queue_msk))
                        IWL_ERR(mvm, "flush request fail\n");
        }
        mutex_unlock(&mvm->mutex);
index 524852cf5cd2db22a6781f48b06c1b978c752e7a..56f51344c193c1b14c91da0fd015837e091439c6 100644 (file)
@@ -347,7 +347,7 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm,
                return -EINVAL;
 
        if (flush)
-               iwl_mvm_flush_sta(mvm, int_sta, true);
+               iwl_mvm_flush_sta(mvm, int_sta->sta_id, int_sta->tfd_queue_msk);
 
        iwl_mvm_mld_disable_txq(mvm, BIT(int_sta->sta_id), queuptr, tid);
 
index b596eca562166e2a4358f45eecffd5e8f4e1c5a4..218f3bc31104b11def5e638158544434035539ac 100644 (file)
@@ -1658,7 +1658,7 @@ const char *iwl_mvm_get_tx_fail_reason(u32 status);
 static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; }
 #endif
 int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk);
-int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal);
+int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask);
 int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids);
 
 /* Utils to extract sta related data */
index 3b9a343d4f672bff3d60e86ebd49c96ec5bb54d4..ebbe16551058762322fa807da97d45a5d5184222 100644 (file)
@@ -2097,7 +2097,8 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm,
                return ret;
 
        /* flush its queues here since we are freeing mvm_sta */
-       ret = iwl_mvm_flush_sta(mvm, mvm_sta, false);
+       ret = iwl_mvm_flush_sta(mvm, mvm_sta->deflink.sta_id,
+                               mvm_sta->tfd_queue_msk);
        if (ret)
                return ret;
        if (iwl_mvm_has_new_tx_api(mvm)) {
@@ -2408,7 +2409,8 @@ void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm,
 
        lockdep_assert_held(&mvm->mutex);
 
-       iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta, true);
+       iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id,
+                         mvmvif->deflink.bcast_sta.tfd_queue_msk);
 
        switch (vif->type) {
        case NL80211_IFTYPE_AP:
@@ -2664,7 +2666,8 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
        lockdep_assert_held(&mvm->mutex);
 
-       iwl_mvm_flush_sta(mvm, &mvmvif->deflink.mcast_sta, true);
+       iwl_mvm_flush_sta(mvm, mvmvif->deflink.mcast_sta.sta_id,
+                         mvmvif->deflink.mcast_sta.tfd_queue_msk);
 
        iwl_mvm_disable_txq(mvm, NULL, mvmvif->deflink.mcast_sta.sta_id,
                            &mvmvif->deflink.cab_queue, 0);
index ff213247569a7671a9748b76602f8dde1553a49e..158266719ffd75d53d03e13b88365aaf44408f8b 100644 (file)
@@ -81,8 +81,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
                        struct ieee80211_vif *vif = mvm->p2p_device_vif;
 
                        mvmvif = iwl_mvm_vif_from_mac80211(vif);
-                       iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta,
-                                         true);
+                       iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id,
+                                         mvmvif->deflink.bcast_sta.tfd_queue_msk);
 
                        if (mvm->mld_api_is_used) {
                                iwl_mvm_mld_rm_bcast_sta(mvm, vif,
@@ -113,7 +113,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
         */
        if (test_and_clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) {
                /* do the same in case of hot spot 2.0 */
-               iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true);
+               iwl_mvm_flush_sta(mvm, mvm->aux_sta.sta_id,
+                                 mvm->aux_sta.tfd_queue_msk);
 
                if (mvm->mld_api_is_used) {
                        iwl_mvm_mld_rm_aux_sta(mvm);
index 898dca3936435cb162a61aa776e6999eed7f112f..bf241f9128fd92f9d708ed3c0bed3cd763a557e4 100644 (file)
@@ -2293,24 +2293,10 @@ free_rsp:
        return ret;
 }
 
-int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal)
+int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask)
 {
-       u32 sta_id, tfd_queue_msk;
-
-       if (internal) {
-               struct iwl_mvm_int_sta *int_sta = sta;
-
-               sta_id = int_sta->sta_id;
-               tfd_queue_msk = int_sta->tfd_queue_msk;
-       } else {
-               struct iwl_mvm_sta *mvm_sta = sta;
-
-               sta_id = mvm_sta->deflink.sta_id;
-               tfd_queue_msk = mvm_sta->tfd_queue_msk;
-       }
-
        if (iwl_mvm_has_new_tx_api(mvm))
                return iwl_mvm_flush_sta_tids(mvm, sta_id, 0xffff);
 
-       return iwl_mvm_flush_tx_path(mvm, tfd_queue_msk);
+       return iwl_mvm_flush_tx_path(mvm, tfd_queue_mask);
 }