diff options
author | scottl <scottl@FreeBSD.org> | 2003-06-26 00:03:59 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2003-06-26 00:03:59 +0000 |
commit | 2c94c4118c28e42becd45242eccfb3dbc15e199c (patch) | |
tree | a44cbcf05050fb0e7ea38906671beb724d169bf6 /sys/dev/ips/ips.c | |
parent | 3a0952afbd82dda0c03d4f658194fd1503720a44 (diff) | |
download | FreeBSD-src-2c94c4118c28e42becd45242eccfb3dbc15e199c.zip FreeBSD-src-2c94c4118c28e42becd45242eccfb3dbc15e199c.tar.gz |
- Zero the buffers used to hold configuration data from the card. Not doing
so can leave stale data in the buffer and confuse the driver.
- enable the ability to set the 'disable' hint for the driver to keep it
from attaching. i.e. 'hw.ips.0.disable=1' will prevent the driver from
attaching.
- Only detach if attach suceeded.
Submitted by: mjacob
Diffstat (limited to 'sys/dev/ips/ips.c')
-rw-r--r-- | sys/dev/ips/ips.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/ips/ips.c b/sys/dev/ips/ips.c index 984fdf9..4d6d1fd 100644 --- a/sys/dev/ips/ips.c +++ b/sys/dev/ips/ips.c @@ -322,6 +322,7 @@ static void ips_timeout(void *arg) /* check card and initialize it */ int ips_adapter_init(ips_softc_t *sc) { + int i; DEVICE_PRINTF(1,sc->dev, "initializing\n"); if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, @@ -359,13 +360,18 @@ int ips_adapter_init(ips_softc_t *sc) can handle */ sc->max_cmds = 1; ips_cmdqueue_init(sc); + callout_handle_init(&sc->timer); if(sc->ips_adapter_reinit(sc, 0)) goto error; mtx_init(&sc->cmd_mtx, "ips command mutex", NULL, MTX_DEF); - if(ips_get_adapter_info(sc) || ips_get_drive_info(sc)){ - device_printf(sc->dev, "failed to get configuration data from device\n"); + if ((i = ips_get_adapter_info(sc)) != 0) { + device_printf(sc->dev, "failed to get adapter configuration data from device (%d)\n", i); + goto error; + } + if ((i = ips_get_drive_info(sc)) != 0) { + device_printf(sc->dev, "failed to get drive configuration data from device (%d)\n", i); goto error; } ips_update_nvram(sc); /* no error check as failure doesn't matter */ |