patch-2.1.110 linux/drivers/net/3c509.c

Next file: linux/drivers/net/3c59x.c
Previous file: linux/drivers/net/3c501.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.109/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
@@ -47,11 +47,9 @@
 #include <linux/module.h>
 
 #include <linux/config.h>	/* for CONFIG_MCA */
-#include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/interrupt.h>
-#include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/in.h>
 #include <linux/malloc.h>
@@ -136,7 +134,7 @@
 static int el3_open(struct device *dev);
 static int el3_start_xmit(struct sk_buff *skb, struct device *dev);
 static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static void update_stats(int addr, struct device *dev);
+static void update_stats(struct device *dev);
 static struct enet_statistics *el3_get_stats(struct device *dev);
 static int el3_rx(struct device *dev);
 static int el3_close(struct device *dev);
@@ -533,10 +531,11 @@
 	dev->interrupt = 1;
 
 	ioaddr = dev->base_addr;
-	status = inw(ioaddr + EL3_STATUS);
 
-	if (el3_debug > 4)
+	if (el3_debug > 4) {
+		status = inw(ioaddr + EL3_STATUS);
 		printk("%s: interrupt, status %4.4x.\n", dev->name, status);
+	}
 
 	while ((status = inw(ioaddr + EL3_STATUS)) &
 		   (IntLatch | RxComplete | StatsFull)) {
@@ -555,7 +554,7 @@
 		if (status & (AdapterFailure | RxEarly | StatsFull)) {
 			/* Handle all uncommon interrupts. */
 			if (status & StatsFull)				/* Empty statistics. */
-				update_stats(ioaddr, dev);
+				update_stats(dev);
 			if (status & RxEarly) {				/* Rx early is unused. */
 				el3_rx(dev);
 				outw(AckIntr | RxEarly, ioaddr + EL3_CMD);
@@ -602,7 +601,7 @@
 
 	save_flags(flags);
 	cli();
-	update_stats(dev->base_addr, dev);
+	update_stats(dev);
 	restore_flags(flags);
 	return &lp->stats;
 }
@@ -612,9 +611,10 @@
 	operation, and it's simpler for the rest of the driver to assume that
 	window 1 is always valid rather than use a special window-state variable.
 	*/
-static void update_stats(int ioaddr, struct device *dev)
+static void update_stats(struct device *dev)
 {
 	struct el3_private *lp = (struct el3_private *)dev->priv;
+	int ioaddr = dev->base_addr;
 
 	if (el3_debug > 5)
 		printk("   Updating the statistics.\n");
@@ -760,7 +760,7 @@
 	/* But we explicitly zero the IRQ line select anyway. */
 	outw(0x0f00, ioaddr + WN0_IRQ);
 
-	update_stats(ioaddr, dev);
+	update_stats(dev);
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
@@ -770,6 +770,14 @@
 static int debug = -1;
 static int irq[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 static int xcvr[] = {-1, -1, -1, -1, -1, -1, -1, -1};
+
+MODULE_PARM(debug,"i");
+MODULE_PARM(irq,"1-8i");
+MODULE_PARM(xcvr,"1-8i");
+
+MODULE_PARM(debug,"i");
+MODULE_PARM(irq,"1-8i");
+MODULE_PARM(xcvr,"1-8i");
 
 int
 init_module(void)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov