|
|
| version 1.3, 2004/05/13 23:49:19 | version 1.4, 2004/05/19 22:52:47 |
|---|---|
| Line 416 int | Line 416 int |
| ips_adapter_init(ips_softc_t *sc) | ips_adapter_init(ips_softc_t *sc) |
| { | { |
| int i; | int i; |
| dev_t dev; | |
| DEVICE_PRINTF(1, sc->dev, "initializing\n"); | DEVICE_PRINTF(1, sc->dev, "initializing\n"); |
| if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, | if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, |
| Line 494 ips_adapter_init(ips_softc_t *sc) | Line 495 ips_adapter_init(ips_softc_t *sc) |
| "failed to initialize command buffers\n"); | "failed to initialize command buffers\n"); |
| goto error; | goto error; |
| } | } |
| sc->device_file = make_dev(&ips_cdevsw, device_get_unit(sc->dev), | cdevsw_add(&ips_cdevsw, -1, device_get_unit(sc->dev)); |
| dev = make_dev(&ips_cdevsw, device_get_unit(sc->dev), | |
| UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, | UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, |
| "ips%d", device_get_unit(sc->dev)); | "ips%d", device_get_unit(sc->dev)); |
| sc->device_file->si_drv1 = sc; | dev->si_drv1 = sc; |
| ips_diskdev_init(sc); | ips_diskdev_init(sc); |
| sc->timer = timeout(ips_timeout, sc, 10*hz); | sc->timer = timeout(ips_timeout, sc, 10*hz); |
| return 0; | return 0; |
| Line 587 ips_adapter_free(ips_softc_t *sc) | Line 589 ips_adapter_free(ips_softc_t *sc) |
| bus_dma_tag_destroy(sc->sg_dmatag); | bus_dma_tag_destroy(sc->sg_dmatag); |
| if (sc->command_dmatag) | if (sc->command_dmatag) |
| bus_dma_tag_destroy(sc->command_dmatag); | bus_dma_tag_destroy(sc->command_dmatag); |
| if (sc->device_file) | cdevsw_remove(&ips_cdevsw, -1, device_get_unit(sc->dev)); |
| destroy_dev(sc->device_file); | |
| return 0; | return 0; |
| } | } |