diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-05-05 01:32:32 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-07-19 21:13:57 -0400 |
commit | 1bf91cdc1bba94ea062a9147d924815c13f029f2 (patch) | |
tree | 71df925234098566e9497c0e91aa2a1eea2bc8bc /drivers/net/ethernet/intel | |
parent | d773d1310625be3b040b436178ad59a0af8888f1 (diff) |
ixgbe: Drop references to deprecated pci_ DMA api and instead use dma_ API
The networking side of the code had already been updated to use dma_ calls
instead of the old pci_ calls. However it looks like the FCoE code was
never updated. This change goes through and moves everything from the pci
APIs to the dma APIs.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 30 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h | 4 |
2 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index cc28c44a048..9b0909ffd7a 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | |||
@@ -104,10 +104,10 @@ int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid) | |||
104 | udelay(100); | 104 | udelay(100); |
105 | } | 105 | } |
106 | if (ddp->sgl) | 106 | if (ddp->sgl) |
107 | pci_unmap_sg(adapter->pdev, ddp->sgl, ddp->sgc, | 107 | dma_unmap_sg(&adapter->pdev->dev, ddp->sgl, ddp->sgc, |
108 | DMA_FROM_DEVICE); | 108 | DMA_FROM_DEVICE); |
109 | if (ddp->pool) { | 109 | if (ddp->pool) { |
110 | pci_pool_free(ddp->pool, ddp->udl, ddp->udp); | 110 | dma_pool_free(ddp->pool, ddp->udl, ddp->udp); |
111 | ddp->pool = NULL; | 111 | ddp->pool = NULL; |
112 | } | 112 | } |
113 | 113 | ||
@@ -144,7 +144,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid, | |||
144 | unsigned int thislen = 0; | 144 | unsigned int thislen = 0; |
145 | u32 fcbuff, fcdmarw, fcfltrw, fcrxctl; | 145 | u32 fcbuff, fcdmarw, fcfltrw, fcrxctl; |
146 | dma_addr_t addr = 0; | 146 | dma_addr_t addr = 0; |
147 | struct pci_pool *pool; | 147 | struct dma_pool *pool; |
148 | unsigned int cpu; | 148 | unsigned int cpu; |
149 | 149 | ||
150 | if (!netdev || !sgl) | 150 | if (!netdev || !sgl) |
@@ -176,7 +176,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid, | |||
176 | ixgbe_fcoe_clear_ddp(ddp); | 176 | ixgbe_fcoe_clear_ddp(ddp); |
177 | 177 | ||
178 | /* setup dma from scsi command sgl */ | 178 | /* setup dma from scsi command sgl */ |
179 | dmacount = pci_map_sg(adapter->pdev, sgl, sgc, DMA_FROM_DEVICE); | 179 | dmacount = dma_map_sg(&adapter->pdev->dev, sgl, sgc, DMA_FROM_DEVICE); |
180 | if (dmacount == 0) { | 180 | if (dmacount == 0) { |
181 | e_err(drv, "xid 0x%x DMA map error\n", xid); | 181 | e_err(drv, "xid 0x%x DMA map error\n", xid); |
182 | return 0; | 182 | return 0; |
@@ -185,7 +185,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid, | |||
185 | /* alloc the udl from per cpu ddp pool */ | 185 | /* alloc the udl from per cpu ddp pool */ |
186 | cpu = get_cpu(); | 186 | cpu = get_cpu(); |
187 | pool = *per_cpu_ptr(fcoe->pool, cpu); | 187 | pool = *per_cpu_ptr(fcoe->pool, cpu); |
188 | ddp->udl = pci_pool_alloc(pool, GFP_ATOMIC, &ddp->udp); | 188 | ddp->udl = dma_pool_alloc(pool, GFP_ATOMIC, &ddp->udp); |
189 | if (!ddp->udl) { | 189 | if (!ddp->udl) { |
190 | e_err(drv, "failed allocated ddp context\n"); | 190 | e_err(drv, "failed allocated ddp context\n"); |
191 | goto out_noddp_unmap; | 191 | goto out_noddp_unmap; |
@@ -293,11 +293,11 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid, | |||
293 | return 1; | 293 | return 1; |
294 | 294 | ||
295 | out_noddp_free: | 295 | out_noddp_free: |
296 | pci_pool_free(pool, ddp->udl, ddp->udp); | 296 | dma_pool_free(pool, ddp->udl, ddp->udp); |
297 | ixgbe_fcoe_clear_ddp(ddp); | 297 | ixgbe_fcoe_clear_ddp(ddp); |
298 | 298 | ||
299 | out_noddp_unmap: | 299 | out_noddp_unmap: |
300 | pci_unmap_sg(adapter->pdev, sgl, sgc, DMA_FROM_DEVICE); | 300 | dma_unmap_sg(&adapter->pdev->dev, sgl, sgc, DMA_FROM_DEVICE); |
301 | put_cpu(); | 301 | put_cpu(); |
302 | return 0; | 302 | return 0; |
303 | } | 303 | } |
@@ -409,7 +409,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, | |||
409 | break; | 409 | break; |
410 | /* unmap the sg list when FCPRSP is received */ | 410 | /* unmap the sg list when FCPRSP is received */ |
411 | case __constant_cpu_to_le32(IXGBE_RXDADV_STAT_FCSTAT_FCPRSP): | 411 | case __constant_cpu_to_le32(IXGBE_RXDADV_STAT_FCSTAT_FCPRSP): |
412 | pci_unmap_sg(adapter->pdev, ddp->sgl, | 412 | dma_unmap_sg(&adapter->pdev->dev, ddp->sgl, |
413 | ddp->sgc, DMA_FROM_DEVICE); | 413 | ddp->sgc, DMA_FROM_DEVICE); |
414 | ddp->err = ddp_err; | 414 | ddp->err = ddp_err; |
415 | ddp->sgl = NULL; | 415 | ddp->sgl = NULL; |
@@ -566,12 +566,12 @@ int ixgbe_fso(struct ixgbe_ring *tx_ring, | |||
566 | static void ixgbe_fcoe_ddp_pools_free(struct ixgbe_fcoe *fcoe) | 566 | static void ixgbe_fcoe_ddp_pools_free(struct ixgbe_fcoe *fcoe) |
567 | { | 567 | { |
568 | unsigned int cpu; | 568 | unsigned int cpu; |
569 | struct pci_pool **pool; | 569 | struct dma_pool **pool; |
570 | 570 | ||
571 | for_each_possible_cpu(cpu) { | 571 | for_each_possible_cpu(cpu) { |
572 | pool = per_cpu_ptr(fcoe->pool, cpu); | 572 | pool = per_cpu_ptr(fcoe->pool, cpu); |
573 | if (*pool) | 573 | if (*pool) |
574 | pci_pool_destroy(*pool); | 574 | dma_pool_destroy(*pool); |
575 | } | 575 | } |
576 | free_percpu(fcoe->pool); | 576 | free_percpu(fcoe->pool); |
577 | fcoe->pool = NULL; | 577 | fcoe->pool = NULL; |
@@ -581,10 +581,10 @@ static void ixgbe_fcoe_ddp_pools_alloc(struct ixgbe_adapter *adapter) | |||
581 | { | 581 | { |
582 | struct ixgbe_fcoe *fcoe = &adapter->fcoe; | 582 | struct ixgbe_fcoe *fcoe = &adapter->fcoe; |
583 | unsigned int cpu; | 583 | unsigned int cpu; |
584 | struct pci_pool **pool; | 584 | struct dma_pool **pool; |
585 | char pool_name[32]; | 585 | char pool_name[32]; |
586 | 586 | ||
587 | fcoe->pool = alloc_percpu(struct pci_pool *); | 587 | fcoe->pool = alloc_percpu(struct dma_pool *); |
588 | if (!fcoe->pool) | 588 | if (!fcoe->pool) |
589 | return; | 589 | return; |
590 | 590 | ||
@@ -592,9 +592,9 @@ static void ixgbe_fcoe_ddp_pools_alloc(struct ixgbe_adapter *adapter) | |||
592 | for_each_possible_cpu(cpu) { | 592 | for_each_possible_cpu(cpu) { |
593 | snprintf(pool_name, 32, "ixgbe_fcoe_ddp_%d", cpu); | 593 | snprintf(pool_name, 32, "ixgbe_fcoe_ddp_%d", cpu); |
594 | pool = per_cpu_ptr(fcoe->pool, cpu); | 594 | pool = per_cpu_ptr(fcoe->pool, cpu); |
595 | *pool = pci_pool_create(pool_name, | 595 | *pool = dma_pool_create(pool_name, &adapter->pdev->dev, |
596 | adapter->pdev, IXGBE_FCPTR_MAX, | 596 | IXGBE_FCPTR_MAX, IXGBE_FCPTR_ALIGN, |
597 | IXGBE_FCPTR_ALIGN, PAGE_SIZE); | 597 | PAGE_SIZE); |
598 | if (!*pool) { | 598 | if (!*pool) { |
599 | e_err(drv, "failed to alloc DDP pool on cpu:%d\n", cpu); | 599 | e_err(drv, "failed to alloc DDP pool on cpu:%d\n", cpu); |
600 | ixgbe_fcoe_ddp_pools_free(fcoe); | 600 | ixgbe_fcoe_ddp_pools_free(fcoe); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h index 1dbed17c810..0ef231a4579 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h | |||
@@ -62,11 +62,11 @@ struct ixgbe_fcoe_ddp { | |||
62 | struct scatterlist *sgl; | 62 | struct scatterlist *sgl; |
63 | dma_addr_t udp; | 63 | dma_addr_t udp; |
64 | u64 *udl; | 64 | u64 *udl; |
65 | struct pci_pool *pool; | 65 | struct dma_pool *pool; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct ixgbe_fcoe { | 68 | struct ixgbe_fcoe { |
69 | struct pci_pool **pool; | 69 | struct dma_pool **pool; |
70 | atomic_t refcnt; | 70 | atomic_t refcnt; |
71 | spinlock_t lock; | 71 | spinlock_t lock; |
72 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; | 72 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; |