aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/via
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-18 17:00:24 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-19 03:10:46 -0400
commit9e903e085262ffbf1fc44a17ac06058aca03524a (patch)
tree4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/ethernet/via
parentdd767856a36e00b631d65ebc4bb81b19915532d6 (diff)
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize all references to skb frags size. Define accessors : skb_frag_size() to fetch frag size, and skb_frag_size_{set|add|sub}() to manipulate it. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/via')
-rw-r--r--drivers/net/ethernet/via/via-velocity.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index b47bce1a2e2a..4535d7cc848e 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2554,16 +2554,16 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
2554 2554
2555 /* Handle fragments */ 2555 /* Handle fragments */
2556 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2556 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2557 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2557 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2558 2558
2559 tdinfo->skb_dma[i + 1] = skb_frag_dma_map(&vptr->pdev->dev, 2559 tdinfo->skb_dma[i + 1] = skb_frag_dma_map(&vptr->pdev->dev,
2560 frag, 0, 2560 frag, 0,
2561 frag->size, 2561 skb_frag_size(frag),
2562 DMA_TO_DEVICE); 2562 DMA_TO_DEVICE);
2563 2563
2564 td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]); 2564 td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]);
2565 td_ptr->td_buf[i + 1].pa_high = 0; 2565 td_ptr->td_buf[i + 1].pa_high = 0;
2566 td_ptr->td_buf[i + 1].size = cpu_to_le16(frag->size); 2566 td_ptr->td_buf[i + 1].size = cpu_to_le16(skb_frag_size(frag));
2567 } 2567 }
2568 tdinfo->nskb_dma = i + 1; 2568 tdinfo->nskb_dma = i + 1;
2569 2569