diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-04-27 10:57:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-28 13:07:44 -0400 |
commit | 7cd26ce5f7dbd06698ab3413b1c5a77cf27f8c0a (patch) | |
tree | b8ea59d8dac455fb9d0cea98cef11bb2356fcf1d /drivers/net/sky2.c | |
parent | 214f1c87bd86f9061fedbae929bc4a7a7089ee75 (diff) |
sky2: 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: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a1b17fa34c76..bf9c05be347b 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1129,7 +1129,7 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re, | |||
1129 | if (pci_dma_mapping_error(pdev, re->data_addr)) | 1129 | if (pci_dma_mapping_error(pdev, re->data_addr)) |
1130 | goto mapping_error; | 1130 | goto mapping_error; |
1131 | 1131 | ||
1132 | pci_unmap_len_set(re, data_size, size); | 1132 | dma_unmap_len_set(re, data_size, size); |
1133 | 1133 | ||
1134 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1134 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1135 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 1135 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
@@ -1151,7 +1151,7 @@ map_page_error: | |||
1151 | PCI_DMA_FROMDEVICE); | 1151 | PCI_DMA_FROMDEVICE); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | pci_unmap_single(pdev, re->data_addr, pci_unmap_len(re, data_size), | 1154 | pci_unmap_single(pdev, re->data_addr, dma_unmap_len(re, data_size), |
1155 | PCI_DMA_FROMDEVICE); | 1155 | PCI_DMA_FROMDEVICE); |
1156 | 1156 | ||
1157 | mapping_error: | 1157 | mapping_error: |
@@ -1166,7 +1166,7 @@ static void sky2_rx_unmap_skb(struct pci_dev *pdev, struct rx_ring_info *re) | |||
1166 | struct sk_buff *skb = re->skb; | 1166 | struct sk_buff *skb = re->skb; |
1167 | int i; | 1167 | int i; |
1168 | 1168 | ||
1169 | pci_unmap_single(pdev, re->data_addr, pci_unmap_len(re, data_size), | 1169 | pci_unmap_single(pdev, re->data_addr, dma_unmap_len(re, data_size), |
1170 | PCI_DMA_FROMDEVICE); | 1170 | PCI_DMA_FROMDEVICE); |
1171 | 1171 | ||
1172 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) | 1172 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) |
@@ -1695,12 +1695,12 @@ static unsigned tx_le_req(const struct sk_buff *skb) | |||
1695 | static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re) | 1695 | static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re) |
1696 | { | 1696 | { |
1697 | if (re->flags & TX_MAP_SINGLE) | 1697 | if (re->flags & TX_MAP_SINGLE) |
1698 | pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr), | 1698 | pci_unmap_single(pdev, dma_unmap_addr(re, mapaddr), |
1699 | pci_unmap_len(re, maplen), | 1699 | dma_unmap_len(re, maplen), |
1700 | PCI_DMA_TODEVICE); | 1700 | PCI_DMA_TODEVICE); |
1701 | else if (re->flags & TX_MAP_PAGE) | 1701 | else if (re->flags & TX_MAP_PAGE) |
1702 | pci_unmap_page(pdev, pci_unmap_addr(re, mapaddr), | 1702 | pci_unmap_page(pdev, dma_unmap_addr(re, mapaddr), |
1703 | pci_unmap_len(re, maplen), | 1703 | dma_unmap_len(re, maplen), |
1704 | PCI_DMA_TODEVICE); | 1704 | PCI_DMA_TODEVICE); |
1705 | re->flags = 0; | 1705 | re->flags = 0; |
1706 | } | 1706 | } |
@@ -1811,8 +1811,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb, | |||
1811 | 1811 | ||
1812 | re = sky2->tx_ring + slot; | 1812 | re = sky2->tx_ring + slot; |
1813 | re->flags = TX_MAP_SINGLE; | 1813 | re->flags = TX_MAP_SINGLE; |
1814 | pci_unmap_addr_set(re, mapaddr, mapping); | 1814 | dma_unmap_addr_set(re, mapaddr, mapping); |
1815 | pci_unmap_len_set(re, maplen, len); | 1815 | dma_unmap_len_set(re, maplen, len); |
1816 | 1816 | ||
1817 | le = get_tx_le(sky2, &slot); | 1817 | le = get_tx_le(sky2, &slot); |
1818 | le->addr = cpu_to_le32(lower_32_bits(mapping)); | 1818 | le->addr = cpu_to_le32(lower_32_bits(mapping)); |
@@ -1840,8 +1840,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb, | |||
1840 | 1840 | ||
1841 | re = sky2->tx_ring + slot; | 1841 | re = sky2->tx_ring + slot; |
1842 | re->flags = TX_MAP_PAGE; | 1842 | re->flags = TX_MAP_PAGE; |
1843 | pci_unmap_addr_set(re, mapaddr, mapping); | 1843 | dma_unmap_addr_set(re, mapaddr, mapping); |
1844 | pci_unmap_len_set(re, maplen, frag->size); | 1844 | dma_unmap_len_set(re, maplen, frag->size); |
1845 | 1845 | ||
1846 | le = get_tx_le(sky2, &slot); | 1846 | le = get_tx_le(sky2, &slot); |
1847 | le->addr = cpu_to_le32(lower_32_bits(mapping)); | 1847 | le->addr = cpu_to_le32(lower_32_bits(mapping)); |