diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2016-02-23 12:48:38 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-25 00:55:58 +0300 |
commit | 42f397adfc0a062a17119c08c82ed710b143a006 (patch) | |
tree | 50cd79879587ccf471153683fb04c0c156f2ac67 | |
parent | e19d0839e75718a0b06db66f6f7ec2df515ae0c2 (diff) | |
download | linux-42f397adfc0a062a17119c08c82ed710b143a006.tar.xz |
gianfar: Use skb_frag_t pointers inside xmit()
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index cb80dba8dd2b..7b16ce637a8e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -2322,6 +2322,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) struct txfcb *fcb = NULL; struct txbd8 *txbdp, *txbdp_start, *base, *txbdp_tstamp = NULL; u32 lstatus; + skb_frag_t *frag; int i, rq = 0; int do_tstamp, do_csum, do_vlan; u32 bufaddr; @@ -2448,25 +2449,24 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) u32 lstatus_start = lstatus; /* Place the fragment addresses and lengths into the TxBDs */ - for (i = 0; i < nr_frags; i++) { - unsigned int frag_len; + frag = &skb_shinfo(skb)->frags[0]; + for (i = 0; i < nr_frags; i++, frag++) { + unsigned int size; + /* Point at the next BD, wrapping as needed */ txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size); - frag_len = skb_shinfo(skb)->frags[i].size; + size = skb_frag_size(frag); - lstatus = be32_to_cpu(txbdp->lstatus) | frag_len | + lstatus = be32_to_cpu(txbdp->lstatus) | size | BD_LFLAG(TXBD_READY); /* Handle the last BD specially */ if (i == nr_frags - 1) lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT); - bufaddr = skb_frag_dma_map(priv->dev, - &skb_shinfo(skb)->frags[i], - 0, - frag_len, - DMA_TO_DEVICE); + bufaddr = skb_frag_dma_map(priv->dev, frag, 0, + size, DMA_TO_DEVICE); if (unlikely(dma_mapping_error(priv->dev, bufaddr))) goto dma_map_err; |