Lines Matching refs:self

64 static int fwohci_pci_attach(device_t self);
65 static int fwohci_pci_detach(device_t self);
200 fwohci_pci_init(device_t self) in fwohci_pci_init() argument
219 cmd = pci_read_config(self, PCIR_COMMAND, 2); in fwohci_pci_init()
222 pci_write_config(self, PCIR_COMMAND, cmd, 2); in fwohci_pci_init()
224 latency = olatency = pci_read_config(self, PCIR_LATTIMER, 1); in fwohci_pci_init()
228 pci_write_config(self, PCIR_LATTIMER, latency, 1); in fwohci_pci_init()
231 cache_line = ocache_line = pci_read_config(self, PCIR_CACHELNSZ, 1); in fwohci_pci_init()
235 pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1); in fwohci_pci_init()
239 device_printf(self, "latency timer %d -> %d.\n", in fwohci_pci_init()
241 device_printf(self, "cache size %d -> %d.\n", in fwohci_pci_init()
249 fwohci_pci_attach(device_t self) in fwohci_pci_attach() argument
251 fwohci_softc_t *sc = device_get_softc(self); in fwohci_pci_attach()
257 intr = pci_read_config(self, PCIR_INTLINE, 1); in fwohci_pci_attach()
259 device_printf(self, "Invalid irq %d\n", intr); in fwohci_pci_attach()
264 fwohci_pci_init(self); in fwohci_pci_attach()
267 sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, in fwohci_pci_attach()
270 device_printf(self, "Could not map memory\n"); in fwohci_pci_attach()
278 sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1, in fwohci_pci_attach()
281 device_printf(self, "Could not allocate irq\n"); in fwohci_pci_attach()
282 fwohci_pci_detach(self); in fwohci_pci_attach()
287 err = bus_setup_intr(self, sc->irq_res, in fwohci_pci_attach()
295 device_printf(self, "Could not setup irq, %d\n", err); in fwohci_pci_attach()
296 fwohci_pci_detach(self); in fwohci_pci_attach()
326 err = fwohci_init(sc, self); in fwohci_pci_attach()
329 device_printf(self, "fwohci_init failed with err=%d\n", err); in fwohci_pci_attach()
330 fwohci_pci_detach(self); in fwohci_pci_attach()
335 bus_generic_probe(self); in fwohci_pci_attach()
336 bus_generic_attach(self); in fwohci_pci_attach()
342 fwohci_pci_detach(device_t self) in fwohci_pci_detach() argument
344 fwohci_softc_t *sc = device_get_softc(self); in fwohci_pci_detach()
348 fwohci_stop(sc, self); in fwohci_pci_detach()
350 bus_generic_detach(self); in fwohci_pci_detach()
352 device_delete_child(self, sc->fc.bdev); in fwohci_pci_detach()
362 int err = bus_teardown_intr(self, sc->irq_res, sc->ih); in fwohci_pci_detach()
365 device_printf(self, "Could not tear down irq, %d\n", in fwohci_pci_detach()
371 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res); in fwohci_pci_detach()
376 bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr); in fwohci_pci_detach()
382 fwohci_detach(sc, self); in fwohci_pci_detach()