Commit 6862fcee authored by Sara Sharon's avatar Sara Sharon Committed by Luca Coelho

iwlwifi: mvm: move internally to use bigger INVALID_TXQ

We can't use IEEE80211_INVAL_HW_QUEUE to mark a queue as
invalid since 255 will be a valid value for a TVQM queue
index.
Use IWL_MVM_INVALID_QUEUE instead for accessing txq_id.
reserved_queue can stay a u8 since reserved_queue is not
used when TVQM is enabled.
Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent e2af3fab
...@@ -2363,7 +2363,7 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, ...@@ -2363,7 +2363,7 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw,
tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA) tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA)
continue; continue;
if (tid_data->txq_id == IEEE80211_INVAL_HW_QUEUE) if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE)
continue; continue;
__set_bit(tid_data->txq_id, &txqs); __set_bit(tid_data->txq_id, &txqs);
......
...@@ -717,6 +717,8 @@ enum iwl_mvm_queue_status { ...@@ -717,6 +717,8 @@ enum iwl_mvm_queue_status {
}; };
#define IWL_MVM_DQA_QUEUE_TIMEOUT (5 * HZ) #define IWL_MVM_DQA_QUEUE_TIMEOUT (5 * HZ)
#define IWL_MVM_INVALID_QUEUE 0xFFFF
#define IWL_MVM_NUM_CIPHERS 10 #define IWL_MVM_NUM_CIPHERS 10
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
......
...@@ -464,7 +464,7 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) ...@@ -464,7 +464,7 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue)
for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) {
if (mvmsta->tid_data[tid].state == IWL_AGG_ON) if (mvmsta->tid_data[tid].state == IWL_AGG_ON)
disable_agg_tids |= BIT(tid); disable_agg_tids |= BIT(tid);
mvmsta->tid_data[tid].txq_id = IEEE80211_INVAL_HW_QUEUE; mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE;
} }
mvmsta->tfd_queue_msk &= ~BIT(queue); /* Don't use this queue anymore */ mvmsta->tfd_queue_msk &= ~BIT(queue); /* Don't use this queue anymore */
...@@ -1086,7 +1086,7 @@ static void iwl_mvm_tx_deferred_stream(struct iwl_mvm *mvm, ...@@ -1086,7 +1086,7 @@ static void iwl_mvm_tx_deferred_stream(struct iwl_mvm *mvm,
ac = iwl_mvm_tid_to_ac_queue(tid); ac = iwl_mvm_tid_to_ac_queue(tid);
mac_queue = IEEE80211_SKB_CB(skb)->hw_queue; mac_queue = IEEE80211_SKB_CB(skb)->hw_queue;
if (tid_data->txq_id == IEEE80211_INVAL_HW_QUEUE && if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE &&
iwl_mvm_sta_alloc_queue(mvm, sta, ac, tid, hdr)) { iwl_mvm_sta_alloc_queue(mvm, sta, ac, tid, hdr)) {
IWL_ERR(mvm, IWL_ERR(mvm,
"Can't alloc TXQ for sta %d tid %d - dropping frame\n", "Can't alloc TXQ for sta %d tid %d - dropping frame\n",
...@@ -1267,7 +1267,7 @@ static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, ...@@ -1267,7 +1267,7 @@ static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm,
int ac; int ac;
u8 mac_queue; u8 mac_queue;
if (txq_id == IEEE80211_INVAL_HW_QUEUE) if (txq_id == IWL_MVM_INVALID_QUEUE)
continue; continue;
skb_queue_head_init(&tid_data->deferred_tx_frames); skb_queue_head_init(&tid_data->deferred_tx_frames);
...@@ -1375,7 +1375,7 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm, ...@@ -1375,7 +1375,7 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
* Mark all queues for this STA as unallocated and defer TX * Mark all queues for this STA as unallocated and defer TX
* frames until the queue is allocated * frames until the queue is allocated
*/ */
mvm_sta->tid_data[i].txq_id = IEEE80211_INVAL_HW_QUEUE; mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE;
skb_queue_head_init(&mvm_sta->tid_data[i].deferred_tx_frames); skb_queue_head_init(&mvm_sta->tid_data[i].deferred_tx_frames);
} }
mvm_sta->deferred_traffic_tid_map = 0; mvm_sta->deferred_traffic_tid_map = 0;
...@@ -1574,13 +1574,13 @@ static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm, ...@@ -1574,13 +1574,13 @@ static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm,
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
for (i = 0; i < ARRAY_SIZE(mvm_sta->tid_data); i++) { for (i = 0; i < ARRAY_SIZE(mvm_sta->tid_data); i++) {
if (mvm_sta->tid_data[i].txq_id == IEEE80211_INVAL_HW_QUEUE) if (mvm_sta->tid_data[i].txq_id == IWL_MVM_INVALID_QUEUE)
continue; continue;
ac = iwl_mvm_tid_to_ac_queue(i); ac = iwl_mvm_tid_to_ac_queue(i);
iwl_mvm_disable_txq(mvm, mvm_sta->tid_data[i].txq_id, iwl_mvm_disable_txq(mvm, mvm_sta->tid_data[i].txq_id,
vif->hw_queue[ac], i, 0); vif->hw_queue[ac], i, 0);
mvm_sta->tid_data[i].txq_id = IEEE80211_INVAL_HW_QUEUE; mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE;
} }
} }
......
...@@ -920,7 +920,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, ...@@ -920,7 +920,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
__le16 fc; __le16 fc;
u16 seq_number = 0; u16 seq_number = 0;
u8 tid = IWL_MAX_TID_COUNT; u8 tid = IWL_MAX_TID_COUNT;
u8 txq_id = info->hw_queue; u16 txq_id = info->hw_queue;
bool is_ampdu = false; bool is_ampdu = false;
int hdrlen; int hdrlen;
...@@ -990,11 +990,11 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, ...@@ -990,11 +990,11 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM); WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM);
/* Check if TXQ needs to be allocated or re-activated */ /* Check if TXQ needs to be allocated or re-activated */
if (unlikely(txq_id == IEEE80211_INVAL_HW_QUEUE || if (unlikely(txq_id == IWL_MVM_INVALID_QUEUE ||
!mvmsta->tid_data[tid].is_tid_active) && !mvmsta->tid_data[tid].is_tid_active) &&
iwl_mvm_is_dqa_supported(mvm)) { iwl_mvm_is_dqa_supported(mvm)) {
/* If TXQ needs to be allocated... */ /* If TXQ needs to be allocated... */
if (txq_id == IEEE80211_INVAL_HW_QUEUE) { if (txq_id == IWL_MVM_INVALID_QUEUE) {
iwl_mvm_tx_add_stream(mvm, mvmsta, tid, skb); iwl_mvm_tx_add_stream(mvm, mvmsta, tid, skb);
/* /*
......
...@@ -1203,7 +1203,7 @@ static void iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm, ...@@ -1203,7 +1203,7 @@ static void iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm,
for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) {
int mac_queue = mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]]; int mac_queue = mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]];
mvmsta->tid_data[tid].txq_id = IEEE80211_INVAL_HW_QUEUE; mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE;
mvm->queue_info[queue].hw_queue_to_mac80211 &= ~BIT(mac_queue); mvm->queue_info[queue].hw_queue_to_mac80211 &= ~BIT(mac_queue);
mvm->queue_info[queue].hw_queue_refcount--; mvm->queue_info[queue].hw_queue_refcount--;
mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); mvm->queue_info[queue].tid_bitmap &= ~BIT(tid);
......
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