Skip to content

Commit c5b0e7c

Browse files
committed
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 <[email protected]>
1 parent bd3398e commit c5b0e7c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

+29
Original file line numberDiff line numberDiff line change
@@ -2400,6 +2400,34 @@ static void iwl_mvm_channel_switch_beacon(struct ieee80211_hw *hw,
24002400
mutex_unlock(&mvm->mutex);
24012401
}
24022402

2403+
static 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+
}
2427+
done:
2428+
mutex_unlock(&mvm->mutex);
2429+
}
2430+
24032431
const struct ieee80211_ops iwl_mvm_hw_ops = {
24042432
.tx = iwl_mvm_mac_tx,
24052433
.ampdu_action = iwl_mvm_mac_ampdu_action,
@@ -2423,6 +2451,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
24232451
.sta_rc_update = iwl_mvm_sta_rc_update,
24242452
.conf_tx = iwl_mvm_mac_conf_tx,
24252453
.mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
2454+
.flush = iwl_mvm_mac_flush,
24262455
.sched_scan_start = iwl_mvm_mac_sched_scan_start,
24272456
.sched_scan_stop = iwl_mvm_mac_sched_scan_stop,
24282457
.set_key = iwl_mvm_mac_set_key,

0 commit comments

Comments
 (0)