|
|
| version 1.1, 2004/04/16 20:13:16 | version 1.2, 2004/05/19 22:52:48 |
|---|---|
| Line 232 twa_attach(device_t dev) | Line 232 twa_attach(device_t dev) |
| u_int32_t command; | u_int32_t command; |
| int res_id; | int res_id; |
| int error; | int error; |
| dev_t xdev; | |
| twa_dbg_dprint_enter(3, sc); | twa_dbg_dprint_enter(3, sc); |
| Line 298 twa_attach(device_t dev) | Line 299 twa_attach(device_t dev) |
| twa_describe_controller(sc); | twa_describe_controller(sc); |
| /* Create the control device. */ | /* Create the control device. */ |
| sc->twa_ctrl_dev = make_dev(&twa_cdevsw, device_get_unit(sc->twa_bus_dev), | cdevsw_add(&twa_cdevsw, -1, device_get_unit(sc->twa_bus_dev)); |
| UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, | xdev = make_dev(&twa_cdevsw, device_get_unit(sc->twa_bus_dev), |
| "twa%d", device_get_unit(sc->twa_bus_dev)); | UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, |
| sc->twa_ctrl_dev->si_drv1 = sc; | "twa%d", device_get_unit(sc->twa_bus_dev)); |
| xdev->si_drv1 = sc; | |
| /* | /* |
| * Schedule ourselves to bring the controller up once interrupts are | * Schedule ourselves to bring the controller up once interrupts are |
| Line 376 twa_free(struct twa_softc *sc) | Line 378 twa_free(struct twa_softc *sc) |
| bus_release_resource(sc->twa_bus_dev, SYS_RES_IOPORT, | bus_release_resource(sc->twa_bus_dev, SYS_RES_IOPORT, |
| TWA_IO_CONFIG_REG, sc->twa_io_res); | TWA_IO_CONFIG_REG, sc->twa_io_res); |
| /* Destroy the control device. */ | cdevsw_remove(&twa_cdevsw, -1, device_get_unit(sc->twa_bus_dev)); |
| if (sc->twa_ctrl_dev != (dev_t)NULL) | |
| destroy_dev(sc->twa_ctrl_dev); | |
| sysctl_ctx_free(&sc->twa_sysctl_ctx); | sysctl_ctx_free(&sc->twa_sysctl_ctx); |
| } | } |