From d3e614577198757d5854caa912e88f2d4296479b Mon Sep 17 00:00:00 2001 From: Tord Andersson Date: Wed, 3 Aug 2011 22:11:47 +0000 Subject: [PATCH] macb: restore wrap bit when performing underrun cleanup 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 Acked-by: Nicolas Ferre Signed-off-by: David S. Miller --- drivers/net/macb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 0fcdc25699d8..dc4e305a1087 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -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]; -- 2.34.1