]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-trans.c
iwlagn: add missing includes
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-trans.c
index e55636e1deaf0983206aedbc234e2d17618aee4e..95c9e8794839795360a204935ba925b7291b0892 100644 (file)
@@ -72,7 +72,6 @@
 #include "iwl-trans-int-pcie.h"
 /*TODO remove uneeded includes when the transport layer tx_free will be here */
 #include "iwl-agn.h"
-#include "iwl-core.h"
 #include "iwl-shared.h"
 
 static int iwl_trans_rx_alloc(struct iwl_trans *trans)
@@ -302,7 +301,7 @@ static int iwl_trans_txq_alloc(struct iwl_trans *trans,
                                struct iwl_tx_queue *txq, int slots_num,
                                u32 txq_id)
 {
-       size_t tfd_sz = hw_params(trans).tfd_size * TFD_QUEUE_SIZE_MAX;
+       size_t tfd_sz = sizeof(struct iwl_tfd) * TFD_QUEUE_SIZE_MAX;
        int i;
 
        if (WARN_ON(txq->meta || txq->cmd || txq->txb || txq->tfds))
@@ -448,7 +447,7 @@ static void iwl_tx_queue_free(struct iwl_trans *trans, int txq_id)
 
        /* De-alloc circular buffer of TFDs */
        if (txq->q.n_bd) {
-               dma_free_coherent(dev, hw_params(trans).tfd_size *
+               dma_free_coherent(dev, sizeof(struct iwl_tfd) *
                                  txq->q.n_bd, txq->tfds, txq->q.dma_addr);
                memset(&txq->q.dma_addr, 0, sizeof(txq->q.dma_addr));
        }
@@ -489,7 +488,7 @@ static void iwl_trans_pcie_tx_free(struct iwl_trans *trans)
        kfree(priv->txq);
        priv->txq = NULL;
 
-       iwlagn_free_dma_ptr(trans, &priv->kw);
+       iwlagn_free_dma_ptr(trans, &trans_pcie->kw);
 
        iwlagn_free_dma_ptr(trans, &trans_pcie->scd_bc_tbls);
 }
@@ -509,6 +508,9 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)
        struct iwl_trans_pcie *trans_pcie =
                IWL_TRANS_GET_PCIE_TRANS(trans);
 
+       u16 scd_bc_tbls_size = priv->cfg->base_params->num_of_queues *
+                       sizeof(struct iwlagn_scd_bc_tbl);
+
        /*It is not allowed to alloc twice, so warn when this happens.
         * We cannot rely on the previous allocation, so free and fail */
        if (WARN_ON(priv->txq)) {
@@ -517,14 +519,14 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)
        }
 
        ret = iwlagn_alloc_dma_ptr(trans, &trans_pcie->scd_bc_tbls,
-                               hw_params(trans).scd_bc_tbls_size);
+                                  scd_bc_tbls_size);
        if (ret) {
                IWL_ERR(trans, "Scheduler BC Table allocation failed\n");
                goto error;
        }
 
        /* Alloc keep-warm buffer */
-       ret = iwlagn_alloc_dma_ptr(trans, &priv->kw, IWL_KW_SIZE);
+       ret = iwlagn_alloc_dma_ptr(trans, &trans_pcie->kw, IWL_KW_SIZE);
        if (ret) {
                IWL_ERR(trans, "Keep Warm allocation failed\n");
                goto error;
@@ -564,6 +566,8 @@ static int iwl_tx_init(struct iwl_trans *trans)
        unsigned long flags;
        bool alloc = false;
        struct iwl_priv *priv = priv(trans);
+       struct iwl_trans_pcie *trans_pcie =
+               IWL_TRANS_GET_PCIE_TRANS(trans);
 
        if (!priv->txq) {
                ret = iwl_trans_tx_alloc(trans);
@@ -578,7 +582,7 @@ static int iwl_tx_init(struct iwl_trans *trans)
        iwl_write_prph(priv, SCD_TXFACT, 0);
 
        /* Tell NIC where to find the "keep warm" buffer */
-       iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, priv->kw.dma >> 4);
+       iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, trans_pcie->kw.dma >> 4);
 
        spin_unlock_irqrestore(&trans->shrd->lock, flags);
 
@@ -1528,7 +1532,7 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file,
        int pos = 0;
        ssize_t ret = -ENOMEM;
 
-       ret = pos = iwl_dump_nic_event_log(priv(trans), true, &buf, true);
+       ret = pos = iwl_dump_nic_event_log(trans, true, &buf, true);
        if (buf) {
                ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
                kfree(buf);
@@ -1552,7 +1556,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
        if (sscanf(buf, "%d", &event_log_flag) != 1)
                return -EFAULT;
        if (event_log_flag == 1)
-               iwl_dump_nic_event_log(priv(trans), true, NULL, false);
+               iwl_dump_nic_event_log(trans, true, NULL, false);
 
        return count;
 }