aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2010-04-12 10:32:10 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-13 05:54:19 -0400
commitc755b4b625b183d3cfc3f3ab0b2d5b7e659efaf3 (patch)
tree805210f0ef34a0860ffaefd8539afb12706f35d7
parent64b9b41de87e86129d055a584ee9e16bce97573a (diff)
myri10ge: 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> Cc: Andrew Gallatin <gallatin@myri.com> Cc: Brice Goglin <brice@myri.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/myri10ge/myri10ge.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 72b4b19e14e7..958dc283d0e7 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -110,15 +110,15 @@ MODULE_LICENSE("Dual BSD/GPL");
110struct myri10ge_rx_buffer_state { 110struct myri10ge_rx_buffer_state {
111 struct page *page; 111 struct page *page;
112 int page_offset; 112 int page_offset;
113 DECLARE_PCI_UNMAP_ADDR(bus) 113 DEFINE_DMA_UNMAP_ADDR(bus);
114 DECLARE_PCI_UNMAP_LEN(len) 114 DEFINE_DMA_UNMAP_LEN(len);
115}; 115};
116 116
117struct myri10ge_tx_buffer_state { 117struct myri10ge_tx_buffer_state {
118 struct sk_buff *skb; 118 struct sk_buff *skb;
119 int last; 119 int last;
120 DECLARE_PCI_UNMAP_ADDR(bus) 120 DEFINE_DMA_UNMAP_ADDR(bus);
121 DECLARE_PCI_UNMAP_LEN(len) 121 DEFINE_DMA_UNMAP_LEN(len);
122}; 122};
123 123
124struct myri10ge_cmd { 124struct myri10ge_cmd {
@@ -1234,7 +1234,7 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
1234 rx->info[idx].page_offset = rx->page_offset; 1234 rx->info[idx].page_offset = rx->page_offset;
1235 /* note that this is the address of the start of the 1235 /* note that this is the address of the start of the
1236 * page */ 1236 * page */
1237 pci_unmap_addr_set(&rx->info[idx], bus, rx->bus); 1237 dma_unmap_addr_set(&rx->info[idx], bus, rx->bus);
1238 rx->shadow[idx].addr_low = 1238 rx->shadow[idx].addr_low =
1239 htonl(MYRI10GE_LOWPART_TO_U32(rx->bus) + rx->page_offset); 1239 htonl(MYRI10GE_LOWPART_TO_U32(rx->bus) + rx->page_offset);
1240 rx->shadow[idx].addr_high = 1240 rx->shadow[idx].addr_high =
@@ -1266,7 +1266,7 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev,
1266 /* unmap the recvd page if we're the only or last user of it */ 1266 /* unmap the recvd page if we're the only or last user of it */
1267 if (bytes >= MYRI10GE_ALLOC_SIZE / 2 || 1267 if (bytes >= MYRI10GE_ALLOC_SIZE / 2 ||
1268 (info->page_offset + 2 * bytes) > MYRI10GE_ALLOC_SIZE) { 1268 (info->page_offset + 2 * bytes) > MYRI10GE_ALLOC_SIZE) {
1269 pci_unmap_page(pdev, (pci_unmap_addr(info, bus) 1269 pci_unmap_page(pdev, (dma_unmap_addr(info, bus)
1270 & ~(MYRI10GE_ALLOC_SIZE - 1)), 1270 & ~(MYRI10GE_ALLOC_SIZE - 1)),
1271 MYRI10GE_ALLOC_SIZE, PCI_DMA_FROMDEVICE); 1271 MYRI10GE_ALLOC_SIZE, PCI_DMA_FROMDEVICE);
1272 } 1272 }
@@ -1373,21 +1373,21 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index)
1373 tx->info[idx].last = 0; 1373 tx->info[idx].last = 0;
1374 } 1374 }
1375 tx->done++; 1375 tx->done++;
1376 len = pci_unmap_len(&tx->info[idx], len); 1376 len = dma_unmap_len(&tx->info[idx], len);
1377 pci_unmap_len_set(&tx->info[idx], len, 0); 1377 dma_unmap_len_set(&tx->info[idx], len, 0);
1378 if (skb) { 1378 if (skb) {
1379 ss->stats.tx_bytes += skb->len; 1379 ss->stats.tx_bytes += skb->len;
1380 ss->stats.tx_packets++; 1380 ss->stats.tx_packets++;
1381 dev_kfree_skb_irq(skb); 1381 dev_kfree_skb_irq(skb);
1382 if (len) 1382 if (len)
1383 pci_unmap_single(pdev, 1383 pci_unmap_single(pdev,
1384 pci_unmap_addr(&tx->info[idx], 1384 dma_unmap_addr(&tx->info[idx],
1385 bus), len, 1385 bus), len,
1386 PCI_DMA_TODEVICE); 1386 PCI_DMA_TODEVICE);
1387 } else { 1387 } else {
1388 if (len) 1388 if (len)
1389 pci_unmap_page(pdev, 1389 pci_unmap_page(pdev,
1390 pci_unmap_addr(&tx->info[idx], 1390 dma_unmap_addr(&tx->info[idx],
1391 bus), len, 1391 bus), len,
1392 PCI_DMA_TODEVICE); 1392 PCI_DMA_TODEVICE);
1393 } 1393 }
@@ -2094,20 +2094,20 @@ static void myri10ge_free_rings(struct myri10ge_slice_state *ss)
2094 /* Mark as free */ 2094 /* Mark as free */
2095 tx->info[idx].skb = NULL; 2095 tx->info[idx].skb = NULL;
2096 tx->done++; 2096 tx->done++;
2097 len = pci_unmap_len(&tx->info[idx], len); 2097 len = dma_unmap_len(&tx->info[idx], len);
2098 pci_unmap_len_set(&tx->info[idx], len, 0); 2098 dma_unmap_len_set(&tx->info[idx], len, 0);
2099 if (skb) { 2099 if (skb) {
2100 ss->stats.tx_dropped++; 2100 ss->stats.tx_dropped++;
2101 dev_kfree_skb_any(skb); 2101 dev_kfree_skb_any(skb);
2102 if (len) 2102 if (len)
2103 pci_unmap_single(mgp->pdev, 2103 pci_unmap_single(mgp->pdev,
2104 pci_unmap_addr(&tx->info[idx], 2104 dma_unmap_addr(&tx->info[idx],
2105 bus), len, 2105 bus), len,
2106 PCI_DMA_TODEVICE); 2106 PCI_DMA_TODEVICE);
2107 } else { 2107 } else {
2108 if (len) 2108 if (len)
2109 pci_unmap_page(mgp->pdev, 2109 pci_unmap_page(mgp->pdev,
2110 pci_unmap_addr(&tx->info[idx], 2110 dma_unmap_addr(&tx->info[idx],
2111 bus), len, 2111 bus), len,
2112 PCI_DMA_TODEVICE); 2112 PCI_DMA_TODEVICE);
2113 } 2113 }
@@ -2761,8 +2761,8 @@ again:
2761 idx = tx->req & tx->mask; 2761 idx = tx->req & tx->mask;
2762 tx->info[idx].skb = skb; 2762 tx->info[idx].skb = skb;
2763 bus = pci_map_single(mgp->pdev, skb->data, len, PCI_DMA_TODEVICE); 2763 bus = pci_map_single(mgp->pdev, skb->data, len, PCI_DMA_TODEVICE);
2764 pci_unmap_addr_set(&tx->info[idx], bus, bus); 2764 dma_unmap_addr_set(&tx->info[idx], bus, bus);
2765 pci_unmap_len_set(&tx->info[idx], len, len); 2765 dma_unmap_len_set(&tx->info[idx], len, len);
2766 2766
2767 frag_cnt = skb_shinfo(skb)->nr_frags; 2767 frag_cnt = skb_shinfo(skb)->nr_frags;
2768 frag_idx = 0; 2768 frag_idx = 0;
@@ -2865,8 +2865,8 @@ again:
2865 len = frag->size; 2865 len = frag->size;
2866 bus = pci_map_page(mgp->pdev, frag->page, frag->page_offset, 2866 bus = pci_map_page(mgp->pdev, frag->page, frag->page_offset,
2867 len, PCI_DMA_TODEVICE); 2867 len, PCI_DMA_TODEVICE);
2868 pci_unmap_addr_set(&tx->info[idx], bus, bus); 2868 dma_unmap_addr_set(&tx->info[idx], bus, bus);
2869 pci_unmap_len_set(&tx->info[idx], len, len); 2869 dma_unmap_len_set(&tx->info[idx], len, len);
2870 } 2870 }
2871 2871
2872 (req - rdma_count)->rdma_count = rdma_count; 2872 (req - rdma_count)->rdma_count = rdma_count;
@@ -2903,19 +2903,19 @@ abort_linearize:
2903 idx = tx->req & tx->mask; 2903 idx = tx->req & tx->mask;
2904 tx->info[idx].skb = NULL; 2904 tx->info[idx].skb = NULL;
2905 do { 2905 do {
2906 len = pci_unmap_len(&tx->info[idx], len); 2906 len = dma_unmap_len(&tx->info[idx], len);
2907 if (len) { 2907 if (len) {
2908 if (tx->info[idx].skb != NULL) 2908 if (tx->info[idx].skb != NULL)
2909 pci_unmap_single(mgp->pdev, 2909 pci_unmap_single(mgp->pdev,
2910 pci_unmap_addr(&tx->info[idx], 2910 dma_unmap_addr(&tx->info[idx],
2911 bus), len, 2911 bus), len,
2912 PCI_DMA_TODEVICE); 2912 PCI_DMA_TODEVICE);
2913 else 2913 else
2914 pci_unmap_page(mgp->pdev, 2914 pci_unmap_page(mgp->pdev,
2915 pci_unmap_addr(&tx->info[idx], 2915 dma_unmap_addr(&tx->info[idx],
2916 bus), len, 2916 bus), len,
2917 PCI_DMA_TODEVICE); 2917 PCI_DMA_TODEVICE);
2918 pci_unmap_len_set(&tx->info[idx], len, 0); 2918 dma_unmap_len_set(&tx->info[idx], len, 0);
2919 tx->info[idx].skb = NULL; 2919 tx->info[idx].skb = NULL;
2920 } 2920 }
2921 idx = (idx + 1) & tx->mask; 2921 idx = (idx + 1) & tx->mask;