Lines Matching refs:self
104 ehci_pci_match(device_t self) in ehci_pci_match() argument
106 uint32_t device_id = pci_get_devid(self); in ehci_pci_match()
220 if ((pci_get_class(self) == PCIC_SERIALBUS) in ehci_pci_match()
221 && (pci_get_subclass(self) == PCIS_SERIALBUS_USB) in ehci_pci_match()
222 && (pci_get_progif(self) == PCI_INTERFACE_EHCI)) { in ehci_pci_match()
229 ehci_pci_probe(device_t self) in ehci_pci_probe() argument
231 const char *desc = ehci_pci_match(self); in ehci_pci_probe()
234 device_set_desc(self, desc); in ehci_pci_probe()
242 ehci_pci_ati_quirk(device_t self, uint8_t is_sb700) in ehci_pci_ati_quirk() argument
261 val = pci_read_config(self, 0x53, 1); in ehci_pci_ati_quirk()
264 pci_write_config(self, 0x53, val, 1); in ehci_pci_ati_quirk()
265 device_printf(self, "AMD SB600/700 quirk applied\n"); in ehci_pci_ati_quirk()
270 ehci_pci_via_quirk(device_t self) in ehci_pci_via_quirk() argument
274 if ((pci_get_device(self) == 0x3104) && in ehci_pci_via_quirk()
275 ((pci_get_revid(self) & 0xf0) == 0x60)) { in ehci_pci_via_quirk()
277 val = pci_read_config(self, 0x4b, 1); in ehci_pci_via_quirk()
281 pci_write_config(self, 0x4b, val, 1); in ehci_pci_via_quirk()
282 device_printf(self, "VIA-quirk applied\n"); in ehci_pci_via_quirk()
287 ehci_pci_attach(device_t self) in ehci_pci_attach() argument
289 ehci_softc_t *sc = device_get_softc(self); in ehci_pci_attach()
294 sc->sc_bus.parent = self; in ehci_pci_attach()
301 USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { in ehci_pci_attach()
305 pci_enable_busmaster(self); in ehci_pci_attach()
307 switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USB_REV_MASK) { in ehci_pci_attach()
317 device_printf(self, "pre-2.0 USB revision (ignored)\n"); in ehci_pci_attach()
323 device_printf(self, "USB revision is unknown. Assuming v2.0.\n"); in ehci_pci_attach()
328 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, in ehci_pci_attach()
331 device_printf(self, "Could not map memory\n"); in ehci_pci_attach()
339 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, in ehci_pci_attach()
342 device_printf(self, "Could not allocate irq\n"); in ehci_pci_attach()
345 sc->sc_bus.bdev = device_add_child(self, "usbus", -1); in ehci_pci_attach()
347 device_printf(self, "Could not add USB device\n"); in ehci_pci_attach()
356 device_set_desc(sc->sc_bus.bdev, ehci_pci_match(self)); in ehci_pci_attach()
357 switch (pci_get_vendor(self)) { in ehci_pci_attach()
397 device_printf(self, "(New EHCI DeviceId=0x%08x)\n", in ehci_pci_attach()
398 pci_get_devid(self)); in ehci_pci_attach()
399 sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); in ehci_pci_attach()
403 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in ehci_pci_attach()
406 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in ehci_pci_attach()
410 device_printf(self, "Could not setup irq, %d\n", err); in ehci_pci_attach()
414 ehci_pci_take_controller(self); in ehci_pci_attach()
418 switch (pci_get_vendor(self)) { in ehci_pci_attach()
421 switch (pci_get_device(self)) { in ehci_pci_attach()
423 ehci_pci_ati_quirk(self, 0); in ehci_pci_attach()
426 ehci_pci_ati_quirk(self, 1); in ehci_pci_attach()
434 ehci_pci_via_quirk(self); in ehci_pci_attach()
442 switch (pci_get_vendor(self)) { in ehci_pci_attach()
447 device_printf(self, in ehci_pci_attach()
455 switch (pci_get_vendor(self)) { in ehci_pci_attach()
460 device_printf(self, in ehci_pci_attach()
472 device_printf(self, "USB init failed err=%d\n", err); in ehci_pci_attach()
478 ehci_pci_detach(self); in ehci_pci_attach()
483 ehci_pci_detach(device_t self) in ehci_pci_detach() argument
485 ehci_softc_t *sc = device_get_softc(self); in ehci_pci_detach()
488 device_delete_children(self); in ehci_pci_detach()
490 pci_disable_busmaster(self); in ehci_pci_detach()
498 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); in ehci_pci_detach()
502 device_printf(self, "Could not tear down irq, %d\n", in ehci_pci_detach()
507 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); in ehci_pci_detach()
511 bus_release_resource(self, SYS_RES_MEMORY, PCI_CBMEM, in ehci_pci_detach()
521 ehci_pci_take_controller(device_t self) in ehci_pci_take_controller() argument
523 ehci_softc_t *sc = device_get_softc(self); in ehci_pci_take_controller()
535 eec = pci_read_config(self, eecp, 4); in ehci_pci_take_controller()
539 bios_sem = pci_read_config(self, eecp + in ehci_pci_take_controller()
546 pci_write_config(self, eecp + in ehci_pci_take_controller()
550 bios_sem = pci_read_config(self, eecp + in ehci_pci_take_controller()