blob: 31f60ce0243184cca550925a3c8126cae765f37c [file] [log] [blame]
developera1432902023-04-01 04:45:58 +08001From: Johannes Berg <johannes.berg@intel.com>
2Date: Mon, 13 Mar 2023 12:05:35 +0100
3Subject: [PATCH] wifi: iwlwifi: mvm: support new flush_sta method
4
5For iwlwifi this is simple to implement, and on newer hardware
6it's an improvement since we have per-station queues.
7
8Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9Reviewed-by: Greenman, Gregory <gregory.greenman@intel.com>
10---
11
12--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
13+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
14@@ -4853,6 +4853,31 @@ static void iwl_mvm_mac_flush(struct iee
15 iwl_trans_wait_tx_queues_empty(mvm->trans, msk);
16 }
17
18+static void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw,
19+ struct ieee80211_vif *vif,
20+ struct ieee80211_sta *sta)
21+{
22+ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
23+ int i;
24+
25+ mutex_lock(&mvm->mutex);
26+ for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) {
27+ struct iwl_mvm_sta *mvmsta;
28+ struct ieee80211_sta *tmp;
29+
30+ tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i],
31+ lockdep_is_held(&mvm->mutex));
32+ if (tmp != sta)
33+ continue;
34+
35+ mvmsta = iwl_mvm_sta_from_mac80211(sta);
36+
37+ if (iwl_mvm_flush_sta(mvm, mvmsta, false))
38+ IWL_ERR(mvm, "flush request fail\n");
39+ }
40+ mutex_unlock(&mvm->mutex);
41+}
42+
43 static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx,
44 struct survey_info *survey)
45 {
46@@ -5366,6 +5391,7 @@ const struct ieee80211_ops iwl_mvm_hw_op
47 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
48 .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover,
49 .flush = iwl_mvm_mac_flush,
50+ .flush_sta = iwl_mvm_mac_flush_sta,
51 .sched_scan_start = iwl_mvm_mac_sched_scan_start,
52 .sched_scan_stop = iwl_mvm_mac_sched_scan_stop,
53 .set_key = iwl_mvm_mac_set_key,