Lines Matching refs:sc
72 struct sbni_softc *sc;
79 sc = device_get_softc(dev);
81 sc->io_res = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
82 &sc->io_rid, SBNI_PORTS,
84 if (!sc->io_res) {
89 if (sbni_probe(sc) != 0) {
90 sbni_release_resources(sc);
101 struct sbni_softc *sc;
105 sc = device_get_softc(dev);
106 sc->dev = dev;
108 sc->irq_res = bus_alloc_resource_any(
109 dev, SYS_RES_IRQ, &sc->irq_rid, RF_ACTIVE);
113 if (sc->irq_res == NULL) {
115 sbni_release_resources(sc);
121 if (sc->irq_res) {
122 sbni_add(sc);
126 if ((master = connect_to_master(sc)) == NULL) {
128 sbni_release_resources(sc);
139 error = sbni_attach(sc, device_get_unit(dev) * 2, flags);
142 sbni_release_resources(sc);
146 if (sc->irq_res) {
148 dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
149 NULL, sbni_intr, sc, &sc->irq_handle);
152 sbni_detach(sc);
153 sbni_release_resources(sc);