Here are minor cleanups for declance.c - it cleans up
compiler warnings - and probably has a slightly better chance
of actually jumping to the right place for the handler routines
in an interrupt.
-Tom
------------------------------------------
--- linux-2.1.121-r3000/drivers/net/declance.c Thu Oct 1 14:55:26 1998
+++ linux-2.1.121-r3000_pl8/drivers/net/declance.c Sat Nov 14 21:52:40 1998
@@ -20,7 +20,7 @@
*
*/
-#undef DEBUG_DRIVER
+/* #define DEBUG 1 */
static char *version =
"declance.c: v0.003 by Linux Mips DECstation task force\n";
@@ -266,6 +266,10 @@
int leptr;
int i;
+#ifdef DEBUG
+ printk("lance_init_ring\n");
+#endif
+
/* This is right now because when we are using a PIO buffered
* init block, init_block_dvma is set to zero. -DaveM
*/
@@ -346,6 +350,9 @@
ll->rap = LE_CSR0;
ll->rdp = LE_C0_INIT;
+#ifdef DEBUG
+ printk("init_restart_lance\n");
+#endif
/* Wait for the lance to complete initialization */
for (i = 0; (i < 100) && !(ll->rdp & (LE_C0_ERR | LE_C0_IDON)); i++)
barrier();
@@ -379,6 +386,10 @@
int len = 0;
struct sk_buff *skb = 0;
+#ifdef DEBUG
+ printk("lance_rx\n");
+#endif
+
#ifdef TEST_HITS
printk ("[");
for (i = 0; i < RX_RING_SIZE; i++) {
@@ -453,6 +464,10 @@
int i, j;
int status;
+#ifdef DEBUG
+ printk("lance_tx\n");
+#endif
+
j = lp->tx_old;
for (i = j; i != lp->tx_new; i = j) {
td = &ib->btx_ring [i];
@@ -521,11 +536,16 @@
static void lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{
+
struct device *dev = (struct device *)dev_id;
struct lance_private *lp = (struct lance_private *)dev->priv;
volatile struct lance_regs *ll = lp->ll;
int csr0;
+#ifdef DEBUG
+ printk("lance_interrupt\n");
+#endif
+
if (dev->interrupt)
printk ("%s: again", dev->name);
@@ -582,16 +602,22 @@
*/
ll->rdp = LE_C0_INEA;
dev->interrupt = 0;
+
}
struct device *last_dev = 0;
static int lance_open (struct device *dev)
{
+
struct lance_private *lp = (struct lance_private *)dev->priv;
volatile struct lance_regs *ll = lp->ll;
int status = 0;
+#ifdef DEBUG
+ printk("lance_open\n");
+#endif
+
last_dev = dev;
/* Associate IRQ with lance_interrupt */
@@ -666,6 +692,7 @@
MOD_INC_USE_COUNT;
*/
return status;
+
}
static int lance_close (struct device *dev)
@@ -673,6 +700,10 @@
struct lance_private *lp = (struct lance_private *) dev->priv;
volatile struct lance_regs *ll = lp->ll;
+#ifdef DEBUG
+ printk("lance_close\n");
+#endif
+
dev->start = 0;
dev->tbusy = 1;
@@ -693,6 +724,10 @@
volatile struct lance_regs *ll = lp->ll;
int status;
+#ifdef DEBUG
+ printk("lance_reset\n");
+#endif
+
/* Stop the lance */
ll->rap = LE_CSR0;
ll->rdp = LE_C0_STOP;
@@ -713,7 +748,7 @@
dev->start = 1;
dev->tbusy = 0;
status = init_restart_lance (lp);
-#ifdef DEBUG_DRIVER
+#ifdef DEBUG
printk ("Lance restart=%d\n", status);
#endif
return status;
@@ -729,6 +764,10 @@
int status = 0;
static int outs;
+#ifdef DEBUG
+ printk("lance_start_xmit\n");
+#endif
+
/* Transmitter timeout, serious problems */
if (dev->tbusy) {
int tickssofar = jiffies - dev->trans_start;
@@ -799,6 +838,10 @@
{
struct lance_private *lp = (struct lance_private *) dev->priv;
+#ifdef DEBUG
+ printk("net_device_stats\n");
+#endif
+
return &lp->stats;
}
@@ -813,6 +856,10 @@
int i, j, bit, byte;
u32 crc, poly = CRC_POLYNOMIAL_LE;
+#ifdef DEBUG
+ printk("lance_load_multicast\n");
+#endif
+
/* set all multicast bits */
if (dev->flags & IFF_ALLMULTI){
ib->filter [0] = 0xffffffff;
@@ -857,6 +904,10 @@
volatile struct lance_init_block *ib = lp->init_block;
volatile struct lance_regs *ll = lp->ll;
+#ifdef DEBUG
+ printk("lance_set_multicast\n");
+#endif
+
while (dev->tbusy)
schedule();
set_bit (0, (void *) &dev->tbusy);
@@ -886,6 +937,10 @@
volatile struct lance_regs *ll;
int i;
+#ifdef DEBUG
+ printk("dec_lance_init\n");
+#endif
+
if (dev == NULL) {
dev = init_etherdev (0, sizeof (struct lance_private) + 8);
} else {
@@ -946,11 +1001,11 @@
}
lp->dev = dev;
- dev->open = &lance_open;
- dev->stop = &lance_close;
- dev->hard_start_xmit = &lance_start_xmit;
- dev->get_stats = &lance_get_stats;
- dev->set_multicast_list = &lance_set_multicast;
+ dev->open = lance_open;
+ dev->stop = lance_close;
+ dev->hard_start_xmit = lance_start_xmit;
+ dev->get_stats = lance_get_stats;
+ dev->set_multicast_list = lance_set_multicast;
dev->dma = 0;
ether_setup (dev);
/*
@@ -960,15 +1015,21 @@
root_lance_dev = lp;
#endif
*/
+
return 0;
}
+#ifdef CONFIG_TC
static int tc_probe(struct device *dev, unsigned char *esar_base)
{
extern slot_info tc_bus[MAX_SLOT];
extern unsigned long system_base;
int i;
+#ifdef DEBUG
+ printk("tc_probe\n");
+#endif
+
for (i = 0; i < MAX_SLOT; i++){
if(strcmp(tc_bus[i].name, "PMAD-AA") == 0){
/* check if it's already being used, if not,
@@ -984,6 +1045,7 @@
}
return 0;
}
+#endif
/* Find all the lance cards on the system and initialize them */
__initfunc(int dec_lance_probe (struct device *dev))
@@ -993,6 +1055,10 @@
extern unsigned long system_base;
#endif
+#ifdef DEBUG
+ printk("dec_lance_probe\n");
+#endif
+
/* According to the PMAD-AA TURBOchannel Ethernet Module Functional
* Specification the LANCE address range starts at 0xbb+100000
* where 0xbb is the base address of the I/O slot in which the
@@ -1036,6 +1102,10 @@
init_module(void)
{
root_lance_dev = NULL;
+#ifdef DEBUG
+ printk("declance:init_module\n");
+#endif
+
return dec_lance_probe(NULL);
}
@@ -1043,6 +1113,9 @@
cleanup_module(void)
{
struct lance_private *lp;
+#ifdef DEBUG
+ printk("declance:cleanup_module\n");
+#endif
while (root_lance_dev) {
lp = root_lance_dev->next_module;
|