diff options
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 451f6b8b6163..2635f5bed77f 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -1405,6 +1405,10 @@ static int gfar_clean_tx_ring(struct net_device *dev) | |||
1405 | if (bdp->status & TXBD_DEF) | 1405 | if (bdp->status & TXBD_DEF) |
1406 | dev->stats.collisions++; | 1406 | dev->stats.collisions++; |
1407 | 1407 | ||
1408 | /* Unmap the DMA memory */ | ||
1409 | dma_unmap_single(&priv->dev->dev, bdp->bufPtr, | ||
1410 | bdp->length, DMA_TO_DEVICE); | ||
1411 | |||
1408 | /* Free the sk buffer associated with this TxBD */ | 1412 | /* Free the sk buffer associated with this TxBD */ |
1409 | dev_kfree_skb_irq(priv->tx_skbuff[priv->skb_dirtytx]); | 1413 | dev_kfree_skb_irq(priv->tx_skbuff[priv->skb_dirtytx]); |
1410 | 1414 | ||
@@ -1664,6 +1668,9 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
1664 | 1668 | ||
1665 | skb = priv->rx_skbuff[priv->skb_currx]; | 1669 | skb = priv->rx_skbuff[priv->skb_currx]; |
1666 | 1670 | ||
1671 | dma_unmap_single(&priv->dev->dev, bdp->bufPtr, | ||
1672 | priv->rx_buffer_size, DMA_FROM_DEVICE); | ||
1673 | |||
1667 | /* We drop the frame if we failed to allocate a new buffer */ | 1674 | /* We drop the frame if we failed to allocate a new buffer */ |
1668 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || | 1675 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || |
1669 | bdp->status & RXBD_ERR)) { | 1676 | bdp->status & RXBD_ERR)) { |
@@ -1672,14 +1679,8 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
1672 | if (unlikely(!newskb)) | 1679 | if (unlikely(!newskb)) |
1673 | newskb = skb; | 1680 | newskb = skb; |
1674 | 1681 | ||
1675 | if (skb) { | 1682 | if (skb) |
1676 | dma_unmap_single(&priv->dev->dev, | ||
1677 | bdp->bufPtr, | ||
1678 | priv->rx_buffer_size, | ||
1679 | DMA_FROM_DEVICE); | ||
1680 | |||
1681 | dev_kfree_skb_any(skb); | 1683 | dev_kfree_skb_any(skb); |
1682 | } | ||
1683 | } else { | 1684 | } else { |
1684 | /* Increment the number of packets */ | 1685 | /* Increment the number of packets */ |
1685 | dev->stats.rx_packets++; | 1686 | dev->stats.rx_packets++; |