diff options
author | Tord Andersson <tord.andersson@endian.se> | 2011-08-03 18:11:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-04 05:04:32 -0400 |
commit | d3e614577198757d5854caa912e88f2d4296479b (patch) | |
tree | 82c78d2faf8aa426f77a5cc6d497122ed95f4161 /drivers/net/macb.c | |
parent | 36c35416a94f5632c3addad05217ff02c39b3b61 (diff) |
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 <tord.andersson@endian.se>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r-- | drivers/net/macb.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
322 | for (i = 0; i < TX_RING_SIZE; i++) | 322 | for (i = 0; i < TX_RING_SIZE; i++) |
323 | bp->tx_ring[i].ctrl = MACB_BIT(TX_USED); | 323 | bp->tx_ring[i].ctrl = MACB_BIT(TX_USED); |
324 | 324 | ||
325 | /* Add wrap bit */ | ||
326 | bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP); | ||
327 | |||
325 | /* free transmit buffer in upper layer*/ | 328 | /* free transmit buffer in upper layer*/ |
326 | for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) { | 329 | for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) { |
327 | struct ring_info *rp = &bp->tx_skb[tail]; | 330 | struct ring_info *rp = &bp->tx_skb[tail]; |