Lines Matching defs:self

91 uhci_pci_take_controller(device_t self)
93 pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2);
99 uhci_pci_match(device_t self)
101 uint32_t device_id = pci_get_devid(self);
242 if ((pci_get_class(self) == PCIC_SERIALBUS) &&
243 (pci_get_subclass(self) == PCIS_SERIALBUS_USB) &&
244 (pci_get_progif(self) == PCI_INTERFACE_UHCI)) {
251 uhci_pci_probe(device_t self)
253 const char *desc = uhci_pci_match(self);
256 device_set_desc(self, desc);
264 uhci_pci_attach(device_t self)
266 uhci_softc_t *sc = device_get_softc(self);
271 sc->sc_bus.parent = self;
277 if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self),
281 sc->sc_dev = self;
283 pci_enable_busmaster(self);
286 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid,
289 device_printf(self, "Could not map ports\n");
300 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid,
303 device_printf(self, "Could not allocate irq\n");
306 sc->sc_bus.bdev = device_add_child(self, "usbus", -1);
308 device_printf(self, "Could not add USB device\n");
317 device_set_desc(sc->sc_bus.bdev, uhci_pci_match(self));
318 switch (pci_get_vendor(self)) {
330 device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
331 pci_get_devid(self));
333 sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
336 switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USB_REV_MASK) {
345 device_printf(self, "USB revision is unknown. Assuming v1.1.\n");
351 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
354 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
359 device_printf(self, "Could not setup irq, %d\n", err);
370 if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN) {
371 device_printf(self, "LegSup = 0x%04x\n",
372 pci_read_config(self, PCI_LEGSUP, 2));
375 pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2);
382 device_printf(self, "USB init failed\n");
388 uhci_pci_detach(self);
393 uhci_pci_detach(device_t self)
395 uhci_softc_t *sc = device_get_softc(self);
398 device_delete_children(self);
412 pci_disable_busmaster(self);
415 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl);
419 device_printf(self, "Could not tear down irq, %d\n",
425 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res);
429 bus_release_resource(self, SYS_RES_IOPORT, PCI_UHCI_BASE_REG,