Commit df197c00 authored by Johannes Berg's avatar Johannes Berg Committed by Emmanuel Grumbach

iwlwifi: mvm: clarify stop_count, remove transport_stopped

The queue handling is a bit unclear - we have an array for
stop_count[IWL_MAX_HW_QUEUES] but indices really are the
mac80211 queue numbers. Change the array to be only of the
right size for mac80211 queues (IEEE80211_MAX_QUEUES) and
rename it to be clearer.

While at it, also remove the unused transport queue stop
bitmap in mvm.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent b2d81db7
...@@ -244,10 +244,10 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm, ...@@ -244,10 +244,10 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
mvm->queue_to_mac80211[i] = i; mvm->queue_to_mac80211[i] = i;
else else
mvm->queue_to_mac80211[i] = IWL_INVALID_MAC80211_QUEUE; mvm->queue_to_mac80211[i] = IWL_INVALID_MAC80211_QUEUE;
atomic_set(&mvm->queue_stop_count[i], 0);
} }
mvm->transport_queue_stop = 0; for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
atomic_set(&mvm->mac80211_queue_stop_count[i], 0);
mvm->ucode_loaded = true; mvm->ucode_loaded = true;
......
...@@ -562,9 +562,8 @@ struct iwl_mvm { ...@@ -562,9 +562,8 @@ struct iwl_mvm {
struct mvm_statistics_rx rx_stats; struct mvm_statistics_rx rx_stats;
unsigned long transport_queue_stop;
u8 queue_to_mac80211[IWL_MAX_HW_QUEUES]; u8 queue_to_mac80211[IWL_MAX_HW_QUEUES];
atomic_t queue_stop_count[IWL_MAX_HW_QUEUES]; atomic_t mac80211_queue_stop_count[IEEE80211_MAX_QUEUES];
const char *nvm_file_name; const char *nvm_file_name;
struct iwl_nvm_data *nvm_data; struct iwl_nvm_data *nvm_data;
......
...@@ -703,14 +703,13 @@ static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int queue) ...@@ -703,14 +703,13 @@ static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int queue)
if (WARN_ON_ONCE(mq == IWL_INVALID_MAC80211_QUEUE)) if (WARN_ON_ONCE(mq == IWL_INVALID_MAC80211_QUEUE))
return; return;
if (atomic_inc_return(&mvm->queue_stop_count[mq]) > 1) { if (atomic_inc_return(&mvm->mac80211_queue_stop_count[mq]) > 1) {
IWL_DEBUG_TX_QUEUES(mvm, IWL_DEBUG_TX_QUEUES(mvm,
"queue %d (mac80211 %d) already stopped\n", "queue %d (mac80211 %d) already stopped\n",
queue, mq); queue, mq);
return; return;
} }
set_bit(mq, &mvm->transport_queue_stop);
ieee80211_stop_queue(mvm->hw, mq); ieee80211_stop_queue(mvm->hw, mq);
} }
...@@ -722,15 +721,13 @@ static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int queue) ...@@ -722,15 +721,13 @@ static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int queue)
if (WARN_ON_ONCE(mq == IWL_INVALID_MAC80211_QUEUE)) if (WARN_ON_ONCE(mq == IWL_INVALID_MAC80211_QUEUE))
return; return;
if (atomic_dec_return(&mvm->queue_stop_count[mq]) > 0) { if (atomic_dec_return(&mvm->mac80211_queue_stop_count[mq]) > 0) {
IWL_DEBUG_TX_QUEUES(mvm, IWL_DEBUG_TX_QUEUES(mvm,
"queue %d (mac80211 %d) already awake\n", "queue %d (mac80211 %d) still stopped\n",
queue, mq); queue, mq);
return; return;
} }
clear_bit(mq, &mvm->transport_queue_stop);
ieee80211_wake_queue(mvm->hw, mq); ieee80211_wake_queue(mvm->hw, mq);
} }
......
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