Lines Matching refs:dev
31 __FBSDID("$FreeBSD: releng/11.0/sys/dev/siba/siba_bwn.c 300760 2016-05-26 18:01:03Z adrian $");
55 #include <dev/pci/pcivar.h>
56 #include <dev/pci/pcireg.h>
58 #include <dev/siba/siba_ids.h>
59 #include <dev/siba/sibareg.h>
60 #include <dev/siba/sibavar.h>
107 siba_bwn_probe(device_t dev)
112 did = pci_get_device(dev);
113 vid = pci_get_vendor(dev);
117 device_set_desc(dev, siba_devices[i].desc);
125 siba_bwn_attach(device_t dev)
127 struct siba_bwn_softc *ssc = device_get_softc(dev);
130 siba->siba_dev = dev;
136 pci_enable_busmaster(dev);
142 siba->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
145 device_printf(dev, "cannot map register space\n");
152 siba->siba_pci_did = pci_get_device(dev);
153 siba->siba_pci_vid = pci_get_vendor(dev);
154 siba->siba_pci_subvid = pci_get_subvendor(dev);
155 siba->siba_pci_subdid = pci_get_subdevice(dev);
156 siba->siba_pci_revid = pci_get_revid(dev);
162 siba_bwn_detach(device_t dev)
164 struct siba_bwn_softc *ssc = device_get_softc(dev);
168 siba->siba_invalid = !bus_child_present(dev);
170 pci_disable_busmaster(dev);
171 bus_generic_detach(dev);
174 bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, siba->siba_mem_res);
180 siba_bwn_suspend(device_t dev)
182 struct siba_bwn_softc *ssc = device_get_softc(dev);
186 error = bus_generic_suspend(dev);
195 siba_bwn_resume(device_t dev)
197 struct siba_bwn_softc *ssc = device_get_softc(dev);
205 bus_generic_resume(dev);
212 siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
216 return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
222 siba_bwn_release_resource(device_t dev, device_t child, int type,
226 return (BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, type,
232 siba_bwn_setup_intr(device_t dev, device_t child, struct resource *irq,
237 return (BUS_SETUP_INTR(device_get_parent(dev), dev, irq, flags,
243 siba_bwn_teardown_intr(device_t dev, device_t child, struct resource *irq,
247 return (BUS_TEARDOWN_INTR(device_get_parent(dev), dev, irq, cookie));
251 siba_bwn_find_cap(device_t dev, device_t child, int capability,
255 return (pci_find_cap(dev, capability, capreg));
259 siba_bwn_find_extcap(device_t dev, device_t child, int capability,
263 return (pci_find_extcap(dev, capability, capreg));
267 siba_bwn_find_htcap(device_t dev, device_t child, int capability,
271 return (pci_find_htcap(dev, capability, capreg));
275 siba_bwn_alloc_msi(device_t dev, device_t child, int *count)
280 ssc = device_get_softc(dev);
283 error = pci_alloc_msi(dev, count);
290 siba_bwn_release_msi(device_t dev, device_t child)
295 ssc = device_get_softc(dev);
298 error = pci_release_msi(dev);
305 siba_bwn_msi_count(device_t dev, device_t child)
308 return (pci_msi_count(dev));
312 siba_bwn_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)