aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorNick Nunley <nicholasx.d.nunley@intel.com>2010-04-27 09:10:27 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-27 19:29:52 -0400
commit1b507730b7a9dfc00142283d5f4fc24e6553f3f4 (patch)
treefa4ceb44de7348042c034cbf9312ec2bdd88dee6 /drivers/net/ixgbe
parent47631f854ff1938770f185afde4857018827eba3 (diff)
ixgbe: 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/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c42
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c77
2 files changed, 64 insertions, 55 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index dfbfe352004..dc7fd5b70bc 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1458,8 +1458,8 @@ static void ixgbe_free_desc_rings(struct ixgbe_adapter *adapter)
1458 struct ixgbe_tx_buffer *buf = 1458 struct ixgbe_tx_buffer *buf =
1459 &(tx_ring->tx_buffer_info[i]); 1459 &(tx_ring->tx_buffer_info[i]);
1460 if (buf->dma) 1460 if (buf->dma)
1461 pci_unmap_single(pdev, buf->dma, buf->length, 1461 dma_unmap_single(&pdev->dev, buf->dma,
1462 PCI_DMA_TODEVICE); 1462 buf->length, DMA_TO_DEVICE);
1463 if (buf->skb) 1463 if (buf->skb)
1464 dev_kfree_skb(buf->skb); 1464 dev_kfree_skb(buf->skb);
1465 } 1465 }
@@ -1470,22 +1470,22 @@ static void ixgbe_free_desc_rings(struct ixgbe_adapter *adapter)
1470 struct ixgbe_rx_buffer *buf = 1470 struct ixgbe_rx_buffer *buf =
1471 &(rx_ring->rx_buffer_info[i]); 1471 &(rx_ring->rx_buffer_info[i]);
1472 if (buf->dma) 1472 if (buf->dma)
1473 pci_unmap_single(pdev, buf->dma, 1473 dma_unmap_single(&pdev->dev, buf->dma,
1474 IXGBE_RXBUFFER_2048, 1474 IXGBE_RXBUFFER_2048,
1475 PCI_DMA_FROMDEVICE); 1475 DMA_FROM_DEVICE);
1476 if (buf->skb) 1476 if (buf->skb)
1477 dev_kfree_skb(buf->skb); 1477 dev_kfree_skb(buf->skb);
1478 } 1478 }
1479 } 1479 }
1480 1480
1481 if (tx_ring->desc) { 1481 if (tx_ring->desc) {
1482 pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, 1482 dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
1483 tx_ring->dma); 1483 tx_ring->dma);
1484 tx_ring->desc = NULL; 1484 tx_ring->desc = NULL;
1485 } 1485 }
1486 if (rx_ring->desc) { 1486 if (rx_ring->desc) {
1487 pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, 1487 dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
1488 rx_ring->dma); 1488 rx_ring->dma);
1489 rx_ring->desc = NULL; 1489 rx_ring->desc = NULL;
1490 } 1490 }
1491 1491
@@ -1520,8 +1520,9 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1520 1520
1521 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc); 1521 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
1522 tx_ring->size = ALIGN(tx_ring->size, 4096); 1522 tx_ring->size = ALIGN(tx_ring->size, 4096);
1523 if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size, 1523 tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size,
1524 &tx_ring->dma))) { 1524 &tx_ring->dma, GFP_KERNEL);
1525 if (!(tx_ring->desc)) {
1525 ret_val = 2; 1526 ret_val = 2;
1526 goto err_nomem; 1527 goto err_nomem;
1527 } 1528 }
@@ -1563,8 +1564,8 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1563 tx_ring->tx_buffer_info[i].skb = skb; 1564 tx_ring->tx_buffer_info[i].skb = skb;
1564 tx_ring->tx_buffer_info[i].length = skb->len; 1565 tx_ring->tx_buffer_info[i].length = skb->len;
1565 tx_ring->tx_buffer_info[i].dma = 1566 tx_ring->tx_buffer_info[i].dma =
1566 pci_map_single(pdev, skb->data, skb->len, 1567 dma_map_single(&pdev->dev, skb->data, skb->len,
1567 PCI_DMA_TODEVICE); 1568 DMA_TO_DEVICE);
1568 desc->read.buffer_addr = 1569 desc->read.buffer_addr =
1569 cpu_to_le64(tx_ring->tx_buffer_info[i].dma); 1570 cpu_to_le64(tx_ring->tx_buffer_info[i].dma);
1570 desc->read.cmd_type_len = cpu_to_le32(skb->len); 1571 desc->read.cmd_type_len = cpu_to_le32(skb->len);
@@ -1593,8 +1594,9 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1593 1594
1594 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc); 1595 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
1595 rx_ring->size = ALIGN(rx_ring->size, 4096); 1596 rx_ring->size = ALIGN(rx_ring->size, 4096);
1596 if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size, 1597 rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
1597 &rx_ring->dma))) { 1598 &rx_ring->dma, GFP_KERNEL);
1599 if (!(rx_ring->desc)) {
1598 ret_val = 5; 1600 ret_val = 5;
1599 goto err_nomem; 1601 goto err_nomem;
1600 } 1602 }
@@ -1661,8 +1663,8 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1661 skb_reserve(skb, NET_IP_ALIGN); 1663 skb_reserve(skb, NET_IP_ALIGN);
1662 rx_ring->rx_buffer_info[i].skb = skb; 1664 rx_ring->rx_buffer_info[i].skb = skb;
1663 rx_ring->rx_buffer_info[i].dma = 1665 rx_ring->rx_buffer_info[i].dma =
1664 pci_map_single(pdev, skb->data, IXGBE_RXBUFFER_2048, 1666 dma_map_single(&pdev->dev, skb->data,
1665 PCI_DMA_FROMDEVICE); 1667 IXGBE_RXBUFFER_2048, DMA_FROM_DEVICE);
1666 rx_desc->read.pkt_addr = 1668 rx_desc->read.pkt_addr =
1667 cpu_to_le64(rx_ring->rx_buffer_info[i].dma); 1669 cpu_to_le64(rx_ring->rx_buffer_info[i].dma);
1668 memset(skb->data, 0x00, skb->len); 1670 memset(skb->data, 0x00, skb->len);
@@ -1775,10 +1777,10 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter)
1775 ixgbe_create_lbtest_frame( 1777 ixgbe_create_lbtest_frame(
1776 tx_ring->tx_buffer_info[k].skb, 1778 tx_ring->tx_buffer_info[k].skb,
1777 1024); 1779 1024);
1778 pci_dma_sync_single_for_device(pdev, 1780 dma_sync_single_for_device(&pdev->dev,
1779 tx_ring->tx_buffer_info[k].dma, 1781 tx_ring->tx_buffer_info[k].dma,
1780 tx_ring->tx_buffer_info[k].length, 1782 tx_ring->tx_buffer_info[k].length,
1781 PCI_DMA_TODEVICE); 1783 DMA_TO_DEVICE);
1782 if (unlikely(++k == tx_ring->count)) 1784 if (unlikely(++k == tx_ring->count))
1783 k = 0; 1785 k = 0;
1784 } 1786 }
@@ -1789,10 +1791,10 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter)
1789 good_cnt = 0; 1791 good_cnt = 0;
1790 do { 1792 do {
1791 /* receive the sent packets */ 1793 /* receive the sent packets */
1792 pci_dma_sync_single_for_cpu(pdev, 1794 dma_sync_single_for_cpu(&pdev->dev,
1793 rx_ring->rx_buffer_info[l].dma, 1795 rx_ring->rx_buffer_info[l].dma,
1794 IXGBE_RXBUFFER_2048, 1796 IXGBE_RXBUFFER_2048,
1795 PCI_DMA_FROMDEVICE); 1797 DMA_FROM_DEVICE);
1796 ret_val = ixgbe_check_lbtest_frame( 1798 ret_val = ixgbe_check_lbtest_frame(
1797 rx_ring->rx_buffer_info[l].skb, 1024); 1799 rx_ring->rx_buffer_info[l].skb, 1024);
1798 if (!ret_val) 1800 if (!ret_val)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 5258b3d6405..7724fb2e891 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -266,15 +266,15 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter,
266{ 266{
267 if (tx_buffer_info->dma) { 267 if (tx_buffer_info->dma) {
268 if (tx_buffer_info->mapped_as_page) 268 if (tx_buffer_info->mapped_as_page)
269 pci_unmap_page(adapter->pdev, 269 dma_unmap_page(&adapter->pdev->dev,
270 tx_buffer_info->dma, 270 tx_buffer_info->dma,
271 tx_buffer_info->length, 271 tx_buffer_info->length,
272 PCI_DMA_TODEVICE); 272 DMA_TO_DEVICE);
273 else 273 else
274 pci_unmap_single(adapter->pdev, 274 dma_unmap_single(&adapter->pdev->dev,
275 tx_buffer_info->dma, 275 tx_buffer_info->dma,
276 tx_buffer_info->length, 276 tx_buffer_info->length,
277 PCI_DMA_TODEVICE); 277 DMA_TO_DEVICE);
278 tx_buffer_info->dma = 0; 278 tx_buffer_info->dma = 0;
279 } 279 }
280 if (tx_buffer_info->skb) { 280 if (tx_buffer_info->skb) {
@@ -721,10 +721,10 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
721 bi->page_offset ^= (PAGE_SIZE / 2); 721 bi->page_offset ^= (PAGE_SIZE / 2);
722 } 722 }
723 723
724 bi->page_dma = pci_map_page(pdev, bi->page, 724 bi->page_dma = dma_map_page(&pdev->dev, bi->page,
725 bi->page_offset, 725 bi->page_offset,
726 (PAGE_SIZE / 2), 726 (PAGE_SIZE / 2),
727 PCI_DMA_FROMDEVICE); 727 DMA_FROM_DEVICE);
728 } 728 }
729 729
730 if (!bi->skb) { 730 if (!bi->skb) {
@@ -743,9 +743,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
743 - skb->data)); 743 - skb->data));
744 744
745 bi->skb = skb; 745 bi->skb = skb;
746 bi->dma = pci_map_single(pdev, skb->data, 746 bi->dma = dma_map_single(&pdev->dev, skb->data,
747 rx_ring->rx_buf_len, 747 rx_ring->rx_buf_len,
748 PCI_DMA_FROMDEVICE); 748 DMA_FROM_DEVICE);
749 } 749 }
750 /* Refresh the desc even if buffer_addrs didn't change because 750 /* Refresh the desc even if buffer_addrs didn't change because
751 * each write-back erases this info. */ 751 * each write-back erases this info. */
@@ -886,16 +886,17 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
886 */ 886 */
887 IXGBE_RSC_CB(skb)->dma = rx_buffer_info->dma; 887 IXGBE_RSC_CB(skb)->dma = rx_buffer_info->dma;
888 else 888 else
889 pci_unmap_single(pdev, rx_buffer_info->dma, 889 dma_unmap_single(&pdev->dev,
890 rx_buffer_info->dma,
890 rx_ring->rx_buf_len, 891 rx_ring->rx_buf_len,
891 PCI_DMA_FROMDEVICE); 892 DMA_FROM_DEVICE);
892 rx_buffer_info->dma = 0; 893 rx_buffer_info->dma = 0;
893 skb_put(skb, len); 894 skb_put(skb, len);
894 } 895 }
895 896
896 if (upper_len) { 897 if (upper_len) {
897 pci_unmap_page(pdev, rx_buffer_info->page_dma, 898 dma_unmap_page(&pdev->dev, rx_buffer_info->page_dma,
898 PAGE_SIZE / 2, PCI_DMA_FROMDEVICE); 899 PAGE_SIZE / 2, DMA_FROM_DEVICE);
899 rx_buffer_info->page_dma = 0; 900 rx_buffer_info->page_dma = 0;
900 skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, 901 skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
901 rx_buffer_info->page, 902 rx_buffer_info->page,
@@ -937,9 +938,10 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
937 skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); 938 skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count));
938 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { 939 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
939 if (IXGBE_RSC_CB(skb)->dma) { 940 if (IXGBE_RSC_CB(skb)->dma) {
940 pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, 941 dma_unmap_single(&pdev->dev,
942 IXGBE_RSC_CB(skb)->dma,
941 rx_ring->rx_buf_len, 943 rx_ring->rx_buf_len,
942 PCI_DMA_FROMDEVICE); 944 DMA_FROM_DEVICE);
943 IXGBE_RSC_CB(skb)->dma = 0; 945 IXGBE_RSC_CB(skb)->dma = 0;
944 } 946 }
945 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) 947 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)
@@ -3154,9 +3156,9 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter,
3154 3156
3155 rx_buffer_info = &rx_ring->rx_buffer_info[i]; 3157 rx_buffer_info = &rx_ring->rx_buffer_info[i];
3156 if (rx_buffer_info->dma) { 3158 if (rx_buffer_info->dma) {
3157 pci_unmap_single(pdev, rx_buffer_info->dma, 3159 dma_unmap_single(&pdev->dev, rx_buffer_info->dma,
3158 rx_ring->rx_buf_len, 3160 rx_ring->rx_buf_len,
3159 PCI_DMA_FROMDEVICE); 3161 DMA_FROM_DEVICE);
3160 rx_buffer_info->dma = 0; 3162 rx_buffer_info->dma = 0;
3161 } 3163 }
3162 if (rx_buffer_info->skb) { 3164 if (rx_buffer_info->skb) {
@@ -3165,9 +3167,10 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter,
3165 do { 3167 do {
3166 struct sk_buff *this = skb; 3168 struct sk_buff *this = skb;
3167 if (IXGBE_RSC_CB(this)->dma) { 3169 if (IXGBE_RSC_CB(this)->dma) {
3168 pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, 3170 dma_unmap_single(&pdev->dev,
3171 IXGBE_RSC_CB(this)->dma,
3169 rx_ring->rx_buf_len, 3172 rx_ring->rx_buf_len,
3170 PCI_DMA_FROMDEVICE); 3173 DMA_FROM_DEVICE);
3171 IXGBE_RSC_CB(this)->dma = 0; 3174 IXGBE_RSC_CB(this)->dma = 0;
3172 } 3175 }
3173 skb = skb->prev; 3176 skb = skb->prev;
@@ -3177,8 +3180,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter,
3177 if (!rx_buffer_info->page) 3180 if (!rx_buffer_info->page)
3178 continue; 3181 continue;
3179 if (rx_buffer_info->page_dma) { 3182 if (rx_buffer_info->page_dma) {
3180 pci_unmap_page(pdev, rx_buffer_info->page_dma, 3183 dma_unmap_page(&pdev->dev, rx_buffer_info->page_dma,
3181 PAGE_SIZE / 2, PCI_DMA_FROMDEVICE); 3184 PAGE_SIZE / 2, DMA_FROM_DEVICE);
3182 rx_buffer_info->page_dma = 0; 3185 rx_buffer_info->page_dma = 0;
3183 } 3186 }
3184 put_page(rx_buffer_info->page); 3187 put_page(rx_buffer_info->page);
@@ -4403,8 +4406,8 @@ int ixgbe_setup_tx_resources(struct ixgbe_adapter *adapter,
4403 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc); 4406 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
4404 tx_ring->size = ALIGN(tx_ring->size, 4096); 4407 tx_ring->size = ALIGN(tx_ring->size, 4096);
4405 4408
4406 tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size, 4409 tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size,
4407 &tx_ring->dma); 4410 &tx_ring->dma, GFP_KERNEL);
4408 if (!tx_ring->desc) 4411 if (!tx_ring->desc)
4409 goto err; 4412 goto err;
4410 4413
@@ -4474,7 +4477,8 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
4474 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc); 4477 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
4475 rx_ring->size = ALIGN(rx_ring->size, 4096); 4478 rx_ring->size = ALIGN(rx_ring->size, 4096);
4476 4479
4477 rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size, &rx_ring->dma); 4480 rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
4481 &rx_ring->dma, GFP_KERNEL);
4478 4482
4479 if (!rx_ring->desc) { 4483 if (!rx_ring->desc) {
4480 DPRINTK(PROBE, ERR, 4484 DPRINTK(PROBE, ERR,
@@ -4535,7 +4539,8 @@ void ixgbe_free_tx_resources(struct ixgbe_adapter *adapter,
4535 vfree(tx_ring->tx_buffer_info); 4539 vfree(tx_ring->tx_buffer_info);
4536 tx_ring->tx_buffer_info = NULL; 4540 tx_ring->tx_buffer_info = NULL;
4537 4541
4538 pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma); 4542 dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
4543 tx_ring->dma);
4539 4544
4540 tx_ring->desc = NULL; 4545 tx_ring->desc = NULL;
4541} 4546}
@@ -4572,7 +4577,8 @@ void ixgbe_free_rx_resources(struct ixgbe_adapter *adapter,
4572 vfree(rx_ring->rx_buffer_info); 4577 vfree(rx_ring->rx_buffer_info);
4573 rx_ring->rx_buffer_info = NULL; 4578 rx_ring->rx_buffer_info = NULL;
4574 4579
4575 pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma); 4580 dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
4581 rx_ring->dma);
4576 4582
4577 rx_ring->desc = NULL; 4583 rx_ring->desc = NULL;
4578} 4584}
@@ -5442,10 +5448,10 @@ static int ixgbe_tx_map(struct ixgbe_adapter *adapter,
5442 5448
5443 tx_buffer_info->length = size; 5449 tx_buffer_info->length = size;
5444 tx_buffer_info->mapped_as_page = false; 5450 tx_buffer_info->mapped_as_page = false;
5445 tx_buffer_info->dma = pci_map_single(pdev, 5451 tx_buffer_info->dma = dma_map_single(&pdev->dev,
5446 skb->data + offset, 5452 skb->data + offset,
5447 size, PCI_DMA_TODEVICE); 5453 size, DMA_TO_DEVICE);
5448 if (pci_dma_mapping_error(pdev, tx_buffer_info->dma)) 5454 if (dma_mapping_error(&pdev->dev, tx_buffer_info->dma))
5449 goto dma_error; 5455 goto dma_error;
5450 tx_buffer_info->time_stamp = jiffies; 5456 tx_buffer_info->time_stamp = jiffies;
5451 tx_buffer_info->next_to_watch = i; 5457 tx_buffer_info->next_to_watch = i;
@@ -5478,12 +5484,12 @@ static int ixgbe_tx_map(struct ixgbe_adapter *adapter,
5478 size = min(len, (uint)IXGBE_MAX_DATA_PER_TXD); 5484 size = min(len, (uint)IXGBE_MAX_DATA_PER_TXD);
5479 5485
5480 tx_buffer_info->length = size; 5486 tx_buffer_info->length = size;
5481 tx_buffer_info->dma = pci_map_page(adapter->pdev, 5487 tx_buffer_info->dma = dma_map_page(&adapter->pdev->dev,
5482 frag->page, 5488 frag->page,
5483 offset, size, 5489 offset, size,
5484 PCI_DMA_TODEVICE); 5490 DMA_TO_DEVICE);
5485 tx_buffer_info->mapped_as_page = true; 5491 tx_buffer_info->mapped_as_page = true;
5486 if (pci_dma_mapping_error(pdev, tx_buffer_info->dma)) 5492 if (dma_mapping_error(&pdev->dev, tx_buffer_info->dma))
5487 goto dma_error; 5493 goto dma_error;
5488 tx_buffer_info->time_stamp = jiffies; 5494 tx_buffer_info->time_stamp = jiffies;
5489 tx_buffer_info->next_to_watch = i; 5495 tx_buffer_info->next_to_watch = i;
@@ -6061,13 +6067,14 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
6061 if (err) 6067 if (err)
6062 return err; 6068 return err;
6063 6069
6064 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && 6070 if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
6065 !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { 6071 !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
6066 pci_using_dac = 1; 6072 pci_using_dac = 1;
6067 } else { 6073 } else {
6068 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 6074 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
6069 if (err) { 6075 if (err) {
6070 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 6076 err = dma_set_coherent_mask(&pdev->dev,
6077 DMA_BIT_MASK(32));
6071 if (err) { 6078 if (err) {
6072 dev_err(&pdev->dev, "No usable DMA " 6079 dev_err(&pdev->dev, "No usable DMA "
6073 "configuration, aborting\n"); 6080 "configuration, aborting\n");