Lines Matching refs:dev
28 __FBSDID("$FreeBSD: releng/11.0/sys/dev/aic/aic_cbus.c 298431 2016-04-21 19:40:10Z pfg $");
43 #include <dev/aic/aic6360reg.h>
44 #include <dev/aic/aicvar.h>
87 aic_isa_alloc_resources(device_t dev)
89 struct aic_isa_softc *sc = device_get_softc(dev);
93 if ((isa_get_logicalid(dev) == 0xa180a3b8) ||
94 (AIC_TYPE98(device_get_flags(dev)) == AIC98_NEC100))
102 sc->sc_port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid,
105 device_printf(dev, "I/O port allocation failed\n");
111 if (isa_get_irq(dev) != -1) {
113 sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
116 device_printf(dev, "IRQ allocation failed\n");
117 aic_isa_release_resources(dev);
122 if (isa_get_drq(dev) != -1) {
124 sc->sc_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid,
127 device_printf(dev, "DRQ allocation failed\n");
128 aic_isa_release_resources(dev);
133 sc->sc_aic.dev = dev;
139 aic_isa_release_resources(device_t dev)
141 struct aic_isa_softc *sc = device_get_softc(dev);
144 bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port);
146 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq);
148 bus_release_resource(dev, SYS_RES_DRQ, 0, sc->sc_drq);
154 aic_isa_probe(device_t dev)
156 struct aic_isa_softc *sc = device_get_softc(dev);
162 if (ISA_PNP_PROBE(device_get_parent(dev), dev, aic_ids) == ENXIO)
165 port = isa_get_port(dev);
175 if (bus_set_resource(dev, SYS_RES_IOPORT, 0, ports[i], 1))
177 if (aic_isa_alloc_resources(dev))
181 aic_isa_release_resources(dev);
188 aic_isa_release_resources(dev);
189 if (isa_get_irq(dev) == -1)
190 bus_set_resource(dev, SYS_RES_IRQ, 0, PORTA_IRQ(porta), 1);
191 if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1)
192 bus_set_resource(dev, SYS_RES_DRQ, 0, PORTA_DRQ(porta), 1);
193 device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");
198 aic_isa_attach(device_t dev)
200 struct aic_isa_softc *sc = device_get_softc(dev);
204 error = aic_isa_alloc_resources(dev);
206 device_printf(dev, "resource allocation failed\n");
212 device_printf(dev, "attach failed\n");
213 aic_isa_release_resources(dev);
217 error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY |
220 device_printf(dev, "failed to register interrupt handler\n");
221 aic_isa_release_resources(dev);
228 aic_isa_detach(device_t dev)
230 struct aic_isa_softc *sc = device_get_softc(dev);
236 device_printf(dev, "detach failed\n");
240 error = bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih);
242 device_printf(dev, "failed to unregister interrupt handler\n");
245 aic_isa_release_resources(dev);