diff options
Diffstat (limited to 'drivers/net/acenic.c')
-rw-r--r-- | drivers/net/acenic.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 4ae750ef1e10..2dc5f9544c77 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -660,7 +660,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
660 | dma_addr_t mapping; | 660 | dma_addr_t mapping; |
661 | 661 | ||
662 | ringp = &ap->skb->rx_std_skbuff[i]; | 662 | ringp = &ap->skb->rx_std_skbuff[i]; |
663 | mapping = pci_unmap_addr(ringp, mapping); | 663 | mapping = dma_unmap_addr(ringp, mapping); |
664 | pci_unmap_page(ap->pdev, mapping, | 664 | pci_unmap_page(ap->pdev, mapping, |
665 | ACE_STD_BUFSIZE, | 665 | ACE_STD_BUFSIZE, |
666 | PCI_DMA_FROMDEVICE); | 666 | PCI_DMA_FROMDEVICE); |
@@ -680,7 +680,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
680 | dma_addr_t mapping; | 680 | dma_addr_t mapping; |
681 | 681 | ||
682 | ringp = &ap->skb->rx_mini_skbuff[i]; | 682 | ringp = &ap->skb->rx_mini_skbuff[i]; |
683 | mapping = pci_unmap_addr(ringp,mapping); | 683 | mapping = dma_unmap_addr(ringp,mapping); |
684 | pci_unmap_page(ap->pdev, mapping, | 684 | pci_unmap_page(ap->pdev, mapping, |
685 | ACE_MINI_BUFSIZE, | 685 | ACE_MINI_BUFSIZE, |
686 | PCI_DMA_FROMDEVICE); | 686 | PCI_DMA_FROMDEVICE); |
@@ -699,7 +699,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) | |||
699 | dma_addr_t mapping; | 699 | dma_addr_t mapping; |
700 | 700 | ||
701 | ringp = &ap->skb->rx_jumbo_skbuff[i]; | 701 | ringp = &ap->skb->rx_jumbo_skbuff[i]; |
702 | mapping = pci_unmap_addr(ringp, mapping); | 702 | mapping = dma_unmap_addr(ringp, mapping); |
703 | pci_unmap_page(ap->pdev, mapping, | 703 | pci_unmap_page(ap->pdev, mapping, |
704 | ACE_JUMBO_BUFSIZE, | 704 | ACE_JUMBO_BUFSIZE, |
705 | PCI_DMA_FROMDEVICE); | 705 | PCI_DMA_FROMDEVICE); |
@@ -1682,7 +1682,7 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1682 | ACE_STD_BUFSIZE, | 1682 | ACE_STD_BUFSIZE, |
1683 | PCI_DMA_FROMDEVICE); | 1683 | PCI_DMA_FROMDEVICE); |
1684 | ap->skb->rx_std_skbuff[idx].skb = skb; | 1684 | ap->skb->rx_std_skbuff[idx].skb = skb; |
1685 | pci_unmap_addr_set(&ap->skb->rx_std_skbuff[idx], | 1685 | dma_unmap_addr_set(&ap->skb->rx_std_skbuff[idx], |
1686 | mapping, mapping); | 1686 | mapping, mapping); |
1687 | 1687 | ||
1688 | rd = &ap->rx_std_ring[idx]; | 1688 | rd = &ap->rx_std_ring[idx]; |
@@ -1743,7 +1743,7 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1743 | ACE_MINI_BUFSIZE, | 1743 | ACE_MINI_BUFSIZE, |
1744 | PCI_DMA_FROMDEVICE); | 1744 | PCI_DMA_FROMDEVICE); |
1745 | ap->skb->rx_mini_skbuff[idx].skb = skb; | 1745 | ap->skb->rx_mini_skbuff[idx].skb = skb; |
1746 | pci_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx], | 1746 | dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx], |
1747 | mapping, mapping); | 1747 | mapping, mapping); |
1748 | 1748 | ||
1749 | rd = &ap->rx_mini_ring[idx]; | 1749 | rd = &ap->rx_mini_ring[idx]; |
@@ -1799,7 +1799,7 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1799 | ACE_JUMBO_BUFSIZE, | 1799 | ACE_JUMBO_BUFSIZE, |
1800 | PCI_DMA_FROMDEVICE); | 1800 | PCI_DMA_FROMDEVICE); |
1801 | ap->skb->rx_jumbo_skbuff[idx].skb = skb; | 1801 | ap->skb->rx_jumbo_skbuff[idx].skb = skb; |
1802 | pci_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx], | 1802 | dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx], |
1803 | mapping, mapping); | 1803 | mapping, mapping); |
1804 | 1804 | ||
1805 | rd = &ap->rx_jumbo_ring[idx]; | 1805 | rd = &ap->rx_jumbo_ring[idx]; |
@@ -2012,7 +2012,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) | |||
2012 | skb = rip->skb; | 2012 | skb = rip->skb; |
2013 | rip->skb = NULL; | 2013 | rip->skb = NULL; |
2014 | pci_unmap_page(ap->pdev, | 2014 | pci_unmap_page(ap->pdev, |
2015 | pci_unmap_addr(rip, mapping), | 2015 | dma_unmap_addr(rip, mapping), |
2016 | mapsize, | 2016 | mapsize, |
2017 | PCI_DMA_FROMDEVICE); | 2017 | PCI_DMA_FROMDEVICE); |
2018 | skb_put(skb, retdesc->size); | 2018 | skb_put(skb, retdesc->size); |
@@ -2077,18 +2077,16 @@ static inline void ace_tx_int(struct net_device *dev, | |||
2077 | 2077 | ||
2078 | do { | 2078 | do { |
2079 | struct sk_buff *skb; | 2079 | struct sk_buff *skb; |
2080 | dma_addr_t mapping; | ||
2081 | struct tx_ring_info *info; | 2080 | struct tx_ring_info *info; |
2082 | 2081 | ||
2083 | info = ap->skb->tx_skbuff + idx; | 2082 | info = ap->skb->tx_skbuff + idx; |
2084 | skb = info->skb; | 2083 | skb = info->skb; |
2085 | mapping = pci_unmap_addr(info, mapping); | ||
2086 | 2084 | ||
2087 | if (mapping) { | 2085 | if (dma_unmap_len(info, maplen)) { |
2088 | pci_unmap_page(ap->pdev, mapping, | 2086 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), |
2089 | pci_unmap_len(info, maplen), | 2087 | dma_unmap_len(info, maplen), |
2090 | PCI_DMA_TODEVICE); | 2088 | PCI_DMA_TODEVICE); |
2091 | pci_unmap_addr_set(info, mapping, 0); | 2089 | dma_unmap_len_set(info, maplen, 0); |
2092 | } | 2090 | } |
2093 | 2091 | ||
2094 | if (skb) { | 2092 | if (skb) { |
@@ -2376,14 +2374,12 @@ static int ace_close(struct net_device *dev) | |||
2376 | 2374 | ||
2377 | for (i = 0; i < ACE_TX_RING_ENTRIES(ap); i++) { | 2375 | for (i = 0; i < ACE_TX_RING_ENTRIES(ap); i++) { |
2378 | struct sk_buff *skb; | 2376 | struct sk_buff *skb; |
2379 | dma_addr_t mapping; | ||
2380 | struct tx_ring_info *info; | 2377 | struct tx_ring_info *info; |
2381 | 2378 | ||
2382 | info = ap->skb->tx_skbuff + i; | 2379 | info = ap->skb->tx_skbuff + i; |
2383 | skb = info->skb; | 2380 | skb = info->skb; |
2384 | mapping = pci_unmap_addr(info, mapping); | ||
2385 | 2381 | ||
2386 | if (mapping) { | 2382 | if (dma_unmap_len(info, maplen)) { |
2387 | if (ACE_IS_TIGON_I(ap)) { | 2383 | if (ACE_IS_TIGON_I(ap)) { |
2388 | /* NB: TIGON_1 is special, tx_ring is in io space */ | 2384 | /* NB: TIGON_1 is special, tx_ring is in io space */ |
2389 | struct tx_desc __iomem *tx; | 2385 | struct tx_desc __iomem *tx; |
@@ -2394,10 +2390,10 @@ static int ace_close(struct net_device *dev) | |||
2394 | } else | 2390 | } else |
2395 | memset(ap->tx_ring + i, 0, | 2391 | memset(ap->tx_ring + i, 0, |
2396 | sizeof(struct tx_desc)); | 2392 | sizeof(struct tx_desc)); |
2397 | pci_unmap_page(ap->pdev, mapping, | 2393 | pci_unmap_page(ap->pdev, dma_unmap_addr(info, mapping), |
2398 | pci_unmap_len(info, maplen), | 2394 | dma_unmap_len(info, maplen), |
2399 | PCI_DMA_TODEVICE); | 2395 | PCI_DMA_TODEVICE); |
2400 | pci_unmap_addr_set(info, mapping, 0); | 2396 | dma_unmap_len_set(info, maplen, 0); |
2401 | } | 2397 | } |
2402 | if (skb) { | 2398 | if (skb) { |
2403 | dev_kfree_skb(skb); | 2399 | dev_kfree_skb(skb); |
@@ -2432,8 +2428,8 @@ ace_map_tx_skb(struct ace_private *ap, struct sk_buff *skb, | |||
2432 | 2428 | ||
2433 | info = ap->skb->tx_skbuff + idx; | 2429 | info = ap->skb->tx_skbuff + idx; |
2434 | info->skb = tail; | 2430 | info->skb = tail; |
2435 | pci_unmap_addr_set(info, mapping, mapping); | 2431 | dma_unmap_addr_set(info, mapping, mapping); |
2436 | pci_unmap_len_set(info, maplen, skb->len); | 2432 | dma_unmap_len_set(info, maplen, skb->len); |
2437 | return mapping; | 2433 | return mapping; |
2438 | } | 2434 | } |
2439 | 2435 | ||
@@ -2552,8 +2548,8 @@ restart: | |||
2552 | } else { | 2548 | } else { |
2553 | info->skb = NULL; | 2549 | info->skb = NULL; |
2554 | } | 2550 | } |
2555 | pci_unmap_addr_set(info, mapping, mapping); | 2551 | dma_unmap_addr_set(info, mapping, mapping); |
2556 | pci_unmap_len_set(info, maplen, frag->size); | 2552 | dma_unmap_len_set(info, maplen, frag->size); |
2557 | ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); | 2553 | ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); |
2558 | } | 2554 | } |
2559 | } | 2555 | } |