Commit 42f397ad authored by Claudiu Manoil's avatar Claudiu Manoil Committed by David S. Miller

gianfar: Use skb_frag_t pointers inside xmit()

Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e19d0839
...@@ -2322,6 +2322,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2322,6 +2322,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct txfcb *fcb = NULL; struct txfcb *fcb = NULL;
struct txbd8 *txbdp, *txbdp_start, *base, *txbdp_tstamp = NULL; struct txbd8 *txbdp, *txbdp_start, *base, *txbdp_tstamp = NULL;
u32 lstatus; u32 lstatus;
skb_frag_t *frag;
int i, rq = 0; int i, rq = 0;
int do_tstamp, do_csum, do_vlan; int do_tstamp, do_csum, do_vlan;
u32 bufaddr; u32 bufaddr;
...@@ -2448,25 +2449,24 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2448,25 +2449,24 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
u32 lstatus_start = lstatus; u32 lstatus_start = lstatus;
/* Place the fragment addresses and lengths into the TxBDs */ /* Place the fragment addresses and lengths into the TxBDs */
for (i = 0; i < nr_frags; i++) { frag = &skb_shinfo(skb)->frags[0];
unsigned int frag_len; for (i = 0; i < nr_frags; i++, frag++) {
unsigned int size;
/* Point at the next BD, wrapping as needed */ /* Point at the next BD, wrapping as needed */
txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size); 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); BD_LFLAG(TXBD_READY);
/* Handle the last BD specially */ /* Handle the last BD specially */
if (i == nr_frags - 1) if (i == nr_frags - 1)
lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT); lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
bufaddr = skb_frag_dma_map(priv->dev, bufaddr = skb_frag_dma_map(priv->dev, frag, 0,
&skb_shinfo(skb)->frags[i], size, DMA_TO_DEVICE);
0,
frag_len,
DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(priv->dev, bufaddr))) if (unlikely(dma_mapping_error(priv->dev, bufaddr)))
goto dma_map_err; goto dma_map_err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment