Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75180
b: refs/heads/master
c: bdcba15
h: refs/heads/master
v: v3
  • Loading branch information
Gregory CLEMENT authored and Jeff Garzik committed Dec 23, 2007
1 parent 624df8e commit bf46aa5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61c93f4eb45493f203d6bad24156599668be614f
refs/heads/master: bdcba1511b98f2e728b3a910b8771a0d3fce5bf3
25 changes: 24 additions & 1 deletion trunk/drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,31 @@ static void macb_tx(struct macb *bp)
(unsigned long)status);

if (status & MACB_BIT(UND)) {
int i;
printk(KERN_ERR "%s: TX underrun, resetting buffers\n",
bp->dev->name);
bp->dev->name);

head = bp->tx_head;

/*Mark all the buffer as used to avoid sending a lost buffer*/
for (i = 0; i < TX_RING_SIZE; i++)
bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);

/* free transmit buffer in upper layer*/
for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
struct ring_info *rp = &bp->tx_skb[tail];
struct sk_buff *skb = rp->skb;

BUG_ON(skb == NULL);

rmb();

dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
DMA_TO_DEVICE);
rp->skb = NULL;
dev_kfree_skb_irq(skb);
}

bp->tx_head = bp->tx_tail = 0;
}

Expand Down

0 comments on commit bf46aa5

Please sign in to comment.