Lines Matching refs:sc
80 struct sbni_softc *sc;
87 sc = device_get_softc(dev);
89 sc->io_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
90 &sc->io_rid, SBNI_PORTS,
92 if (!sc->io_res) {
97 if (sbni_probe(sc) != 0) {
98 sbni_release_resources(sc);
110 struct sbni_softc *sc;
114 sc = device_get_softc(dev);
115 sc->dev = dev;
117 sc->irq_res = bus_alloc_resource_any(
118 dev, SYS_RES_IRQ, &sc->irq_rid, RF_ACTIVE);
122 if (sc->irq_res == NULL) {
124 sbni_release_resources(sc);
130 if (sc->irq_res) {
131 sbni_add(sc);
135 if ((master = connect_to_master(sc)) == NULL) {
137 sbni_release_resources(sc);
148 error = sbni_attach(sc, device_get_unit(dev) * 2, flags);
151 sbni_release_resources(sc);
155 if (sc->irq_res) {
157 dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
158 NULL, sbni_intr, sc, &sc->irq_handle);
161 sbni_detach(sc);
162 sbni_release_resources(sc);