Lines Matching refs:dev

19 #include <compat/dev/mii/mii.h>
23 #include <compat/dev/mii/miivar.h>
52 device_t dev = malloc(sizeof(struct device));
53 if (dev == NULL)
56 memset(dev, 0, sizeof(struct device));
58 if (init_device(dev, driver) == NULL) {
59 free(dev);
63 return dev;
139 device_printf(device_t dev, const char *format, ...)
144 driver_vprintf_etc(dev->device_name, format, vl);
151 device_set_desc(device_t dev, const char *desc)
153 dev->description = desc;
158 device_set_desc_copy(device_t dev, const char *desc)
160 dev->description = strdup(desc);
161 dev->flags |= DEVICE_DESC_ALLOCED;
166 device_get_desc(device_t dev)
168 return dev->description;
173 device_get_parent(device_t dev)
175 return dev->parent;
180 device_get_devclass(device_t dev)
188 device_get_children(device_t dev, device_t **devlistp, int *devcountp)
195 while ((child = list_get_next_item(&dev->children, child)) != NULL) {
210 while ((child = list_get_next_item(&dev->children, child)) != NULL) {
223 device_set_ivars(device_t dev, void *ivars)
225 dev->ivars = ivars;
230 device_get_ivars(device_t dev)
232 return dev->ivars;
237 device_get_name(device_t dev)
239 if (dev == NULL)
242 return dev->device_name;
247 device_get_unit(device_t dev)
249 return dev->unit;
254 device_get_nameunit(device_t dev)
256 return dev->nameunit;
261 device_get_softc(device_t dev)
263 return dev->softc;
268 device_set_softc(device_t dev, void *softc)
270 if (dev->softc == softc)
273 if ((dev->flags & DEVICE_SOFTC_SET) == 0) {
275 free(dev->softc);
278 dev->softc = softc;
279 if (dev->softc != NULL)
280 dev->flags |= DEVICE_SOFTC_SET;
282 dev->flags &= ~DEVICE_SOFTC_SET;
287 device_get_flags(device_t dev)
289 return dev->flags;
294 device_set_driver(device_t dev, driver_t *driver)
298 dev->softc = malloc(driver->size);
299 if (dev->softc == NULL)
302 memset(dev->softc, 0, driver->size);
303 dev->driver = driver;
309 dev->methods.device_register = (void *)mth->method;
311 dev->methods.probe = (void *)mth->method;
313 dev->methods.attach = (void *)mth->method;
315 dev->methods.detach = (void *)mth->method;
317 dev->methods.suspend = (void *)mth->method;
319 dev->methods.resume = (void *)mth->method;
321 dev->methods.shutdown = (void *)mth->method;
323 dev->methods.miibus_readreg = (void *)mth->method;
325 dev->methods.miibus_writereg = (void *)mth->method;
327 dev->methods.miibus_statchg = (void *)mth->method;
329 dev->methods.miibus_linkchg = (void *)mth->method;
331 dev->methods.miibus_mediainit = (void *)mth->method;
333 dev->methods.bus_child_location_str = (void *)mth->method;
335 dev->methods.bus_child_pnpinfo_str = (void *)mth->method;
337 dev->methods.bus_hinted_child = (void *)mth->method;
339 dev->methods.bus_print_child = (void *)mth->method;
341 dev->methods.bus_read_ivar = (void *)mth->method;
343 dev->methods.bus_get_dma_tag = (void *)mth->method;
524 bus_generic_attach(device_t dev)
528 while ((child = list_get_next_item(&dev->children, child)) != NULL) {
534 device_printf(dev, "No PHY module found (%x/%x)!\n",
590 __haiku_probe_miibus(device_t dev, driver_t *drivers[])
602 int result = probe(dev);
607 device_printf(dev, "Found MII: %s\n", selected->name);