aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/8139cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/8139cp.c')
-rw-r--r--drivers/net/8139cp.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 7f18ca23d9f8..2dec3d6ae01a 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -562,7 +562,7 @@ rx_status_loop:
562 562
563 skb_reserve(new_skb, RX_OFFSET); 563 skb_reserve(new_skb, RX_OFFSET);
564 564
565 pci_unmap_single(cp->pdev, mapping, 565 dma_unmap_single(&cp->pdev->dev, mapping,
566 buflen, PCI_DMA_FROMDEVICE); 566 buflen, PCI_DMA_FROMDEVICE);
567 567
568 /* Handle checksum offloading for incoming packets. */ 568 /* Handle checksum offloading for incoming packets. */
@@ -573,7 +573,7 @@ rx_status_loop:
573 573
574 skb_put(skb, len); 574 skb_put(skb, len);
575 575
576 mapping = pci_map_single(cp->pdev, new_skb->data, buflen, 576 mapping = dma_map_single(&cp->pdev->dev, new_skb->data, buflen,
577 PCI_DMA_FROMDEVICE); 577 PCI_DMA_FROMDEVICE);
578 cp->rx_skb[rx_tail] = new_skb; 578 cp->rx_skb[rx_tail] = new_skb;
579 579
@@ -701,7 +701,7 @@ static void cp_tx (struct cp_private *cp)
701 skb = cp->tx_skb[tx_tail]; 701 skb = cp->tx_skb[tx_tail];
702 BUG_ON(!skb); 702 BUG_ON(!skb);
703 703
704 pci_unmap_single(cp->pdev, le64_to_cpu(txd->addr), 704 dma_unmap_single(&cp->pdev->dev, le64_to_cpu(txd->addr),
705 le32_to_cpu(txd->opts1) & 0xffff, 705 le32_to_cpu(txd->opts1) & 0xffff,
706 PCI_DMA_TODEVICE); 706 PCI_DMA_TODEVICE);
707 707
@@ -779,7 +779,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
779 dma_addr_t mapping; 779 dma_addr_t mapping;
780 780
781 len = skb->len; 781 len = skb->len;
782 mapping = pci_map_single(cp->pdev, skb->data, len, PCI_DMA_TODEVICE); 782 mapping = dma_map_single(&cp->pdev->dev, skb->data, len, PCI_DMA_TODEVICE);
783 CP_VLAN_TX_TAG(txd, vlan_tag); 783 CP_VLAN_TX_TAG(txd, vlan_tag);
784 txd->addr = cpu_to_le64(mapping); 784 txd->addr = cpu_to_le64(mapping);
785 wmb(); 785 wmb();
@@ -815,7 +815,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
815 */ 815 */
816 first_eor = eor; 816 first_eor = eor;
817 first_len = skb_headlen(skb); 817 first_len = skb_headlen(skb);
818 first_mapping = pci_map_single(cp->pdev, skb->data, 818 first_mapping = dma_map_single(&cp->pdev->dev, skb->data,
819 first_len, PCI_DMA_TODEVICE); 819 first_len, PCI_DMA_TODEVICE);
820 cp->tx_skb[entry] = skb; 820 cp->tx_skb[entry] = skb;
821 entry = NEXT_TX(entry); 821 entry = NEXT_TX(entry);
@@ -827,7 +827,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
827 dma_addr_t mapping; 827 dma_addr_t mapping;
828 828
829 len = this_frag->size; 829 len = this_frag->size;
830 mapping = pci_map_single(cp->pdev, 830 mapping = dma_map_single(&cp->pdev->dev,
831 ((void *) page_address(this_frag->page) + 831 ((void *) page_address(this_frag->page) +
832 this_frag->page_offset), 832 this_frag->page_offset),
833 len, PCI_DMA_TODEVICE); 833 len, PCI_DMA_TODEVICE);
@@ -1066,8 +1066,8 @@ static int cp_refill_rx (struct cp_private *cp)
1066 1066
1067 skb_reserve(skb, RX_OFFSET); 1067 skb_reserve(skb, RX_OFFSET);
1068 1068
1069 mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz, 1069 mapping = dma_map_single(&cp->pdev->dev, skb->data,
1070 PCI_DMA_FROMDEVICE); 1070 cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1071 cp->rx_skb[i] = skb; 1071 cp->rx_skb[i] = skb;
1072 1072
1073 cp->rx_ring[i].opts2 = 0; 1073 cp->rx_ring[i].opts2 = 0;
@@ -1107,7 +1107,8 @@ static int cp_alloc_rings (struct cp_private *cp)
1107{ 1107{
1108 void *mem; 1108 void *mem;
1109 1109
1110 mem = pci_alloc_consistent(cp->pdev, CP_RING_BYTES, &cp->ring_dma); 1110 mem = dma_alloc_coherent(&cp->pdev->dev, CP_RING_BYTES,
1111 &cp->ring_dma, GFP_KERNEL);
1111 if (!mem) 1112 if (!mem)
1112 return -ENOMEM; 1113 return -ENOMEM;
1113 1114
@@ -1125,7 +1126,7 @@ static void cp_clean_rings (struct cp_private *cp)
1125 for (i = 0; i < CP_RX_RING_SIZE; i++) { 1126 for (i = 0; i < CP_RX_RING_SIZE; i++) {
1126 if (cp->rx_skb[i]) { 1127 if (cp->rx_skb[i]) {
1127 desc = cp->rx_ring + i; 1128 desc = cp->rx_ring + i;
1128 pci_unmap_single(cp->pdev, le64_to_cpu(desc->addr), 1129 dma_unmap_single(&cp->pdev->dev,le64_to_cpu(desc->addr),
1129 cp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1130 cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1130 dev_kfree_skb(cp->rx_skb[i]); 1131 dev_kfree_skb(cp->rx_skb[i]);
1131 } 1132 }
@@ -1136,7 +1137,7 @@ static void cp_clean_rings (struct cp_private *cp)
1136 struct sk_buff *skb = cp->tx_skb[i]; 1137 struct sk_buff *skb = cp->tx_skb[i];
1137 1138
1138 desc = cp->tx_ring + i; 1139 desc = cp->tx_ring + i;
1139 pci_unmap_single(cp->pdev, le64_to_cpu(desc->addr), 1140 dma_unmap_single(&cp->pdev->dev,le64_to_cpu(desc->addr),
1140 le32_to_cpu(desc->opts1) & 0xffff, 1141 le32_to_cpu(desc->opts1) & 0xffff,
1141 PCI_DMA_TODEVICE); 1142 PCI_DMA_TODEVICE);
1142 if (le32_to_cpu(desc->opts1) & LastFrag) 1143 if (le32_to_cpu(desc->opts1) & LastFrag)
@@ -1155,7 +1156,8 @@ static void cp_clean_rings (struct cp_private *cp)
1155static void cp_free_rings (struct cp_private *cp) 1156static void cp_free_rings (struct cp_private *cp)
1156{ 1157{
1157 cp_clean_rings(cp); 1158 cp_clean_rings(cp);
1158 pci_free_consistent(cp->pdev, CP_RING_BYTES, cp->rx_ring, cp->ring_dma); 1159 dma_free_coherent(&cp->pdev->dev, CP_RING_BYTES, cp->rx_ring,
1160 cp->ring_dma);
1159 cp->rx_ring = NULL; 1161 cp->rx_ring = NULL;
1160 cp->tx_ring = NULL; 1162 cp->tx_ring = NULL;
1161} 1163}
@@ -1519,7 +1521,8 @@ static void cp_get_ethtool_stats (struct net_device *dev,
1519 dma_addr_t dma; 1521 dma_addr_t dma;
1520 int i; 1522 int i;
1521 1523
1522 nic_stats = pci_alloc_consistent(cp->pdev, sizeof(*nic_stats), &dma); 1524 nic_stats = dma_alloc_coherent(&cp->pdev->dev, sizeof(*nic_stats),
1525 &dma, GFP_KERNEL);
1523 if (!nic_stats) 1526 if (!nic_stats)
1524 return; 1527 return;
1525 1528
@@ -1554,7 +1557,7 @@ static void cp_get_ethtool_stats (struct net_device *dev,
1554 tmp_stats[i++] = cp->cp_stats.rx_frags; 1557 tmp_stats[i++] = cp->cp_stats.rx_frags;
1555 BUG_ON(i != CP_NUM_STATS); 1558 BUG_ON(i != CP_NUM_STATS);
1556 1559
1557 pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma); 1560 dma_free_coherent(&cp->pdev->dev, sizeof(*nic_stats), nic_stats, dma);
1558} 1561}
1559 1562
1560static const struct ethtool_ops cp_ethtool_ops = { 1563static const struct ethtool_ops cp_ethtool_ops = {