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

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

diff -u --recursive --new-file v1.3.74/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
@@ -22,6 +22,10 @@
 	packet latency but lower overhead.  If interrupts are disabled for an
 	unusually long time it could also result in missed packets, but in
 	practice this rarely happens.
+	
+	
+	FIXES:
+		Alan Cox:	Removed the 'Unexpected interrupt' bug.
 */
 
 static const  char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
@@ -321,9 +325,8 @@
 	outw(RxReset, ioaddr + EL3_CMD);
 	outw(SetReadZero | 0x00, ioaddr + EL3_CMD);
 
-	if (request_irq(dev->irq, &el3_interrupt, 0, "3c509", NULL)) {
+	if (request_irq(dev->irq, &el3_interrupt, 0, "3c509", dev))
 		return -EAGAIN;
-	}
 
 	EL3WINDOW(0);
 	if (el3_debug > 3)
@@ -333,7 +336,6 @@
 	/* Activate board: this is probably unnecessary. */
 	outw(0x0001, ioaddr + 4);
 
-	irq2dev_map[dev->irq] = dev;
 
 	/* Set the IRQ line. */
 	outw((dev->irq << 12) | 0x0f00, ioaddr + WN0_IRQ);
@@ -478,7 +480,7 @@
 static void
 el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	struct device *dev = (struct device *)(irq2dev_map[irq]);
+	struct device *dev = (struct device *)dev_id;
 	int ioaddr, status;
 	int i = 0;
 
@@ -687,14 +689,11 @@
 		outw(inw(ioaddr + WN4_MEDIA) & ~MEDIA_TP, ioaddr + WN4_MEDIA);
 	}
 
-	free_irq(dev->irq, NULL);
+	free_irq(dev->irq, dev);
 	/* Switching back to window 0 disables the IRQ. */
 	EL3WINDOW(0);
 	/* But we explicitly zero the IRQ line select anyway. */
 	outw(0x0f00, ioaddr + WN0_IRQ);
-
-
-	irq2dev_map[dev->irq] = 0;
 
 	update_stats(ioaddr, dev);
 	MOD_DEC_USE_COUNT;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this