aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/macb.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 047ea7be4850..e10528ed9081 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -307,8 +307,31 @@ static void macb_tx(struct macb *bp)
307 (unsigned long)status); 307 (unsigned long)status);
308 308
309 if (status & MACB_BIT(UND)) { 309 if (status & MACB_BIT(UND)) {
310 int i;
310 printk(KERN_ERR "%s: TX underrun, resetting buffers\n", 311 printk(KERN_ERR "%s: TX underrun, resetting buffers\n",
311 bp->dev->name); 312 bp->dev->name);
313
314 head = bp->tx_head;
315
316 /*Mark all the buffer as used to avoid sending a lost buffer*/
317 for (i = 0; i < TX_RING_SIZE; i++)
318 bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
319
320 /* free transmit buffer in upper layer*/
321 for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
322 struct ring_info *rp = &bp->tx_skb[tail];
323 struct sk_buff *skb = rp->skb;
324
325 BUG_ON(skb == NULL);
326
327 rmb();
328
329 dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
330 DMA_TO_DEVICE);
331 rp->skb = NULL;
332 dev_kfree_skb_irq(skb);
333 }
334
312 bp->tx_head = bp->tx_tail = 0; 335 bp->tx_head = bp->tx_tail = 0;
313 } 336 }
314 337