iwlwifi: use the DMA state API instead of the pci equivalents
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Thu, 3 Jun 2010 05:19:20 +0000 (14:19 +0900)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Jun 2010 20:00:40 +0000 (16:00 -0400)
This can be cleanly applied to wireless-2.6 and iwlwifi git trees.

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] iwlwifi: use the DMA state API instead of the pci equivalents

This replace the PCI DMA state API (include/linux/pci-dma.h) with the
DMA equivalents since the PCI DMA state API will be obsolete.

No functional change.

For further information about the background:

http://marc.info/?l=linux-netdev&m=127037540020276&w=2

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-tx.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index de915c4..7d7e37e 100644 (file)
@@ -850,8 +850,8 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
        /* Unmap tx_cmd */
        if (counter)
                pci_unmap_single(dev,
-                               pci_unmap_addr(&txq->meta[index], mapping),
-                               pci_unmap_len(&txq->meta[index], len),
+                               dma_unmap_addr(&txq->meta[index], mapping),
+                               dma_unmap_len(&txq->meta[index], len),
                                PCI_DMA_TODEVICE);
 
        /* unmap chunks if any */
index bde342b..eb0a6da 100644 (file)
@@ -704,8 +704,8 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
        txcmd_phys = pci_map_single(priv->pci_dev,
                                    &out_cmd->hdr, len,
                                    PCI_DMA_BIDIRECTIONAL);
-       pci_unmap_addr_set(out_meta, mapping, txcmd_phys);
-       pci_unmap_len_set(out_meta, len, len);
+       dma_unmap_addr_set(out_meta, mapping, txcmd_phys);
+       dma_unmap_len_set(out_meta, len, len);
        /* Add buffer containing Tx command and MAC(!) header to TFD's
         * first entry */
        priv->cfg->ops->lib->txq_attach_buf_to_tfd(priv, txq,
index f13f438..f81f9d1 100644 (file)
@@ -474,8 +474,8 @@ void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
        /* Unmap tx_cmd */
        if (num_tbs)
                pci_unmap_single(dev,
-                               pci_unmap_addr(&txq->meta[index], mapping),
-                               pci_unmap_len(&txq->meta[index], len),
+                               dma_unmap_addr(&txq->meta[index], mapping),
+                               dma_unmap_len(&txq->meta[index], len),
                                PCI_DMA_BIDIRECTIONAL);
 
        /* Unmap chunks, if any. */
index 90efb8c..f359d9f 100644 (file)
@@ -114,8 +114,8 @@ struct iwl_cmd_meta {
         * structure is stored at the end of the shared queue memory. */
        u32 flags;
 
-       DECLARE_PCI_UNMAP_ADDR(mapping)
-       DECLARE_PCI_UNMAP_LEN(len)
+       DEFINE_DMA_UNMAP_ADDR(mapping);
+       DEFINE_DMA_UNMAP_LEN(len);
 };
 
 /*
index e732f21..769136f 100644 (file)
@@ -154,15 +154,15 @@ void iwl_cmd_queue_free(struct iwl_priv *priv)
                }
 
                pci_unmap_single(priv->pci_dev,
-                                pci_unmap_addr(&txq->meta[i], mapping),
-                                pci_unmap_len(&txq->meta[i], len),
+                                dma_unmap_addr(&txq->meta[i], mapping),
+                                dma_unmap_len(&txq->meta[i], len),
                                 PCI_DMA_BIDIRECTIONAL);
        }
        if (huge) {
                i = q->n_window;
                pci_unmap_single(priv->pci_dev,
-                                pci_unmap_addr(&txq->meta[i], mapping),
-                                pci_unmap_len(&txq->meta[i], len),
+                                dma_unmap_addr(&txq->meta[i], mapping),
+                                dma_unmap_len(&txq->meta[i], len),
                                 PCI_DMA_BIDIRECTIONAL);
        }
 
@@ -516,8 +516,8 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
        phys_addr = pci_map_single(priv->pci_dev, &out_cmd->hdr,
                                   fix_size, PCI_DMA_BIDIRECTIONAL);
-       pci_unmap_addr_set(out_meta, mapping, phys_addr);
-       pci_unmap_len_set(out_meta, len, fix_size);
+       dma_unmap_addr_set(out_meta, mapping, phys_addr);
+       dma_unmap_len_set(out_meta, len, fix_size);
 
        trace_iwlwifi_dev_hcmd(priv, &out_cmd->hdr, fix_size, cmd->flags);
 
@@ -611,8 +611,8 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
        meta = &txq->meta[cmd_index];
 
        pci_unmap_single(priv->pci_dev,
-                        pci_unmap_addr(meta, mapping),
-                        pci_unmap_len(meta, len),
+                        dma_unmap_addr(meta, mapping),
+                        dma_unmap_len(meta, len),
                         PCI_DMA_BIDIRECTIONAL);
 
        /* Input error checking is done when commands are added to queue. */
index f3127d5..42f1d33 100644 (file)
@@ -619,8 +619,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
                                    len, PCI_DMA_TODEVICE);
        /* we do not map meta data ... so we can safely access address to
         * provide to unmap command*/
-       pci_unmap_addr_set(out_meta, mapping, txcmd_phys);
-       pci_unmap_len_set(out_meta, len, len);
+       dma_unmap_addr_set(out_meta, mapping, txcmd_phys);
+       dma_unmap_len_set(out_meta, len, len);
 
        /* Add buffer containing Tx command and MAC(!) header to TFD's
         * first entry */