aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-03-24 06:08:53 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-05-06 16:32:47 -0400
commitc5b0e7c0565a0e315f01e7584753b9b88ee9e4ec (patch)
treea74ba35ba0ea47608c84c42246782717f9506569 /drivers/net
parentbd3398e2864e264842f5f702e5a69e30582a4d18 (diff)
iwlwifi: mvm: implement mac80211's flush callback
This allows mac80211 to flush the Tx queues before it sends critical management frames. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 34626249c685..6713b87c8555 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -2400,6 +2400,34 @@ out_unlock:
2400 mutex_unlock(&mvm->mutex); 2400 mutex_unlock(&mvm->mutex);
2401} 2401}
2402 2402
2403static void iwl_mvm_mac_flush(struct ieee80211_hw *hw,
2404 struct ieee80211_vif *vif, u32 queues, bool drop)
2405{
2406 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
2407 struct iwl_mvm_vif *mvmvif;
2408 struct iwl_mvm_sta *mvmsta;
2409
2410 if (!vif || vif->type != NL80211_IFTYPE_STATION)
2411 return;
2412
2413 mutex_lock(&mvm->mutex);
2414 mvmvif = iwl_mvm_vif_from_mac80211(vif);
2415 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, mvmvif->ap_sta_id);
2416
2417 if (WARN_ON_ONCE(!mvmsta))
2418 goto done;
2419
2420 if (drop) {
2421 if (iwl_mvm_flush_tx_path(mvm, mvmsta->tfd_queue_msk, true))
2422 IWL_ERR(mvm, "flush request fail\n");
2423 } else {
2424 iwl_trans_wait_tx_queue_empty(mvm->trans,
2425 mvmsta->tfd_queue_msk);
2426 }
2427done:
2428 mutex_unlock(&mvm->mutex);
2429}
2430
2403const struct ieee80211_ops iwl_mvm_hw_ops = { 2431const struct ieee80211_ops iwl_mvm_hw_ops = {
2404 .tx = iwl_mvm_mac_tx, 2432 .tx = iwl_mvm_mac_tx,
2405 .ampdu_action = iwl_mvm_mac_ampdu_action, 2433 .ampdu_action = iwl_mvm_mac_ampdu_action,
@@ -2423,6 +2451,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
2423 .sta_rc_update = iwl_mvm_sta_rc_update, 2451 .sta_rc_update = iwl_mvm_sta_rc_update,
2424 .conf_tx = iwl_mvm_mac_conf_tx, 2452 .conf_tx = iwl_mvm_mac_conf_tx,
2425 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, 2453 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
2454 .flush = iwl_mvm_mac_flush,
2426 .sched_scan_start = iwl_mvm_mac_sched_scan_start, 2455 .sched_scan_start = iwl_mvm_mac_sched_scan_start,
2427 .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, 2456 .sched_scan_stop = iwl_mvm_mac_sched_scan_stop,
2428 .set_key = iwl_mvm_mac_set_key, 2457 .set_key = iwl_mvm_mac_set_key,