Lines Matching refs:dev
58 __FBSDID("$FreeBSD: releng/11.0/sys/dev/aha/aha_isa.c 298307 2016-04-19 23:37:24Z pfg $");
74 #include <dev/aha/ahareg.h>
104 aha_isa_probe(device_t dev)
109 struct aha_softc *aha = device_get_softc(dev);
117 aha->dev = dev;
119 if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO)
123 aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &port_rid,
135 bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port);
147 device_printf(dev, "Could not determine IRQ or DMA "
151 bus_release_resource(dev, SYS_RES_IOPORT, port_rid,
156 bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port);
170 device_printf(dev, "Invalid DMA setting for adapter at %#jx.",
174 error = bus_set_resource(dev, SYS_RES_DRQ, 0, drq, 1);
179 error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1);
187 aha_isa_attach(device_t dev)
189 struct aha_softc *aha = device_get_softc(dev);
192 aha->dev = dev;
194 aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
197 device_printf(dev, "Unable to allocate I/O ports\n");
202 aha->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &aha->irqrid,
205 device_printf(dev, "Unable to allocate excluse use of irq\n");
210 aha->drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &aha->drqrid,
213 device_printf(dev, "Unable to allocate drq\n");
218 if (dev->id_drq != -1)
219 isa_dmacascade(dev->id_drq);
224 if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev),
238 device_printf(dev, "dma tag create failed.\n");
243 device_printf(dev, "init failed\n");
252 device_printf(dev, "154xA may not work\n");
259 device_printf(dev, "attach failed\n");
263 error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY|
266 device_printf(dev, "Unable to register interrupt handler\n");
274 bus_free_resource(dev, SYS_RES_IOPORT, aha->port);
275 bus_free_resource(dev, SYS_RES_IRQ, aha->irq);
276 bus_free_resource(dev, SYS_RES_DRQ, aha->drq);
281 aha_isa_detach(device_t dev)
283 struct aha_softc *aha = (struct aha_softc *)device_get_softc(dev);
286 error = bus_teardown_intr(dev, aha->irq, aha->ih);
288 device_printf(dev, "failed to unregister interrupt handler\n");
292 device_printf(dev, "detach failed\n");
296 bus_free_resource(dev, SYS_RES_IOPORT, aha->port);
297 bus_free_resource(dev, SYS_RES_IRQ, aha->irq);
298 bus_free_resource(dev, SYS_RES_DRQ, aha->drq);