iwlwifi: mvm: fix the FIFO numbers in A000 devices
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 13 Jun 2017 10:18:48 +0000 (13:18 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 1 Aug 2017 09:41:44 +0000 (12:41 +0300)
The FIFO numbering is different in A000 devices. This
means that we routed BE packets to BK FIFO. Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/txq.h
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 805e161..87c1e36 100644 (file)
@@ -111,6 +111,18 @@ enum iwl_mvm_tx_fifo {
        IWL_MVM_TX_FIFO_CMD = 7,
 };
 
+enum iwl_gen2_tx_fifo {
+       IWL_GEN2_TX_FIFO_CMD = 0,
+       IWL_GEN2_EDCA_TX_FIFO_BK,
+       IWL_GEN2_EDCA_TX_FIFO_BE,
+       IWL_GEN2_EDCA_TX_FIFO_VI,
+       IWL_GEN2_EDCA_TX_FIFO_VO,
+       IWL_GEN2_TRIG_TX_FIFO_BK,
+       IWL_GEN2_TRIG_TX_FIFO_BE,
+       IWL_GEN2_TRIG_TX_FIFO_VI,
+       IWL_GEN2_TRIG_TX_FIFO_VO,
+};
+
 /**
  * enum iwl_tx_queue_cfg_actions - TXQ config options
  * @TX_QUEUE_CFG_ENABLE_QUEUE: enable a queue
index 1546d54..604db47 100644 (file)
@@ -80,6 +80,13 @@ const u8 iwl_mvm_ac_to_tx_fifo[] = {
        IWL_MVM_TX_FIFO_BK,
 };
 
+const u8 iwl_mvm_ac_to_gen2_tx_fifo[] = {
+       IWL_GEN2_EDCA_TX_FIFO_VO,
+       IWL_GEN2_EDCA_TX_FIFO_VI,
+       IWL_GEN2_EDCA_TX_FIFO_BE,
+       IWL_GEN2_EDCA_TX_FIFO_BK,
+};
+
 struct iwl_mvm_mac_iface_iterator_data {
        struct iwl_mvm *mvm;
        struct ieee80211_vif *vif;
@@ -774,7 +781,7 @@ static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
        cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP);
 
        for (i = 0; i < IEEE80211_NUM_ACS; i++) {
-               u8 txf = iwl_mvm_ac_to_tx_fifo[i];
+               u8 txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, i);
 
                cmd->ac[txf].cw_min =
                        cpu_to_le16(mvmvif->queue_params[i].cw_min);
index e9440ef..74948f8 100644 (file)
@@ -1291,6 +1291,14 @@ static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm)
 }
 
 extern const u8 iwl_mvm_ac_to_tx_fifo[];
+extern const u8 iwl_mvm_ac_to_gen2_tx_fifo[];
+
+static inline u8 iwl_mvm_mac_ac_to_tx_fifo(struct iwl_mvm *mvm,
+                                          enum ieee80211_ac_numbers ac)
+{
+       return iwl_mvm_has_new_tx_api(mvm) ?
+               iwl_mvm_ac_to_gen2_tx_fifo[ac] : iwl_mvm_ac_to_tx_fifo[ac];
+}
 
 struct iwl_rate_info {
        u8 plcp;        /* uCode API:  IWL_RATE_6M_PLCP, etc. */
index 4df5f13..4adc8fe 100644 (file)
@@ -315,7 +315,7 @@ static int iwl_mvm_tdls_sta_init(struct iwl_mvm *mvm,
        for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
                iwl_mvm_enable_ac_txq(mvm, mvmsta->hw_queue[ac],
                                      mvmsta->hw_queue[ac],
-                                     iwl_mvm_ac_to_tx_fifo[ac], 0,
+                                     iwl_mvm_mac_ac_to_tx_fifo(mvm, ac), 0,
                                      wdg_timeout);
                mvmsta->tfd_queue_msk |= BIT(mvmsta->hw_queue[ac]);
        }
@@ -745,7 +745,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
 {
        struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
        struct iwl_trans_txq_scd_cfg cfg = {
-               .fifo = iwl_mvm_ac_to_tx_fifo[ac],
+               .fifo = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac),
                .sta_id = mvmsta->sta_id,
                .tid = tid,
                .frame_limit = IWL_FRAME_LIMIT,
@@ -1303,7 +1303,7 @@ static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm,
                        u16 seq = IEEE80211_SEQ_TO_SN(tid_data->seq_number);
 
                        cfg.tid = i;
-                       cfg.fifo = iwl_mvm_ac_to_tx_fifo[ac];
+                       cfg.fifo = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac);
                        cfg.aggregate = (txq_id >= IWL_MVM_DQA_MIN_DATA_QUEUE ||
                                         txq_id ==
                                         IWL_MVM_DQA_BSS_CLIENT_QUEUE);
index f263a19..cccff10 100644 (file)
@@ -751,7 +751,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb,
        max_amsdu_len = sta->max_amsdu_len;
 
        /* the Tx FIFO to which this A-MSDU will be routed */
-       txf = iwl_mvm_ac_to_tx_fifo[tid_to_mac80211_ac[tid]];
+       txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, tid_to_mac80211_ac[tid]);
 
        /*
         * Don't send an AMSDU that will be longer than the TXF.