Lines Matching defs:sc
84 ehci_softc_t *sc = device_get_softc(self);
110 sc->sc_bus.parent = self;
111 sc->sc_bus.devices = sc->sc_devices;
112 sc->sc_bus.devices_max = EHCI_MAX_DEVICES;
113 sc->sc_bus.dma_bits = 32;
116 if (usb_bus_mem_alloc_all(&sc->sc_bus,
123 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid,
125 if (!sc->sc_io_res) {
129 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
130 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
131 sc->sc_io_size = rman_get_size(sc->sc_io_res);
134 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid,
136 if (sc->sc_irq_res == NULL) {
141 sc->sc_bus.bdev = device_add_child(self, "usbus", -1);
142 if (!(sc->sc_bus.bdev)) {
146 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
147 device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR);
149 sprintf(sc->sc_vendor, "Ralink");
151 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
152 NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
155 sc->sc_intr_hdl = NULL;
159 err = ehci_init(sc);
161 err = device_probe_and_attach(sc->sc_bus.bdev);
177 ehci_softc_t *sc = device_get_softc(self);
183 if (sc->sc_irq_res && sc->sc_intr_hdl) {
187 ehci_detach(sc);
198 err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl);
202 sc->sc_intr_hdl = NULL;
204 if (sc->sc_irq_res) {
206 sc->sc_irq_res);
207 sc->sc_irq_res = NULL;
209 if (sc->sc_io_res) {
211 sc->sc_io_res);
212 sc->sc_io_res = NULL;
214 usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);