patch-2.3.46 linux/drivers/net/sunlance.c
Next file: linux/drivers/net/tulip.c
Previous file: linux/drivers/net/setup.c
Back to the patch index
Back to the overall index
- Lines: 108
- Date:
Mon Feb 14 15:31:14 2000
- Orig file:
v2.3.45/linux/drivers/net/sunlance.c
- Orig date:
Sat Feb 12 11:22:10 2000
diff -u --recursive --new-file v2.3.45/linux/drivers/net/sunlance.c linux/drivers/net/sunlance.c
@@ -1,4 +1,4 @@
-/* $Id: sunlance.c,v 1.95 2000/02/10 21:14:24 davem Exp $
+/* $Id: sunlance.c,v 1.97 2000/02/14 09:02:32 davem Exp $
* lance.c: Linux/Sparc/Lance driver
*
* Written 1995, 1996 by Miguel de Icaza
@@ -602,7 +602,7 @@
lp->init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return;
+ goto out;
}
}
@@ -618,7 +618,7 @@
lp->init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return;
+ goto out;
}
} else if ((bits & LE_T1_POK) == LE_T1_POK) {
/*
@@ -644,7 +644,7 @@
if (test_bit(LINK_STATE_XOFF, &dev->state) &&
TX_BUFFS_AVAIL > 0)
netif_wake_queue(dev);
-
+out:
spin_unlock(&lp->lock);
}
@@ -773,7 +773,7 @@
lp->init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return;
+ goto out;
}
}
@@ -789,7 +789,7 @@
lp->init_ring(dev);
load_csrs(lp);
init_restart_lance(lp);
- return;
+ goto out;
}
} else if ((bits & LE_T1_POK) == LE_T1_POK) {
/*
@@ -815,7 +815,7 @@
if (test_bit(LINK_STATE_XOFF, &dev->state) &&
TX_BUFFS_AVAIL > 0)
netif_wake_queue(dev);
-
+out:
spin_unlock(&lp->lock);
}
@@ -1014,7 +1014,7 @@
return status;
}
-static void lance_piocopy_from_skb(volatile void *dest, char *src, int len)
+static void lance_piocopy_from_skb(volatile void *dest, unsigned char *src, int len)
{
unsigned long piobuf = (unsigned long) dest;
u32 *p32;
@@ -1128,10 +1128,10 @@
len = (skblen <= ETH_ZLEN) ? ETH_ZLEN : skblen;
- lp->stats.tx_bytes += len;
-
spin_lock_irq(&lp->lock);
+ lp->stats.tx_bytes += len;
+
entry = lp->tx_new & TX_RING_MOD_MASK;
if (lp->pio_buffer) {
sbus_writew((-len) | 0xf000, &ib->btx_ring[entry].length);
@@ -1154,19 +1154,20 @@
if (TX_BUFFS_AVAIL <= 0)
netif_stop_queue(dev);
- spin_unlock_irq(&lp->lock);
-
/* Kick the lance: transmit now */
sbus_writew(LE_C0_INEA | LE_C0_TDMD, lp->lregs + RDP);
- dev->trans_start = jiffies;
- dev_kfree_skb(skb);
-
+
/* Read back CSR to invalidate the E-Cache.
* This is needed, because DMA_DSBL_WR_INV is set.
*/
if (lp->dregs)
sbus_readw(lp->lregs + RDP);
+ spin_unlock_irq(&lp->lock);
+
+ dev->trans_start = jiffies;
+ dev_kfree_skb(skb);
+
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)