334-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch 1.7 KB

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