Lines Matching refs:dev
32 __FBSDID("$FreeBSD: releng/11.0/sys/dev/gem/if_gem_sbus.c 227843 2011-11-22 21:28:20Z marius $");
52 #include <dev/ofw/ofw_bus.h>
60 #include <dev/gem/if_gemreg.h>
61 #include <dev/gem/if_gemvar.h>
100 gem_sbus_probe(device_t dev)
103 if (strcmp(ofw_bus_get_name(dev), "network") == 0 &&
104 ofw_bus_get_compat(dev) != NULL &&
105 strcmp(ofw_bus_get_compat(dev), "SUNW,sbus-gem") == 0) {
106 device_set_desc(dev, "Sun GEM Gigabit Ethernet");
121 gem_sbus_attach(device_t dev)
127 sc = device_get_softc(dev);
129 sc->sc_dev = dev;
133 if (bus_alloc_resources(dev, gem_sbus_res_spec, sc->sc_res)) {
134 device_printf(dev, "failed to allocate resources\n");
135 bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res);
139 GEM_LOCK_INIT(sc, device_get_nameunit(dev));
141 OF_getetheraddr(dev, sc->sc_enaddr);
143 burst = sbus_get_burstsz(dev);
154 device_printf(dev, "unsupported burst size\n");
163 device_printf(dev, "could not be attached\n");
167 if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET |
169 device_printf(dev, "failed to set up interrupt\n");
177 bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res);
182 gem_sbus_detach(device_t dev)
186 sc = device_get_softc(dev);
187 bus_teardown_intr(dev, sc->sc_res[GEM_RES_INTR], sc->sc_ih);
190 bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res);
195 gem_sbus_suspend(device_t dev)
198 gem_suspend(device_get_softc(dev));
203 gem_sbus_resume(device_t dev)
206 gem_resume(device_get_softc(dev));