aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sun
diff options
context:
space:
mode:
authorIan Campbell <Ian.Campbell@citrix.com>2011-08-29 19:18:25 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-30 17:58:01 -0400
commit18324d690d6a5028e3c174fc1921447aedead2b8 (patch)
tree5b7f8cdacf5776f33376f991369a1b8dfc20f573 /drivers/net/ethernet/sun
parent4d5b1a674e3426aa53191978631472518da71852 (diff)
cassini: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun')
-rw-r--r--drivers/net/ethernet/sun/cassini.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index 1776a37b7aed..f07a72150c63 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -2048,8 +2048,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
2048 skb->truesize += hlen - swivel; 2048 skb->truesize += hlen - swivel;
2049 skb->len += hlen - swivel; 2049 skb->len += hlen - swivel;
2050 2050
2051 get_page(page->buffer); 2051 __skb_frag_set_page(frag, page->buffer);
2052 frag->page = page->buffer; 2052 __skb_frag_ref(frag);
2053 frag->page_offset = off; 2053 frag->page_offset = off;
2054 frag->size = hlen - swivel; 2054 frag->size = hlen - swivel;
2055 2055
@@ -2072,8 +2072,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
2072 skb->len += hlen; 2072 skb->len += hlen;
2073 frag++; 2073 frag++;
2074 2074
2075 get_page(page->buffer); 2075 __skb_frag_set_page(frag, page->buffer);
2076 frag->page = page->buffer; 2076 __skb_frag_ref(frag);
2077 frag->page_offset = 0; 2077 frag->page_offset = 0;
2078 frag->size = hlen; 2078 frag->size = hlen;
2079 RX_USED_ADD(page, hlen + cp->crc_size); 2079 RX_USED_ADD(page, hlen + cp->crc_size);
@@ -2830,9 +2830,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
2830 skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag]; 2830 skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag];
2831 2831
2832 len = fragp->size; 2832 len = fragp->size;
2833 mapping = pci_map_page(cp->pdev, fragp->page, 2833 mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len,
2834 fragp->page_offset, len, 2834 PCI_DMA_TODEVICE);
2835 PCI_DMA_TODEVICE);
2836 2835
2837 tabort = cas_calc_tabort(cp, fragp->page_offset, len); 2836 tabort = cas_calc_tabort(cp, fragp->page_offset, len);
2838 if (unlikely(tabort)) { 2837 if (unlikely(tabort)) {
@@ -2843,7 +2842,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
2843 ctrl, 0); 2842 ctrl, 0);
2844 entry = TX_DESC_NEXT(ring, entry); 2843 entry = TX_DESC_NEXT(ring, entry);
2845 2844
2846 addr = cas_page_map(fragp->page); 2845 addr = cas_page_map(skb_frag_page(fragp));
2847 memcpy(tx_tiny_buf(cp, ring, entry), 2846 memcpy(tx_tiny_buf(cp, ring, entry),
2848 addr + fragp->page_offset + len - tabort, 2847 addr + fragp->page_offset + len - tabort,
2849 tabort); 2848 tabort);