diff options
author | ps <ps@FreeBSD.org> | 2003-09-11 23:30:28 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2003-09-11 23:30:28 +0000 |
commit | 671348b0ff54db3e2b5c4fbfea1b55a5a05e055f (patch) | |
tree | ba75241dba6ebd29bdab85c3f42b15cb9860ec8e /sys/dev/ips | |
parent | 49dd02f24778121c7cc0834ee7098d793db0a196 (diff) | |
download | FreeBSD-src-671348b0ff54db3e2b5c4fbfea1b55a5a05e055f.zip FreeBSD-src-671348b0ff54db3e2b5c4fbfea1b55a5a05e055f.tar.gz |
Delay most of the adapter initilization until after interrupts are
enabled.
Tested by: Richard Puga <puga@mauibuilt.com>
Diffstat (limited to 'sys/dev/ips')
-rw-r--r-- | sys/dev/ips/ips.h | 1 | ||||
-rw-r--r-- | sys/dev/ips/ips_pci.c | 20 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/ips/ips.h b/sys/dev/ips/ips.h index 02d58c9..3d0f19a 100644 --- a/sys/dev/ips/ips.h +++ b/sys/dev/ips/ips.h @@ -343,6 +343,7 @@ typedef struct ips_wait_list{ typedef struct ips_softc{ struct resource * iores; struct resource * irqres; + struct intr_config_hook ips_ich; int configured; int state; int iotype; diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c index 9e77cd0..1981e28 100644 --- a/sys/dev/ips/ips_pci.c +++ b/sys/dev/ips/ips_pci.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <dev/ips/ips.h> static int ips_pci_free(ips_softc_t *sc); +static void ips_intrhook(void *arg); static int ips_pci_probe(device_t dev) { @@ -132,15 +133,30 @@ static int ips_pci_attach(device_t dev) printf("IPS can't alloc dma tag\n"); goto error; } - if(ips_adapter_init(sc)) + sc->ips_ich.ich_func = ips_intrhook; + sc->ips_ich.ich_arg = sc; + if (config_intrhook_establish(&sc->ips_ich) != 0) { + printf("IPS can't establish configuration hook\n"); goto error; - sc->configured = 1; + } return 0; error: ips_pci_free(sc); return (ENXIO); } +static void +ips_intrhook(void *arg) +{ + struct ips_softc *sc = (struct ips_softc *)arg; + + config_intrhook_disestablish(&sc->ips_ich); + if (ips_adapter_init(sc)) + ips_pci_free(sc); + else + sc->configured = 1; +} + static int ips_pci_free(ips_softc_t *sc) { if(sc->adapter_dmatag) |