Commit d5216a28 authored by Liad Kaufman's avatar Liad Kaufman Committed by Emmanuel Grumbach

iwlwifi: mvm: use bss client queue for bss station

Use the reserved BSS Client queue when connecting to an AP
in DQA mode.
Signed-off-by: default avatarLiad Kaufman <liad.kaufman@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 0e32d590
...@@ -89,6 +89,8 @@ enum { ...@@ -89,6 +89,8 @@ enum {
/* /*
* DQA queue numbers * DQA queue numbers
* *
* @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
* that we are never left without the possibility to connect to an AP.
* @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames. * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
* Each MGMT queue is mapped to a single STA * Each MGMT queue is mapped to a single STA
* MGMT frames are frames that return true on ieee80211_is_mgmt() * MGMT frames are frames that return true on ieee80211_is_mgmt()
...@@ -100,6 +102,7 @@ enum { ...@@ -100,6 +102,7 @@ enum {
* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames * @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
*/ */
enum iwl_mvm_dqa_txq { enum iwl_mvm_dqa_txq {
IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
IWL_MVM_DQA_MIN_MGMT_QUEUE = 5, IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
IWL_MVM_DQA_MAX_MGMT_QUEUE = 8, IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
IWL_MVM_DQA_MIN_DATA_QUEUE = 10, IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
......
...@@ -336,7 +336,8 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, ...@@ -336,7 +336,8 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
* as aggregatable. * as aggregatable.
* Mark all DATA queues as allowing to be aggregated at some point * Mark all DATA queues as allowing to be aggregated at some point
*/ */
cfg.aggregate = (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE); cfg.aggregate = (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE ||
queue == IWL_MVM_DQA_BSS_CLIENT_QUEUE);
IWL_DEBUG_TX_QUEUES(mvm, "Allocating queue #%d to sta %d on tid %d\n", IWL_DEBUG_TX_QUEUES(mvm, "Allocating queue #%d to sta %d on tid %d\n",
queue, mvmsta->sta_id, tid); queue, mvmsta->sta_id, tid);
...@@ -448,7 +449,8 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk) ...@@ -448,7 +449,8 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk)
} }
static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm, static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm,
struct ieee80211_sta *sta) struct ieee80211_sta *sta,
enum nl80211_iftype vif_type)
{ {
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
int queue; int queue;
...@@ -456,8 +458,13 @@ static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm, ...@@ -456,8 +458,13 @@ static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm,
spin_lock_bh(&mvm->queue_info_lock); spin_lock_bh(&mvm->queue_info_lock);
/* Make sure we have free resources for this STA */ /* Make sure we have free resources for this STA */
queue = iwl_mvm_find_free_queue(mvm, IWL_MVM_DQA_MIN_DATA_QUEUE, if (vif_type == NL80211_IFTYPE_STATION && !sta->tdls &&
IWL_MVM_DQA_MAX_DATA_QUEUE); !mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].hw_queue_refcount &&
!mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE].setup_reserved)
queue = IWL_MVM_DQA_BSS_CLIENT_QUEUE;
else
queue = iwl_mvm_find_free_queue(mvm, IWL_MVM_DQA_MIN_DATA_QUEUE,
IWL_MVM_DQA_MAX_DATA_QUEUE);
if (queue < 0) { if (queue < 0) {
spin_unlock_bh(&mvm->queue_info_lock); spin_unlock_bh(&mvm->queue_info_lock);
IWL_ERR(mvm, "No available queues for new station\n"); IWL_ERR(mvm, "No available queues for new station\n");
...@@ -551,7 +558,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm, ...@@ -551,7 +558,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
} }
if (iwl_mvm_is_dqa_supported(mvm)) { if (iwl_mvm_is_dqa_supported(mvm)) {
ret = iwl_mvm_reserve_sta_stream(mvm, sta); ret = iwl_mvm_reserve_sta_stream(mvm, sta,
ieee80211_vif_type_p2p(vif));
if (ret) if (ret)
goto err; goto err;
} }
......
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