iwlwifi: pcie: allow using tx init for other queues but the command queue
authorGolan Ben Ami <golan.ben.ami@intel.com>
Sun, 25 Mar 2018 13:57:42 +0000 (16:57 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 31 Aug 2018 08:38:24 +0000 (11:38 +0300)
We would like to allow using tx init code for other queues but
the command queue - for newer devices.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

index 0127386..da6d367 100644 (file)
@@ -640,7 +640,8 @@ void iwl_pcie_disable_ict(struct iwl_trans *trans);
 * TX / HCMD
 ******************************************************/
 int iwl_pcie_tx_init(struct iwl_trans *trans);
-int iwl_pcie_gen2_tx_init(struct iwl_trans *trans);
+int iwl_pcie_gen2_tx_init(struct iwl_trans *trans, int txq_id,
+                         int queue_size);
 void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr);
 int iwl_pcie_tx_stop(struct iwl_trans *trans);
 void iwl_pcie_tx_free(struct iwl_trans *trans);
index 2bc6721..3e5c732 100644 (file)
@@ -265,7 +265,7 @@ static int iwl_pcie_gen2_nic_init(struct iwl_trans *trans)
                return -ENOMEM;
 
        /* Allocate or reset and init all Tx and Command queues */
-       if (iwl_pcie_gen2_tx_init(trans))
+       if (iwl_pcie_gen2_tx_init(trans, trans_pcie->cmd_queue, TFD_CMD_SLOTS))
                return -ENOMEM;
 
        /* enable shadow regs in HW */
index b99f33f..9ce7b20 100644 (file)
@@ -1251,30 +1251,31 @@ void iwl_pcie_gen2_tx_free(struct iwl_trans *trans)
        }
 }
 
-int iwl_pcie_gen2_tx_init(struct iwl_trans *trans)
+int iwl_pcie_gen2_tx_init(struct iwl_trans *trans, int txq_id, int queue_size)
 {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
-       struct iwl_txq *cmd_queue;
-       int txq_id = trans_pcie->cmd_queue, ret;
+       struct iwl_txq *queue;
+       int ret;
 
-       /* alloc and init the command queue */
+       /* alloc and init the tx queue */
        if (!trans_pcie->txq[txq_id]) {
-               cmd_queue = kzalloc(sizeof(*cmd_queue), GFP_KERNEL);
-               if (!cmd_queue) {
-                       IWL_ERR(trans, "Not enough memory for command queue\n");
+               queue = kzalloc(sizeof(*queue), GFP_KERNEL);
+               if (!queue) {
+                       IWL_ERR(trans, "Not enough memory for tx queue\n");
                        return -ENOMEM;
                }
-               trans_pcie->txq[txq_id] = cmd_queue;
-               ret = iwl_pcie_txq_alloc(trans, cmd_queue, TFD_CMD_SLOTS, true);
+               trans_pcie->txq[txq_id] = queue;
+               ret = iwl_pcie_txq_alloc(trans, queue, queue_size, true);
                if (ret) {
                        IWL_ERR(trans, "Tx %d queue init failed\n", txq_id);
                        goto error;
                }
        } else {
-               cmd_queue = trans_pcie->txq[txq_id];
+               queue = trans_pcie->txq[txq_id];
        }
 
-       ret = iwl_pcie_txq_init(trans, cmd_queue, TFD_CMD_SLOTS, true);
+       ret = iwl_pcie_txq_init(trans, queue, queue_size,
+                               (txq_id == trans_pcie->cmd_queue));
        if (ret) {
                IWL_ERR(trans, "Tx %d queue alloc failed\n", txq_id);
                goto error;