aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-19 02:38:23 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-19 02:38:23 -0500
commit198d6ba4d7f48c94f990f4604f0b3d73925e0ded (patch)
tree56bbdf8ba2553c23c8099da9344a8f1d1aba97ab /drivers/net/gianfar.c
parent9a57f7fabd383920585ed8b74eacd117c6551f2d (diff)
parent7f0f598a0069d1ab072375965a4b69137233169c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/isdn/i4l/isdn_net.c fs/cifs/connect.c
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c15
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++;