Commit 10fc51b9953112ade61e33ff2f6f005f005a2361

Authored by FUJITA Tomonori
Committed by David S. Miller
1 parent e3826f1e94

skge: 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>

Showing 2 changed files with 18 additions and 18 deletions Side-by-side Diff

... ... @@ -984,8 +984,8 @@
984 984 wmb();
985 985  
986 986 rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize;
987   - pci_unmap_addr_set(e, mapaddr, map);
988   - pci_unmap_len_set(e, maplen, bufsize);
  987 + dma_unmap_addr_set(e, mapaddr, map);
  988 + dma_unmap_len_set(e, maplen, bufsize);
989 989 }
990 990  
991 991 /* Resume receiving using existing skb,
... ... @@ -1018,8 +1018,8 @@
1018 1018 rd->control = 0;
1019 1019 if (e->skb) {
1020 1020 pci_unmap_single(hw->pdev,
1021   - pci_unmap_addr(e, mapaddr),
1022   - pci_unmap_len(e, maplen),
  1021 + dma_unmap_addr(e, mapaddr),
  1022 + dma_unmap_len(e, maplen),
1023 1023 PCI_DMA_FROMDEVICE);
1024 1024 dev_kfree_skb(e->skb);
1025 1025 e->skb = NULL;
... ... @@ -2756,8 +2756,8 @@
2756 2756 e->skb = skb;
2757 2757 len = skb_headlen(skb);
2758 2758 map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
2759   - pci_unmap_addr_set(e, mapaddr, map);
2760   - pci_unmap_len_set(e, maplen, len);
  2759 + dma_unmap_addr_set(e, mapaddr, map);
  2760 + dma_unmap_len_set(e, maplen, len);
2761 2761  
2762 2762 td->dma_lo = map;
2763 2763 td->dma_hi = map >> 32;
... ... @@ -2799,8 +2799,8 @@
2799 2799  
2800 2800 tf->dma_lo = map;
2801 2801 tf->dma_hi = (u64) map >> 32;
2802   - pci_unmap_addr_set(e, mapaddr, map);
2803   - pci_unmap_len_set(e, maplen, frag->size);
  2802 + dma_unmap_addr_set(e, mapaddr, map);
  2803 + dma_unmap_len_set(e, maplen, frag->size);
2804 2804  
2805 2805 tf->control = BMU_OWN | BMU_SW | control | frag->size;
2806 2806 }
2807 2807  
... ... @@ -2837,12 +2837,12 @@
2837 2837  
2838 2838 /* skb header vs. fragment */
2839 2839 if (control & BMU_STF)
2840   - pci_unmap_single(pdev, pci_unmap_addr(e, mapaddr),
2841   - pci_unmap_len(e, maplen),
  2840 + pci_unmap_single(pdev, dma_unmap_addr(e, mapaddr),
  2841 + dma_unmap_len(e, maplen),
2842 2842 PCI_DMA_TODEVICE);
2843 2843 else
2844   - pci_unmap_page(pdev, pci_unmap_addr(e, mapaddr),
2845   - pci_unmap_len(e, maplen),
  2844 + pci_unmap_page(pdev, dma_unmap_addr(e, mapaddr),
  2845 + dma_unmap_len(e, maplen),
2846 2846 PCI_DMA_TODEVICE);
2847 2847  
2848 2848 if (control & BMU_EOF) {
2849 2849  
... ... @@ -3060,11 +3060,11 @@
3060 3060 goto resubmit;
3061 3061  
3062 3062 pci_dma_sync_single_for_cpu(skge->hw->pdev,
3063   - pci_unmap_addr(e, mapaddr),
  3063 + dma_unmap_addr(e, mapaddr),
3064 3064 len, PCI_DMA_FROMDEVICE);
3065 3065 skb_copy_from_linear_data(e->skb, skb->data, len);
3066 3066 pci_dma_sync_single_for_device(skge->hw->pdev,
3067   - pci_unmap_addr(e, mapaddr),
  3067 + dma_unmap_addr(e, mapaddr),
3068 3068 len, PCI_DMA_FROMDEVICE);
3069 3069 skge_rx_reuse(e, skge->rx_buf_size);
3070 3070 } else {
... ... @@ -3075,8 +3075,8 @@
3075 3075 goto resubmit;
3076 3076  
3077 3077 pci_unmap_single(skge->hw->pdev,
3078   - pci_unmap_addr(e, mapaddr),
3079   - pci_unmap_len(e, maplen),
  3078 + dma_unmap_addr(e, mapaddr),
  3079 + dma_unmap_len(e, maplen),
3080 3080 PCI_DMA_FROMDEVICE);
3081 3081 skb = e->skb;
3082 3082 prefetch(skb->data);
... ... @@ -2393,8 +2393,8 @@
2393 2393 struct skge_element *next;
2394 2394 void *desc;
2395 2395 struct sk_buff *skb;
2396   - DECLARE_PCI_UNMAP_ADDR(mapaddr);
2397   - DECLARE_PCI_UNMAP_LEN(maplen);
  2396 + DEFINE_DMA_UNMAP_ADDR(mapaddr);
  2397 + DEFINE_DMA_UNMAP_LEN(maplen);
2398 2398 };
2399 2399  
2400 2400 struct skge_ring {