Lines Matching refs:dev
34 __FBSDID("$FreeBSD: releng/11.0/sys/dev/malo/if_malo_pci.c 288087 2015-09-22 02:44:59Z adrian $");
59 #include <dev/malo/if_malo.h>
61 #include <dev/pci/pcivar.h>
62 #include <dev/pci/pcireg.h>
132 malo_pci_probe(device_t dev)
138 vendor = pci_get_vendor(dev);
139 devid = pci_get_device(dev);
144 device_set_desc(dev, mp->mp_name);
153 malo_pci_attach(device_t dev)
156 struct malo_pci_softc *psc = device_get_softc(dev);
159 sc->malo_dev = dev;
161 pci_enable_busmaster(dev);
167 error = bus_alloc_resources(dev, psc->malo_mem_spec, psc->malo_res_mem);
169 device_printf(dev, "couldn't allocate memory resources\n");
178 if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) {
179 msic = pci_msi_count(dev);
181 device_printf(dev, "MSI count : %d\n", msic);
187 if (pci_alloc_msi(dev, &msic) == 0) {
189 device_printf(dev, "Using %d MSI messages\n",
194 pci_release_msi(dev);
198 error = bus_alloc_resources(dev, psc->malo_irq_spec, psc->malo_res_irq);
200 device_printf(dev, "couldn't allocate IRQ resources\n");
205 error = bus_setup_intr(dev, psc->malo_res_irq[0],
210 error = bus_setup_intr(dev, psc->malo_res_irq[i],
221 if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
233 device_printf(dev, "cannot allocate DMA tag\n");
242 error = malo_attach(pci_get_device(dev), sc);
253 bus_teardown_intr(dev, psc->malo_res_irq[0],
257 bus_teardown_intr(dev, psc->malo_res_irq[i],
260 bus_release_resources(dev, psc->malo_irq_spec, psc->malo_res_irq);
263 pci_release_msi(dev);
264 bus_release_resources(dev, psc->malo_mem_spec, psc->malo_res_mem);
270 malo_pci_detach(device_t dev)
273 struct malo_pci_softc *psc = device_get_softc(dev);
277 sc->malo_invalid = !bus_child_present(dev);
281 bus_generic_detach(dev);
284 bus_teardown_intr(dev, psc->malo_res_irq[0],
288 bus_teardown_intr(dev, psc->malo_res_irq[i],
291 pci_release_msi(dev);
294 bus_release_resources(dev, psc->malo_irq_spec, psc->malo_res_irq);
296 bus_release_resources(dev, psc->malo_mem_spec, psc->malo_res_mem);
302 malo_pci_shutdown(device_t dev)
304 struct malo_pci_softc *psc = device_get_softc(dev);
312 malo_pci_suspend(device_t dev)
314 struct malo_pci_softc *psc = device_get_softc(dev);
322 malo_pci_resume(device_t dev)
324 struct malo_pci_softc *psc = device_get_softc(dev);