Lines Matching defs:sc
82 struct dwc_otg_softc *sc = device_get_softc(dev);
89 sc->sc_mode = DWC_MODE_HOST;
90 sc->sc_bus.parent = dev;
91 sc->sc_bus.devices = sc->sc_devices;
92 sc->sc_bus.devices_max = DWC_OTG_MAX_DEVICES;
93 sc->sc_bus.dma_bits = 32;
96 if (usb_bus_mem_alloc_all(&sc->sc_bus,
102 sc->sc_io_res =
104 if (!(sc->sc_io_res)) {
108 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
109 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
110 sc->sc_io_size = rman_get_size(sc->sc_io_res);
113 sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ,
115 if (!(sc->sc_irq_res)) {
120 sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
121 if (!(sc->sc_bus.bdev)) {
125 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
128 err = bus_setup_intr(dev, sc->sc_irq_res,
130 dwc_otg_interrupt, sc, &sc->sc_intr_hdl);
133 err = bus_setup_intr(dev, sc->sc_irq_res,
135 sc, &sc->sc_intr_hdl);
138 sc->sc_intr_hdl = NULL;
156 err = dwc_otg_init(sc);
159 err = device_probe_and_attach(sc->sc_bus.bdev);
175 struct dwc_otg_softc *sc = device_get_softc(dev);
181 if (sc->sc_irq_res && sc->sc_intr_hdl) {
185 dwc_otg_uninit(sc);
192 err = bus_teardown_intr(dev, sc->sc_irq_res,
193 sc->sc_intr_hdl);
194 sc->sc_intr_hdl = NULL;
196 if (sc->sc_irq_res) {
198 sc->sc_irq_res);
199 sc->sc_irq_res = NULL;
201 if (sc->sc_io_res) {
203 sc->sc_io_res);
204 sc->sc_io_res = NULL;
206 usb_bus_mem_free_all(&sc->sc_bus, NULL);