From 825b49478f778e1f312ae34d63b3917a407da0de Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 10 Dec 1999 07:02:41 +0000 Subject: Move the turning on of the interrupts for the card at the bridge from the activate method to the setup_intr, and turn it off to teardown_intr. This makes the ed driver not enter its interrupt routine during the probe. Apparently, an interrupt happens when you disable the interrupts. There are other problems with ed still. --- sys/pccard/pcic.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'sys/pccard/pcic.c') diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index f4514a5..156675d 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -38,23 +38,12 @@ #include -#if 0 -#include -#include -#include -#endif - #include - #include #include #include #include -#ifdef APIC_IO -#include -#endif - /* * Prototypes for interrupt handler. */ @@ -775,7 +764,6 @@ pcic_activate_resource(device_t dev, device_t child, int type, int rid, break; } case SYS_RES_IRQ: - pcic_mapirq(devi->slt, rman_get_start(r)); break; case SYS_RES_MEMORY: { @@ -814,7 +802,6 @@ pcic_deactivate_resource(device_t dev, device_t child, int type, int rid, break; } case SYS_RES_IRQ: - pcic_mapirq(devi->slt, 0); break; case SYS_RES_MEMORY: { @@ -837,14 +824,26 @@ static int pcic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *intr, void *arg, void **cookiep) { - return (bus_generic_setup_intr(dev, child, irq, flags, intr, arg, - cookiep)); + struct pccard_devinfo *devi = device_get_ivars(child); + int err; + + err = bus_generic_setup_intr(dev, child, irq, flags, intr, arg, + cookiep); + if (err == 0) + pcic_mapirq(devi->slt, rman_get_start(irq)); + else + device_printf(dev, "Error %d irq %ld\n", err, + rman_get_start(irq)); + return (err); } static int pcic_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie) { + struct pccard_devinfo *devi = device_get_ivars(child); + + pcic_mapirq(devi->slt, 0); return (bus_generic_teardown_intr(dev, child, irq, cookie)); } -- cgit v1.1