Skip to content

Commit

Permalink
macb: restore wrap bit when performing underrun cleanup
Browse files Browse the repository at this point in the history
When TX underrun occurs, a cleanup is performed that marks all buffers
as used. As a side effect it also clears the wrap bit in the last
buffer. This patch will restore the wrap bit.

Signed-off-by: Tord Andersson <tord.andersson@endian.se>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tord Andersson authored and David S. Miller committed Aug 4, 2011
1 parent 36c3541 commit d3e6145
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ static void macb_tx(struct macb *bp)
for (i = 0; i < TX_RING_SIZE; i++)
bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);

/* Add wrap bit */
bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);

/* 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];
Expand Down

0 comments on commit d3e6145

Please sign in to comment.