diff options
author | Nick Nunley <nicholasx.d.nunley@intel.com> | 2010-04-27 09:09:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 19:29:50 -0400 |
commit | 0be3f55f8aa5f9d1882255128bd79d4885b0cbe4 (patch) | |
tree | a8e5239ba790ec5f2b1b42d638edd20ba4acbd5e /drivers/net/e1000e/ethtool.c | |
parent | b16f53bef9be0a756a0672e27d0a526686040e02 (diff) |
e1000e: use DMA API instead of PCI DMA functions
Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 983493f2330c..7f9915cf2a59 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -1069,10 +1069,10 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1069 | if (tx_ring->desc && tx_ring->buffer_info) { | 1069 | if (tx_ring->desc && tx_ring->buffer_info) { |
1070 | for (i = 0; i < tx_ring->count; i++) { | 1070 | for (i = 0; i < tx_ring->count; i++) { |
1071 | if (tx_ring->buffer_info[i].dma) | 1071 | if (tx_ring->buffer_info[i].dma) |
1072 | pci_unmap_single(pdev, | 1072 | dma_unmap_single(&pdev->dev, |
1073 | tx_ring->buffer_info[i].dma, | 1073 | tx_ring->buffer_info[i].dma, |
1074 | tx_ring->buffer_info[i].length, | 1074 | tx_ring->buffer_info[i].length, |
1075 | PCI_DMA_TODEVICE); | 1075 | DMA_TO_DEVICE); |
1076 | if (tx_ring->buffer_info[i].skb) | 1076 | if (tx_ring->buffer_info[i].skb) |
1077 | dev_kfree_skb(tx_ring->buffer_info[i].skb); | 1077 | dev_kfree_skb(tx_ring->buffer_info[i].skb); |
1078 | } | 1078 | } |
@@ -1081,9 +1081,9 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1081 | if (rx_ring->desc && rx_ring->buffer_info) { | 1081 | if (rx_ring->desc && rx_ring->buffer_info) { |
1082 | for (i = 0; i < rx_ring->count; i++) { | 1082 | for (i = 0; i < rx_ring->count; i++) { |
1083 | if (rx_ring->buffer_info[i].dma) | 1083 | if (rx_ring->buffer_info[i].dma) |
1084 | pci_unmap_single(pdev, | 1084 | dma_unmap_single(&pdev->dev, |
1085 | rx_ring->buffer_info[i].dma, | 1085 | rx_ring->buffer_info[i].dma, |
1086 | 2048, PCI_DMA_FROMDEVICE); | 1086 | 2048, DMA_FROM_DEVICE); |
1087 | if (rx_ring->buffer_info[i].skb) | 1087 | if (rx_ring->buffer_info[i].skb) |
1088 | dev_kfree_skb(rx_ring->buffer_info[i].skb); | 1088 | dev_kfree_skb(rx_ring->buffer_info[i].skb); |
1089 | } | 1089 | } |
@@ -1163,9 +1163,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1163 | tx_ring->buffer_info[i].skb = skb; | 1163 | tx_ring->buffer_info[i].skb = skb; |
1164 | tx_ring->buffer_info[i].length = skb->len; | 1164 | tx_ring->buffer_info[i].length = skb->len; |
1165 | tx_ring->buffer_info[i].dma = | 1165 | tx_ring->buffer_info[i].dma = |
1166 | pci_map_single(pdev, skb->data, skb->len, | 1166 | dma_map_single(&pdev->dev, skb->data, skb->len, |
1167 | PCI_DMA_TODEVICE); | 1167 | DMA_TO_DEVICE); |
1168 | if (pci_dma_mapping_error(pdev, tx_ring->buffer_info[i].dma)) { | 1168 | if (dma_mapping_error(&pdev->dev, |
1169 | tx_ring->buffer_info[i].dma)) { | ||
1169 | ret_val = 4; | 1170 | ret_val = 4; |
1170 | goto err_nomem; | 1171 | goto err_nomem; |
1171 | } | 1172 | } |
@@ -1226,9 +1227,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1226 | skb_reserve(skb, NET_IP_ALIGN); | 1227 | skb_reserve(skb, NET_IP_ALIGN); |
1227 | rx_ring->buffer_info[i].skb = skb; | 1228 | rx_ring->buffer_info[i].skb = skb; |
1228 | rx_ring->buffer_info[i].dma = | 1229 | rx_ring->buffer_info[i].dma = |
1229 | pci_map_single(pdev, skb->data, 2048, | 1230 | dma_map_single(&pdev->dev, skb->data, 2048, |
1230 | PCI_DMA_FROMDEVICE); | 1231 | DMA_FROM_DEVICE); |
1231 | if (pci_dma_mapping_error(pdev, rx_ring->buffer_info[i].dma)) { | 1232 | if (dma_mapping_error(&pdev->dev, |
1233 | rx_ring->buffer_info[i].dma)) { | ||
1232 | ret_val = 8; | 1234 | ret_val = 8; |
1233 | goto err_nomem; | 1235 | goto err_nomem; |
1234 | } | 1236 | } |
@@ -1556,10 +1558,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1556 | for (i = 0; i < 64; i++) { /* send the packets */ | 1558 | for (i = 0; i < 64; i++) { /* send the packets */ |
1557 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, | 1559 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, |
1558 | 1024); | 1560 | 1024); |
1559 | pci_dma_sync_single_for_device(pdev, | 1561 | dma_sync_single_for_device(&pdev->dev, |
1560 | tx_ring->buffer_info[k].dma, | 1562 | tx_ring->buffer_info[k].dma, |
1561 | tx_ring->buffer_info[k].length, | 1563 | tx_ring->buffer_info[k].length, |
1562 | PCI_DMA_TODEVICE); | 1564 | DMA_TO_DEVICE); |
1563 | k++; | 1565 | k++; |
1564 | if (k == tx_ring->count) | 1566 | if (k == tx_ring->count) |
1565 | k = 0; | 1567 | k = 0; |
@@ -1569,9 +1571,9 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1569 | time = jiffies; /* set the start time for the receive */ | 1571 | time = jiffies; /* set the start time for the receive */ |
1570 | good_cnt = 0; | 1572 | good_cnt = 0; |
1571 | do { /* receive the sent packets */ | 1573 | do { /* receive the sent packets */ |
1572 | pci_dma_sync_single_for_cpu(pdev, | 1574 | dma_sync_single_for_cpu(&pdev->dev, |
1573 | rx_ring->buffer_info[l].dma, 2048, | 1575 | rx_ring->buffer_info[l].dma, 2048, |
1574 | PCI_DMA_FROMDEVICE); | 1576 | DMA_FROM_DEVICE); |
1575 | 1577 | ||
1576 | ret_val = e1000_check_lbtest_frame( | 1578 | ret_val = e1000_check_lbtest_frame( |
1577 | rx_ring->buffer_info[l].skb, 1024); | 1579 | rx_ring->buffer_info[l].skb, 1024); |