diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-03-31 18:13:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-01 21:38:33 -0400 |
commit | 430e55b11e9756bb7648fc1cdf5063e385cd6dec (patch) | |
tree | f79e34fbaccd5b8c0211ff545d59dd902a957940 /drivers/net/acenic.c | |
parent | 07e7de8f7a7146b3ac77c52ebd91c93a8370d9a8 (diff) |
acenic: use the dma state API instead of the pci equivalents
The DMA API is preferred.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/acenic.c')
-rw-r--r-- | drivers/net/acenic.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index e52cc3b71693..2dc5f9544c77 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -660,7 +660,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
660 | dma_addr_t mapping; | 660 | dma_addr_t mapping; |
661 | 661 | ||
662 | ringp = &ap->skb->rx_std_skbuff[i]; | 662 | ringp = &ap->skb->rx_std_skbuff[i]; |
663 | mapping = pci_unmap_addr(ringp, mapping); | 663 | mapping = dma_unmap_addr(ringp, mapping); |
664 | pci_unmap_page(ap->pdev, mapping, | 664 | pci_unmap_page(ap->pdev, mapping, |
665 | ACE_STD_BUFSIZE, | 665 | ACE_STD_BUFSIZE, |
666 | PCI_DMA_FROMDEVICE); | 666 | PCI_DMA_FROMDEVICE); |
@@ -680,7 +680,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
680 | dma_addr_t mapping; | 680 | dma_addr_t mapping; |
681 | 681 | ||
682 | ringp = &ap->skb->rx_mini_skbuff[i]; | 682 | ringp = &ap->skb->rx_mini_skbuff[i]; |
683 | mapping = pci_unmap_addr(ringp,mapping); | 683 | mapping = dma_unmap_addr(ringp,mapping); |
684 | pci_unmap_page(ap->pdev, mapping, | 684 | pci_unmap_page(ap->pdev, mapping, |
685 | ACE_MINI_BUFSIZE, | 685 | ACE_MINI_BUFSIZE, |
686 | PCI_DMA_FROMDEVICE); | 686 | PCI_DMA_FROMDEVICE); |
@@ -699,7 +699,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
699 | dma_addr_t mapping; | 699 | dma_addr_t mapping; |
700 | 700 | ||
701 | ringp = &ap->skb->rx_jumbo_skbuff[i]; | 701 | ringp = &ap->skb->rx_jumbo_skbuff[i]; |
702 | mapping = pci_unmap_addr(ringp, mapping); | 702 | mapping = dma_unmap_addr(ringp, mapping); |
703 | pci_unmap_page(ap->pdev, mapping, | 703 | pci_unmap_page(ap->pdev, mapping, |
704 | ACE_JUMBO_BUFSIZE, | 704 | ACE_JUMBO_BUFSIZE, |
705 | PCI_DMA_FROMDEVICE); | 705 | PCI_DMA_FROMDEVICE); |
@@ -1682,7 +1682,7 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1682 | ACE_STD_BUFSIZE, | 1682 | ACE_STD_BUFSIZE, |
1683 | PCI_DMA_FROMDEVICE); | 1683 | PCI_DMA_FROMDEVICE); |
1684 | ap->skb->rx_std_skbuff[idx].skb = skb; | 1684 | ap->skb->rx_std_skbuff[idx].skb = skb; |
1685 | pci_unmap_addr_set(&ap->skb->rx_std_skbuff[idx], | 1685 | dma_unmap_addr_set(&ap->skb->rx_std_skbuff[idx], |
1686 | mapping, mapping); | 1686 | mapping, mapping); |
1687 | 1687 | ||
1688 | rd = &ap->rx_std_ring[idx]; | 1688 | rd = &ap->rx_std_ring[idx]; |
@@ -1743,7 +1743,7 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1743 | ACE_MINI_BUFSIZE, | 1743 | ACE_MINI_BUFSIZE, |
1744 | PCI_DMA_FROMDEVICE); | 1744 | PCI_DMA_FROMDEVICE); |
1745 | ap->skb->rx_mini_skbuff[idx].skb = skb; | 1745 | ap->skb->rx_mini_skbuff[idx].skb = skb; |
1746 | pci_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx], | 1746 | dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx], |
1747 | mapping, mapping); | 1747 | mapping, mapping); |
1748 | 1748 | ||
1749 | rd = &ap->rx_mini_ring[idx]; | 1749 | rd = &ap->rx_mini_ring[idx]; |
@@ -1799,7 +1799,7 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1799 | ACE_JUMBO_BUFSIZE, | 1799 | ACE_JUMBO_BUFSIZE, |
1800 | PCI_DMA_FROMDEVICE); | 1800 | PCI_DMA_FROMDEVICE); |
1801 | ap->skb->rx_jumbo_skbuff[idx].skb = skb; | 1801 | ap->skb->rx_jumbo_skbuff[idx].skb = skb; |
1802 | pci_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx], | 1802 | dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx], |
1803 | mapping, mapping); | 1803 | mapping, mapping); |
1804 | 1804 | ||
1805 | rd = &ap->rx_jumbo_ring[idx]; | 1805 | rd = &ap->rx_jumbo_ring[idx]; |
@@ -2012,7 +2012,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) | |||
2012 | skb = rip->skb; | 2012 | skb = rip->skb; |
2013 | rip->skb = NULL; | 2013 | rip->skb = NULL; |
2014 | pci_unmap_page(ap->pdev, | 2014 | pci_unmap_page(ap->pdev, |
2015 | pci_unmap_addr(rip, mapping), | 2015 | dma_unmap_addr(rip, mapping), |
2016 | mapsize, | 2016 | mapsize, |
2017 | PCI_DMA_FROMDEVICE); | 2017 | PCI_DMA_FROMDEVICE); |
2018 | skb_put(skb, retdesc->size); | 2018 | skb_put(skb, retdesc->size); |
@@ -2084,7 +2084,7 @@ static inline void ace_tx_int(struct net_device *dev, | |||
2084 | 2084 | ||
2085 | if (dma_unmap_len(info, maplen)) { | 2085 | if (dma_unmap_len(info, maplen)) { |
2086 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), | 2086 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), |
2087 | pci_unmap_len(info, maplen), | 2087 | dma_unmap_len(info, maplen), |
2088 | PCI_DMA_TODEVICE); | 2088 | PCI_DMA_TODEVICE); |
2089 | dma_unmap_len_set(info, maplen, 0); | 2089 | dma_unmap_len_set(info, maplen, 0); |
2090 | } | 2090 | } |
@@ -2391,7 +2391,7 @@ static int ace_close(struct net_device *dev) | |||
2391 | memset(ap->tx_ring + i, 0, | 2391 | memset(ap->tx_ring + i, 0, |
2392 | sizeof(struct tx_desc)); | 2392 | sizeof(struct tx_desc)); |
2393 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), | 2393 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), |
2394 | pci_unmap_len(info, maplen), | 2394 | dma_unmap_len(info, maplen), |
2395 | PCI_DMA_TODEVICE); | 2395 | PCI_DMA_TODEVICE); |
2396 | dma_unmap_len_set(info, maplen, 0); | 2396 | dma_unmap_len_set(info, maplen, 0); |
2397 | } | 2397 | } |
@@ -2428,8 +2428,8 @@ ace_map_tx_skb(struct ace_private *ap, struct sk_buff *skb, | |||
2428 | 2428 | ||
2429 | info = ap->skb->tx_skbuff + idx; | 2429 | info = ap->skb->tx_skbuff + idx; |
2430 | info->skb = tail; | 2430 | info->skb = tail; |
2431 | pci_unmap_addr_set(info, mapping, mapping); | 2431 | dma_unmap_addr_set(info, mapping, mapping); |
2432 | pci_unmap_len_set(info, maplen, skb->len); | 2432 | dma_unmap_len_set(info, maplen, skb->len); |
2433 | return mapping; | 2433 | return mapping; |
2434 | } | 2434 | } |
2435 | 2435 | ||
@@ -2548,8 +2548,8 @@ restart: | |||
2548 | } else { | 2548 | } else { |
2549 | info->skb = NULL; | 2549 | info->skb = NULL; |
2550 | } | 2550 | } |
2551 | pci_unmap_addr_set(info, mapping, mapping); | 2551 | dma_unmap_addr_set(info, mapping, mapping); |
2552 | pci_unmap_len_set(info, maplen, frag->size); | 2552 | dma_unmap_len_set(info, maplen, frag->size); |
2553 | ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); | 2553 | ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); |
2554 | } | 2554 | } |
2555 | } | 2555 | } |