aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index f982ac9b8ba2..fd8aee9972c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -128,7 +128,6 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd)
128static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, 128static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta,
129 struct iwl_tfd *tfd) 129 struct iwl_tfd *tfd)
130{ 130{
131 struct pci_dev *dev = priv->pci_dev;
132 int i; 131 int i;
133 int num_tbs; 132 int num_tbs;
134 133
@@ -143,15 +142,15 @@ static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta,
143 142
144 /* Unmap tx_cmd */ 143 /* Unmap tx_cmd */
145 if (num_tbs) 144 if (num_tbs)
146 pci_unmap_single(dev, 145 dma_unmap_single(priv->bus.dev,
147 dma_unmap_addr(meta, mapping), 146 dma_unmap_addr(meta, mapping),
148 dma_unmap_len(meta, len), 147 dma_unmap_len(meta, len),
149 PCI_DMA_BIDIRECTIONAL); 148 DMA_BIDIRECTIONAL);
150 149
151 /* Unmap chunks, if any. */ 150 /* Unmap chunks, if any. */
152 for (i = 1; i < num_tbs; i++) 151 for (i = 1; i < num_tbs; i++)
153 pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i), 152 dma_unmap_single(priv->bus.dev, iwl_tfd_tb_get_addr(tfd, i),
154 iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE); 153 iwl_tfd_tb_get_len(tfd, i), DMA_TO_DEVICE);
155} 154}
156 155
157/** 156/**
@@ -310,10 +309,10 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv)
310 i = get_cmd_index(q, q->read_ptr); 309 i = get_cmd_index(q, q->read_ptr);
311 310
312 if (txq->meta[i].flags & CMD_MAPPED) { 311 if (txq->meta[i].flags & CMD_MAPPED) {
313 pci_unmap_single(priv->pci_dev, 312 dma_unmap_single(priv->bus.dev,
314 dma_unmap_addr(&txq->meta[i], mapping), 313 dma_unmap_addr(&txq->meta[i], mapping),
315 dma_unmap_len(&txq->meta[i], len), 314 dma_unmap_len(&txq->meta[i], len),
316 PCI_DMA_BIDIRECTIONAL); 315 DMA_BIDIRECTIONAL);
317 txq->meta[i].flags = 0; 316 txq->meta[i].flags = 0;
318 } 317 }
319 318
@@ -456,7 +455,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
456 txq->tfds = dma_alloc_coherent(dev, tfd_sz, &txq->q.dma_addr, 455 txq->tfds = dma_alloc_coherent(dev, tfd_sz, &txq->q.dma_addr,
457 GFP_KERNEL); 456 GFP_KERNEL);
458 if (!txq->tfds) { 457 if (!txq->tfds) {
459 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n", tfd_sz); 458 IWL_ERR(priv, "dma_alloc_coherent(%zd) failed\n", tfd_sz);
460 goto error; 459 goto error;
461 } 460 }
462 txq->q.id = id; 461 txq->q.id = id;
@@ -677,9 +676,9 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
677 le16_to_cpu(out_cmd->hdr.sequence), cmd_size, 676 le16_to_cpu(out_cmd->hdr.sequence), cmd_size,
678 q->write_ptr, idx, priv->cmd_queue); 677 q->write_ptr, idx, priv->cmd_queue);
679 678
680 phys_addr = pci_map_single(priv->pci_dev, &out_cmd->hdr, 679 phys_addr = dma_map_single(priv->bus.dev, &out_cmd->hdr, copy_size,
681 copy_size, PCI_DMA_BIDIRECTIONAL); 680 DMA_BIDIRECTIONAL);
682 if (unlikely(pci_dma_mapping_error(priv->pci_dev, phys_addr))) { 681 if (unlikely(dma_mapping_error(priv->bus.dev, phys_addr))) {
683 idx = -ENOMEM; 682 idx = -ENOMEM;
684 goto out; 683 goto out;
685 } 684 }
@@ -699,9 +698,9 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
699 continue; 698 continue;
700 if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) 699 if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY))
701 continue; 700 continue;
702 phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i], 701 phys_addr = dma_map_single(priv->bus.dev, (void *)cmd->data[i],
703 cmd->len[i], PCI_DMA_TODEVICE); 702 cmd->len[i], DMA_TO_DEVICE);
704 if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) { 703 if (dma_mapping_error(priv->bus.dev, phys_addr)) {
705 iwlagn_unmap_tfd(priv, out_meta, 704 iwlagn_unmap_tfd(priv, out_meta,
706 &txq->tfds[q->write_ptr]); 705 &txq->tfds[q->write_ptr]);
707 idx = -ENOMEM; 706 idx = -ENOMEM;