Skip to content

Commit 3917629

Browse files
committed
wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API
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 <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231011130030.aeb3bf4204cd.I5b0e6d64a67455784bc8fbdaf9ceaf03699d9ce1@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent abea0d0 commit 3917629

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5674,7 +5674,8 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
56745674
}
56755675

56765676
if (drop) {
5677-
if (iwl_mvm_flush_sta(mvm, mvmsta, false))
5677+
if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id,
5678+
mvmsta->tfd_queue_msk))
56785679
IWL_ERR(mvm, "flush request fail\n");
56795680
} else {
56805681
if (iwl_mvm_has_new_tx_api(mvm))
@@ -5711,7 +5712,8 @@ void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
57115712

57125713
mvmsta = iwl_mvm_sta_from_mac80211(sta);
57135714

5714-
if (iwl_mvm_flush_sta(mvm, mvmsta, false))
5715+
if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id,
5716+
mvmsta->tfd_queue_msk))
57155717
IWL_ERR(mvm, "flush request fail\n");
57165718
}
57175719
mutex_unlock(&mvm->mutex);

drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm,
347347
return -EINVAL;
348348

349349
if (flush)
350-
iwl_mvm_flush_sta(mvm, int_sta, true);
350+
iwl_mvm_flush_sta(mvm, int_sta->sta_id, int_sta->tfd_queue_msk);
351351

352352
iwl_mvm_mld_disable_txq(mvm, BIT(int_sta->sta_id), queuptr, tid);
353353

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ const char *iwl_mvm_get_tx_fail_reason(u32 status);
16741674
static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; }
16751675
#endif
16761676
int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk);
1677-
int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal);
1677+
int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask);
16781678
int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids);
16791679

16801680
/* Utils to extract sta related data */

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,8 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm,
20982098
return ret;
20992099

21002100
/* flush its queues here since we are freeing mvm_sta */
2101-
ret = iwl_mvm_flush_sta(mvm, mvm_sta, false);
2101+
ret = iwl_mvm_flush_sta(mvm, mvm_sta->deflink.sta_id,
2102+
mvm_sta->tfd_queue_msk);
21022103
if (ret)
21032104
return ret;
21042105
if (iwl_mvm_has_new_tx_api(mvm)) {
@@ -2409,7 +2410,8 @@ void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm,
24092410

24102411
lockdep_assert_held(&mvm->mutex);
24112412

2412-
iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta, true);
2413+
iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id,
2414+
mvmvif->deflink.bcast_sta.tfd_queue_msk);
24132415

24142416
switch (vif->type) {
24152417
case NL80211_IFTYPE_AP:
@@ -2665,7 +2667,8 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
26652667

26662668
lockdep_assert_held(&mvm->mutex);
26672669

2668-
iwl_mvm_flush_sta(mvm, &mvmvif->deflink.mcast_sta, true);
2670+
iwl_mvm_flush_sta(mvm, mvmvif->deflink.mcast_sta.sta_id,
2671+
mvmvif->deflink.mcast_sta.tfd_queue_msk);
26692672

26702673
iwl_mvm_disable_txq(mvm, NULL, mvmvif->deflink.mcast_sta.sta_id,
26712674
&mvmvif->deflink.cab_queue, 0);

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
8181
struct ieee80211_vif *vif = mvm->p2p_device_vif;
8282

8383
mvmvif = iwl_mvm_vif_from_mac80211(vif);
84-
iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta,
85-
true);
84+
iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id,
85+
mvmvif->deflink.bcast_sta.tfd_queue_msk);
8686

8787
if (mvm->mld_api_is_used) {
8888
iwl_mvm_mld_rm_bcast_sta(mvm, vif,
@@ -113,7 +113,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
113113
*/
114114
if (test_and_clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) {
115115
/* do the same in case of hot spot 2.0 */
116-
iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true);
116+
iwl_mvm_flush_sta(mvm, mvm->aux_sta.sta_id,
117+
mvm->aux_sta.tfd_queue_msk);
117118

118119
if (mvm->mld_api_is_used) {
119120
iwl_mvm_mld_rm_aux_sta(mvm);

drivers/net/wireless/intel/iwlwifi/mvm/tx.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,24 +2317,10 @@ int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids)
23172317
return ret;
23182318
}
23192319

2320-
int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal)
2320+
int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask)
23212321
{
2322-
u32 sta_id, tfd_queue_msk;
2323-
2324-
if (internal) {
2325-
struct iwl_mvm_int_sta *int_sta = sta;
2326-
2327-
sta_id = int_sta->sta_id;
2328-
tfd_queue_msk = int_sta->tfd_queue_msk;
2329-
} else {
2330-
struct iwl_mvm_sta *mvm_sta = sta;
2331-
2332-
sta_id = mvm_sta->deflink.sta_id;
2333-
tfd_queue_msk = mvm_sta->tfd_queue_msk;
2334-
}
2335-
23362322
if (iwl_mvm_has_new_tx_api(mvm))
23372323
return iwl_mvm_flush_sta_tids(mvm, sta_id, 0xffff);
23382324

2339-
return iwl_mvm_flush_tx_path(mvm, tfd_queue_msk);
2325+
return iwl_mvm_flush_tx_path(mvm, tfd_queue_mask);
23402326
}

0 commit comments

Comments
 (0)