iwlwifi: mvm: don't assume static queue numbers
authorSara Sharon <sara.sharon@intel.com>
Mon, 9 Jan 2017 10:07:16 +0000 (12:07 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 11 Apr 2017 11:54:36 +0000 (14:54 +0300)
In a000 devices FW will assign the queue number. Prepare for
that by getting rid of static defines and store them in variables.
Enlarge to u16 since we may have up to 512 queues.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 70b9946382735914b72e8fb512e4b97547be8a4c..b58ac2aa9999afda2fb3888315b5f155afc2941e 100644 (file)
@@ -976,7 +976,10 @@ struct iwl_mvm {
 #endif
 
        /* Tx queues */
-       u8 aux_queue;
+       u16 aux_queue;
+       u16 probe_queue;
+       u16 p2p_dev_queue;
+
        u8 first_agg_queue;
        u8 last_agg_queue;
 
index f4f957fe71d7b7b86cee61b98cc0fce74cde1f07..600af8a31200f757712a8569b9cd12f7fdbdb22f 100644 (file)
@@ -603,6 +603,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
                }
        } else {
                mvm->aux_queue = IWL_MVM_DQA_AUX_QUEUE;
+               mvm->probe_queue = IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+               mvm->p2p_dev_queue = IWL_MVM_DQA_P2P_DEVICE_QUEUE;
                mvm->first_agg_queue = IWL_MVM_DQA_MIN_DATA_QUEUE;
                mvm->last_agg_queue = IWL_MVM_DQA_MAX_DATA_QUEUE;
        }
index 26155e2efa84056d4d2fba7309b8c5f15974b700..2d68cee41306577c87b62118c98583a8ee9ac001 100644 (file)
@@ -1806,9 +1806,9 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                int queue;
 
                if (vif->type == NL80211_IFTYPE_AP)
-                       queue = IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+                       queue = mvm->probe_queue;
                else if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
-                       queue = IWL_MVM_DQA_P2P_DEVICE_QUEUE;
+                       queue = mvm->p2p_dev_queue;
                else if (WARN(1, "Missing required TXQ for adding bcast STA\n"))
                        return -EINVAL;
 
@@ -1836,24 +1836,18 @@ static void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm,
 
        lockdep_assert_held(&mvm->mutex);
 
-       if (mvmvif->bcast_sta.tfd_queue_msk &
-           BIT(IWL_MVM_DQA_AP_PROBE_RESP_QUEUE)) {
-               iwl_mvm_disable_txq(mvm,
-                                   IWL_MVM_DQA_AP_PROBE_RESP_QUEUE,
+       if (mvmvif->bcast_sta.tfd_queue_msk & BIT(mvm->probe_queue)) {
+               iwl_mvm_disable_txq(mvm, mvm->probe_queue,
                                    vif->hw_queue[0], IWL_MAX_TID_COUNT,
                                    0);
-               mvmvif->bcast_sta.tfd_queue_msk &=
-                       ~BIT(IWL_MVM_DQA_AP_PROBE_RESP_QUEUE);
+               mvmvif->bcast_sta.tfd_queue_msk &= ~BIT(mvm->probe_queue);
        }
 
-       if (mvmvif->bcast_sta.tfd_queue_msk &
-           BIT(IWL_MVM_DQA_P2P_DEVICE_QUEUE)) {
-               iwl_mvm_disable_txq(mvm,
-                                   IWL_MVM_DQA_P2P_DEVICE_QUEUE,
+       if (mvmvif->bcast_sta.tfd_queue_msk & BIT(mvm->p2p_dev_queue)) {
+               iwl_mvm_disable_txq(mvm, mvm->p2p_dev_queue,
                                    vif->hw_queue[0], IWL_MAX_TID_COUNT,
                                    0);
-               mvmvif->bcast_sta.tfd_queue_msk &=
-                       ~BIT(IWL_MVM_DQA_P2P_DEVICE_QUEUE);
+               mvmvif->bcast_sta.tfd_queue_msk &= ~BIT(mvm->p2p_dev_queue);
        }
 }
 
index 3f37075f4cde3cf21da485cd94b1a3f705abac62..568b0793e84e82b4297dcf90f533c0225764547a 100644 (file)
@@ -513,20 +513,20 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
                 */
                if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc) ||
                    ieee80211_is_deauth(fc))
-                       return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+                       return mvm->probe_queue;
                if (info->hw_queue == info->control.vif->cab_queue)
                        return info->hw_queue;
 
                WARN_ONCE(1, "fc=0x%02x", le16_to_cpu(fc));
-               return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+               return mvm->probe_queue;
        case NL80211_IFTYPE_P2P_DEVICE:
                if (ieee80211_is_mgmt(fc))
-                       return IWL_MVM_DQA_P2P_DEVICE_QUEUE;
+                       return mvm->p2p_dev_queue;
                if (info->hw_queue == info->control.vif->cab_queue)
                        return info->hw_queue;
 
                WARN_ON_ONCE(1);
-               return IWL_MVM_DQA_P2P_DEVICE_QUEUE;
+               return mvm->p2p_dev_queue;
        default:
                WARN_ONCE(1, "Not a ctrl vif, no available queue\n");
                return -1;