Lines Matching refs:dev
31 __FBSDID("$FreeBSD: stable/11/sys/dev/buslogic/bt_pci.c 315221 2017-03-14 02:06:03Z pfg $");
41 #include <dev/pci/pcireg.h>
42 #include <dev/pci/pcivar.h>
48 #include <dev/buslogic/btreg.h>
58 bt_pci_alloc_resources(device_t dev)
68 regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
72 regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
78 irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &zero,
81 bus_release_resource(dev, type, rid, regs);
85 bt_init_softc(dev, regs, irq, 0);
91 bt_pci_release_resources(device_t dev)
93 struct bt_softc *bt = device_get_softc(dev);
97 bus_release_resource(dev, SYS_RES_IOPORT,
100 bus_release_resource(dev, SYS_RES_IRQ, 0, bt->irq);
101 bt_free_softc(dev);
105 bt_pci_probe(device_t dev)
107 switch (pci_get_devid(dev)) {
111 struct bt_softc *bt = device_get_softc(dev);
115 error = bt_pci_alloc_resources(dev);
144 bt_pci_release_resources(dev);
145 device_set_desc(dev, "Buslogic Multi-Master SCSI Host Adapter");
156 bt_pci_attach(device_t dev)
158 struct bt_softc *bt = device_get_softc(dev);
162 error = bt_pci_alloc_resources(dev);
164 device_printf(dev, "can't allocate resources in bt_pci_attach\n");
169 if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev),
183 bt_pci_release_resources(dev);
187 if (bt_probe(dev) || bt_fetch_adapter_info(dev) || bt_init(dev)) {
188 bt_pci_release_resources(dev);
192 error = bt_attach(dev);
195 bt_pci_release_resources(dev);