[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-net
Subject: AutoIRQ
From: Philip Blundell <phil () tazenda ! demon ! co ! uk>
Date: 1996-03-31 20:38:16
[Download RAW message or body]
At the moment we have two mechanisms for doing IRQ auto-probe; one in
drivers/net/auto_irq.c, and one in arch/x/kernel/irq.c. It seems rather
silly to have two routines for doing the same thing. This patch converts
the majority of the net drivers that used to use autoirq_xx() to use
probe_irq_xx() instead. There are still a couple to do, plus one of the
CD-ROM drivers.
Unfortunately probe_irq doesn't have any support for the "waittime"
feature that auto_irq provides, and so a few drivers that depended on that
may have been broken by this change. If so, they will need their own
delay loop added.
Phil
--
.signature: Permission denied
--- 3c501.c.81 Sun Mar 31 21:04:35 1996
+++ 3c501.c Sun Mar 31 21:10:33 1996
@@ -283,14 +283,14 @@
if (dev->irq < 2)
{
- autoirq_setup(2);
+ unsigned long irq_mask = probe_irq_on();
inb(RX_STATUS); /* Clear pending interrupts. */
inb(TX_STATUS);
outb(AX_LOOP + 1, AX_CMD);
outb(0x00, AX_CMD);
- autoirq = autoirq_report(1);
+ autoirq = probe_irq_off(irq_mask);
if (autoirq == 0)
{
--- 3c503.c.81 Sun Mar 31 21:07:38 1996
+++ 3c503.c Sun Mar 31 21:10:43 1996
@@ -341,10 +341,10 @@
do {
if (request_irq (*irqp, NULL, 0, "bogus", NULL) != -EBUSY) {
/* Twinkle the interrupt, and check if it's seen. */
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
outb_p(0x00, E33G_IDCFR);
- if (*irqp == autoirq_report(0) /* It's a good IRQ line! */
+ if (*irqp == probe_irq_off(irq_mask) /* It's a good IRQ line! */
&& request_irq (dev->irq = *irqp, &ei_interrupt, 0, ei_status.name, NULL) == 0)
break;
}
--- depca.c.81 Sun Mar 31 21:09:03 1996
+++ depca.c Sun Mar 31 21:10:20 1996
@@ -594,7 +594,7 @@
if (dev->irq < 2) {
#ifndef MODULE
unsigned char irqnum;
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
/* Assign the correct irq list */
switch (lp->adapter) {
@@ -617,7 +617,7 @@
/* Trigger an initialization just for the interrupt. */
outw(INEA | INIT, DEPCA_DATA);
- irqnum = autoirq_report(1);
+ irqnum = probe_irq_off(irq_mask);
if (!irqnum) {
printk(" and failed to detect IRQ line.\n");
status = -ENXIO;
--- eepro.c.81 Sun Mar 31 21:13:19 1996
+++ eepro.c Sun Mar 31 21:19:13 1996
@@ -463,12 +463,12 @@
outb(BANK0_SELECT, ioaddr); /* Switch back to Bank 0 */
if (request_irq (*irqp, NULL, 0, "bogus", NULL) != EBUSY) {
+ unsigned long irq_mask = probe_irq_on();
/* Twinkle the interrupt, and check if it's seen */
- autoirq_setup(0);
outb(DIAGNOSE_CMD, ioaddr); /* RESET the 82595 */
- if (*irqp == autoirq_report(2) && /* It's a good IRQ line */
+ if (*irqp == probe_irq_off(irq_mask) && /* It's a good IRQ line */
(request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", NULL) == 0))
break;
--- hp.c.81 Sun Mar 31 21:14:03 1996
+++ hp.c Sun Mar 31 21:18:34 1996
@@ -151,11 +151,11 @@
do {
int irq = *irqp;
if (request_irq (irq, NULL, 0, "bogus", NULL) != -EBUSY) {
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
/* Twinkle the interrupt, and check if it's seen. */
outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
- if (irq == autoirq_report(0) /* It's a good IRQ line! */
+ if (irq == probe_irq_off(irq_mask) /* It's a good IRQ line! */
&& request_irq (irq, &ei_interrupt, 0, "hp", NULL) == 0) {
printk(" selecting IRQ %d.\n", irq);
dev->irq = *irqp;
--- lance.c.81 Sun Mar 31 21:14:55 1996
+++ lance.c Sun Mar 31 21:15:28 1996
@@ -495,12 +495,12 @@
/* To auto-IRQ we enable the initialization-done and DMA error
interrupts. For ISA boards we get a DMA error, but VLB and PCI
boards will work. */
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
/* Trigger an initialization just for the interrupt. */
outw(0x0041, ioaddr+LANCE_DATA);
- dev->irq = autoirq_report(1);
+ dev->irq = probe_irq_off(irq_mask);
if (dev->irq)
printk(", probed IRQ %d", dev->irq);
else {
--- ne.c.81 Sun Mar 31 21:13:01 1996
+++ ne.c Sun Mar 31 21:13:05 1996
@@ -342,13 +342,13 @@
}
if (dev->irq < 2) {
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
outb_p(0x50, ioaddr + EN0_IMR); /* Enable one interrupt. */
outb_p(0x00, ioaddr + EN0_RCNTLO);
outb_p(0x00, ioaddr + EN0_RCNTHI);
outb_p(E8390_RREAD+E8390_START, ioaddr); /* Trigger it... */
outb_p(0x00, ioaddr + EN0_IMR); /* Mask it again. */
- dev->irq = autoirq_report(0);
+ dev->irq = probe_irq_off(irq_mask);
if (ei_debug > 2)
printk(" autoirq is %d\n", dev->irq);
} else if (dev->irq == 2)
--- smc9194.c.81 Sun Mar 31 21:16:19 1996
+++ smc9194.c Sun Mar 31 21:17:11 1996
@@ -798,14 +798,14 @@
int smc_findirq( int ioaddr )
{
int timeout = 20;
-
+ unsigned long irq_mask;
/* I have to do a STI() here, because this is called from
a routine that does an CLI during this process, making it
rather difficult to get interrupts for auto detection */
sti();
- autoirq_setup( 0 );
+ irq_mask = probe_irq_on();
/*
* What I try to do here is trigger an ALLOC_INT. This is done
@@ -858,7 +858,7 @@
cli();
/* and return what I found */
- return autoirq_report( 0 );
+ return probe_irq_off(irq_mask);
}
#endif
--- wd.c.81 Sun Mar 31 21:10:50 1996
+++ wd.c Sun Mar 31 21:19:27 1996
@@ -228,18 +228,19 @@
int reg4 = inb(ioaddr+4);
if (ancient || reg1 == 0xff) { /* Ack!! No way to read the IRQ! */
short nic_addr = ioaddr+WD_NIC_OFFSET;
+ unsigned long irq_mask;
/* We have an old-style ethercard that doesn't report its IRQ
line. Do autoirq to find the IRQ line. Note that this IS NOT
a reliable way to trigger an interrupt. */
outb_p(E8390_NODMA + E8390_STOP, nic_addr);
outb(0x00, nic_addr+EN0_IMR); /* Disable all intrs. */
- autoirq_setup(0);
+ irq_mask = probe_irq_on();
outb_p(0xff, nic_addr + EN0_IMR); /* Enable all interrupts. */
outb_p(0x00, nic_addr + EN0_RCNTLO);
outb_p(0x00, nic_addr + EN0_RCNTHI);
outb(E8390_RREAD+E8390_START, nic_addr); /* Trigger it... */
- dev->irq = autoirq_report(2);
+ dev->irq = probe_irq_off(irq_mask);
outb_p(0x00, nic_addr+EN0_IMR); /* Mask all intrs. again. */
if (ei_debug > 2)
--- pi2.c.81 Sun Mar 31 21:23:01 1996
+++ pi2.c Sun Mar 31 21:25:17 1996
@@ -1369,7 +1369,7 @@
/* chipset_init() was already called */
if (dev->irq < 2) {
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
save_flags(flags);
cli();
wrtscc(lp->cardbase, CTL + lp->base, R1, EXT_INT_ENAB);
@@ -1379,7 +1379,7 @@
/* request a timer interrupt for 1 mS hence */
tdelay(lp, 1);
/* 20 "jiffies" should be plenty of time... */
- dev->irq = autoirq_report(20);
+ dev->irq = probe_irq_off(irq_mask);
if (!dev->irq) {
printk(". Failed to detect IRQ line.\n");
}
--- skeleton.c.81 Sun Mar 31 21:22:17 1996
+++ skeleton.c Sun Mar 31 21:22:44 1996
@@ -206,10 +206,10 @@
if (dev->irq == -1)
; /* Do nothing: a user-level program will set it. */
else if (dev->irq < 2) { /* "Auto-IRQ" */
- autoirq_setup(0);
+ unsigned long irq_mask = probe_irq_on();
/* Trigger an interrupt here. */
- dev->irq = autoirq_report(0);
+ dev->irq = probe_irq_off(irq_mask);
if (net_debug >= 2)
printk(" autoirq is %d", dev->irq);
} else if (dev->irq == 2)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic