diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-04 11:05:26 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-04 11:05:26 +0100 |
commit | c0515566f3117c44b0572559bcc3cb00899b0910 (patch) | |
tree | 3c7e36ed6e78812b9276a81d6b3a2e80788003c5 /drivers/net/gianfar.c | |
parent | 4385cecf1f5866fb33fc95e2ee26a44e9b6f6be2 (diff) | |
parent | 061e41fdb5047b1fb161e89664057835935ca1d2 (diff) |
Merge commit 'v2.6.28-rc7' into x86/cleanups
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 83a5cb6aa23..c4af949bf86 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -1407,6 +1407,10 @@ static int gfar_clean_tx_ring(struct net_device *dev) if (bdp->status & TXBD_DEF) dev->stats.collisions++; + /* Unmap the DMA memory */ + dma_unmap_single(&priv->dev->dev, bdp->bufPtr, + bdp->length, DMA_TO_DEVICE); + /* Free the sk buffer associated with this TxBD */ dev_kfree_skb_irq(priv->tx_skbuff[priv->skb_dirtytx]); @@ -1666,6 +1670,9 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) skb = priv->rx_skbuff[priv->skb_currx]; + dma_unmap_single(&priv->dev->dev, bdp->bufPtr, + priv->rx_buffer_size, DMA_FROM_DEVICE); + /* We drop the frame if we failed to allocate a new buffer */ if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || bdp->status & RXBD_ERR)) { @@ -1674,14 +1681,8 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) if (unlikely(!newskb)) newskb = skb; - if (skb) { - dma_unmap_single(&priv->dev->dev, - bdp->bufPtr, - priv->rx_buffer_size, - DMA_FROM_DEVICE); - + if (skb) dev_kfree_skb_any(skb); - } } else { /* Increment the number of packets */ dev->stats.rx_packets++; |