Lines Matching refs:self

63 static int fwohci_pci_attach(device_t self);
64 static int fwohci_pci_detach(device_t self);
206 fwohci_pci_init(device_t self)
211 cmd = pci_read_config(self, PCIR_COMMAND, 2);
216 pci_write_config(self, PCIR_COMMAND, cmd, 2);
222 if (pci_get_devid(self) == (FW_VENDORID_SUN | FW_DEVICE_PCIO2FW) &&
223 pci_get_intpin(self) == 0)
224 pci_set_intpin(self, 3);
226 latency = olatency = pci_read_config(self, PCIR_LATTIMER, 1);
230 pci_write_config(self, PCIR_LATTIMER, latency, 1);
233 cache_line = ocache_line = pci_read_config(self, PCIR_CACHELNSZ, 1);
237 pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1);
241 device_printf(self, "latency timer %d -> %d.\n",
243 device_printf(self, "cache size %d -> %d.\n",
251 fwohci_pci_attach(device_t self)
253 fwohci_softc_t *sc = device_get_softc(self);
263 fwohci_pci_init(self);
266 sc->bsr = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE);
268 device_printf(self, "Could not map memory\n");
276 sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid,
279 device_printf(self, "Could not allocate irq\n");
280 fwohci_pci_detach(self);
284 err = bus_setup_intr(self, sc->irq_res,
290 device_printf(self, "Could not setup irq, %d\n", err);
291 fwohci_pci_detach(self);
296 /*parent*/bus_get_dma_tag(self),
314 device_printf(self, "fwohci_pci_attach: Could not allocate DMA "
316 fwohci_pci_detach(self);
320 err = fwohci_init(sc, self);
323 device_printf(self, "fwohci_init failed with err=%d\n", err);
324 fwohci_pci_detach(self);
329 bus_generic_probe(self);
330 bus_generic_attach(self);
336 fwohci_pci_detach(device_t self)
338 fwohci_softc_t *sc = device_get_softc(self);
344 fwohci_stop(sc, self);
346 bus_generic_detach(self);
349 device_delete_child(self, sc->fc.bdev);
361 err = bus_teardown_intr(self, sc->irq_res, sc->ih);
363 device_printf(self,
367 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
372 bus_release_resource(self, SYS_RES_MEMORY, PCI_CBMEM, sc->bsr);
378 fwohci_detach(sc, self);