Delay most of the adapter initilization until after interrupts are

enabled.

Tested by:	Richard Puga <puga@mauibuilt.com>
This commit is contained in:
ps 2003-09-11 23:30:28 +00:00
parent 49dd02f247
commit 671348b0ff
2 changed files with 19 additions and 2 deletions

View File

@ -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;

View File

@ -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)