Commit 435d0827 authored by Sara Sharon's avatar Sara Sharon Committed by Luca Coelho

iwlwifi: mvm: refactor iwl_mvm_flush_no_vif

This function is very indented and hard to read.
Refactor it.
Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent cb8550e1
...@@ -4002,6 +4002,8 @@ static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, ...@@ -4002,6 +4002,8 @@ static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop)
{ {
int i;
if (drop) { if (drop) {
if (iwl_mvm_has_new_tx_api(mvm)) if (iwl_mvm_has_new_tx_api(mvm))
/* TODO new tx api */ /* TODO new tx api */
...@@ -4009,18 +4011,20 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) ...@@ -4009,18 +4011,20 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop)
"Need to implement flush TX queue\n"); "Need to implement flush TX queue\n");
else else
iwl_mvm_flush_tx_path(mvm, iwl_mvm_flush_tx_path(mvm,
iwl_mvm_flushable_queues(mvm) & queues, iwl_mvm_flushable_queues(mvm) & queues, 0);
0); return;
} else { }
if (iwl_mvm_has_new_tx_api(mvm)) {
struct ieee80211_sta *sta;
int i;
mutex_lock(&mvm->mutex); if (!iwl_mvm_has_new_tx_api(mvm)) {
iwl_trans_wait_tx_queues_empty(mvm->trans, queues);
return;
}
mutex_lock(&mvm->mutex);
for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) {
sta = rcu_dereference_protected( struct ieee80211_sta *sta;
mvm->fw_id_to_mac_id[i],
sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i],
lockdep_is_held(&mvm->mutex)); lockdep_is_held(&mvm->mutex));
if (IS_ERR_OR_NULL(sta)) if (IS_ERR_OR_NULL(sta))
continue; continue;
...@@ -4028,13 +4032,7 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) ...@@ -4028,13 +4032,7 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop)
iwl_mvm_wait_sta_queues_empty(mvm, iwl_mvm_wait_sta_queues_empty(mvm,
iwl_mvm_sta_from_mac80211(sta)); iwl_mvm_sta_from_mac80211(sta));
} }
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
} else {
iwl_trans_wait_tx_queues_empty(mvm->trans,
queues);
}
}
} }
static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, static void iwl_mvm_mac_flush(struct ieee80211_hw *hw,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment