SONIC: small fix and cleanup

Fix a potential problem in the timeout handling: don't free the DMA buffers
before resetting the chip.

Also a trivial cleanup. Bring macsonic and jazzsonic into sync.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Finn Thain
2007-05-01 22:33:02 +02:00
committed by Linus Torvalds
parent 8b6aaab8c8
commit d74472f0b2
3 changed files with 16 additions and 12 deletions

View File

@@ -178,8 +178,13 @@ static void sonic_tx_timeout(struct net_device *dev)
{
struct sonic_local *lp = netdev_priv(dev);
int i;
/* Stop the interrupts for this */
/*
* put the Sonic into software-reset mode and
* disable all interrupts before releasing DMA buffers
*/
SONIC_WRITE(SONIC_IMR, 0);
SONIC_WRITE(SONIC_ISR, 0x7fff);
SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
/* We could resend the original skbs. Easier to re-initialise. */
for (i = 0; i < SONIC_NUM_TDS; i++) {
if(lp->tx_laddr[i]) {