Lines Matching refs:driver
51 kobj_class_t driver; member
96 driver_t *driver; /**< current driver */ member
130 static void print_driver_short(driver_t *driver, int indent);
131 static void print_driver(driver_t *driver, int indent);
387 devclass_driver_added(devclass_t dc, driver_t *driver) in devclass_driver_added() argument
397 BUS_DRIVER_ADDED(dc->devices[i], driver); in devclass_driver_added()
412 devclass_driver_added(dc, driver); in devclass_driver_added()
428 devclass_add_driver(devclass_t dc, driver_t *driver, int pass, devclass_t *dcp) in devclass_add_driver() argument
433 PDEBUG(("%s +", DRIVERNAME(driver))); in devclass_add_driver()
449 kobj_class_compile((kobj_class_t) driver); in devclass_add_driver()
458 if (driver->baseclasses) in devclass_add_driver()
459 parentname = driver->baseclasses[0]->name; in devclass_add_driver()
462 *dcp = devclass_find_internal(driver->name, parentname, TRUE); in devclass_add_driver()
464 dl->driver = driver; in devclass_add_driver()
466 driver->refs++; /* XXX: kobj_mtx */ in devclass_add_driver()
470 devclass_driver_added(dc, driver); in devclass_add_driver()
472 PDEBUG(("%s -", DRIVERNAME(driver))); in devclass_add_driver()
496 devclass_driver_deleted(devclass_t busclass, devclass_t dc, driver_t *driver) in devclass_driver_deleted() argument
515 if (dev->driver == driver && dev->parent && in devclass_driver_deleted()
539 error = devclass_driver_deleted(busclass, dc, driver); in devclass_driver_deleted()
562 devclass_delete_driver(devclass_t busclass, driver_t *driver) in devclass_delete_driver() argument
564 devclass_t dc = devclass_find(driver->name); in devclass_delete_driver()
568 PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass))); in devclass_delete_driver()
577 if (dl->driver == driver) in devclass_delete_driver()
582 PDEBUG(("%s not found in %s list", driver->name, in devclass_delete_driver()
587 error = devclass_driver_deleted(busclass, dc, driver); in devclass_delete_driver()
595 driver->refs--; in devclass_delete_driver()
596 if (driver->refs == 0) in devclass_delete_driver()
597 kobj_class_free((kobj_class_t) driver); in devclass_delete_driver()
617 devclass_quiesce_driver(devclass_t busclass, driver_t *driver) in devclass_quiesce_driver() argument
619 devclass_t dc = devclass_find(driver->name); in devclass_quiesce_driver()
625 PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass))); in devclass_quiesce_driver()
634 if (dl->driver == driver) in devclass_quiesce_driver()
639 PDEBUG(("%s not found in %s list", driver->name, in devclass_quiesce_driver()
657 if (dev->driver == driver && dev->parent && in devclass_quiesce_driver()
679 if (!strcmp(dl->driver->name, classname)) in devclass_find_driver_internal()
808 list[count] = dl->driver; in devclass_get_drivers()
1376 dev->driver = NULL; in make_device()
1664 dev->driver->name, dev->unit, error); in device_attach()
1683 dev->driver->name, dev->unit); in device_attach()
1835 DEVICE_IDENTIFY(dl->driver, dev); in bus_generic_probe()
2087 bus_generic_driver_added(device_t dev, driver_t *driver) in bus_generic_driver_added() argument
2092 DEVICE_IDENTIFY(driver, dev); in bus_generic_driver_added()
2122 DEVICE_IDENTIFY(dl->driver, dev); in bus_generic_new_pass()
2253 if (!strcmp(dev->devclass->name, dl->driver->name)) in next_matching_driver()
2385 device_set_driver(device_t dev, driver_t *driver) in device_set_driver() argument
2390 if (dev->driver == driver) in device_set_driver()
2399 dev->driver = driver; in device_set_driver()
2400 if (driver) { in device_set_driver()
2401 kobj_init((kobj_t) dev, (kobj_class_t) driver); in device_set_driver()
2402 if (!(dev->flags & DF_EXTERNALSOFTC) && driver->size > 0) { in device_set_driver()
2403 dev->softc = bsd_malloc(driver->size, M_BUS_SC, in device_set_driver()
2408 dev->driver = NULL; in device_set_driver()
2453 PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); in device_probe_child()
2454 result = device_set_driver(child, dl->driver); in device_probe_child()
2461 dl->driver->name) != 0) { in device_probe_child()
2469 dl->driver->name, in device_probe_child()
2565 if (child->state > DS_ALIVE && best->driver != child->driver) in device_probe_child()
2571 result = device_set_devclass(child, best->driver->name); in device_probe_child()
2575 result = device_set_driver(child, best->driver); in device_probe_child()
2778 root_bus->driver = &root_driver; in root_bus_module_handler()
2825 kobj_class_t driver; in driver_module_handler() local
2845 driver = dmd->dmd_driver; in driver_module_handler()
2847 DRIVERNAME(driver), dmd->dmd_busname, pass)); in driver_module_handler()
2848 error = devclass_add_driver(bus_devclass, driver, pass, in driver_module_handler()
2918 print_driver_short(dev->driver, indent+1); in print_device()
2956 print_driver_short(driver_t *driver, int indent) in print_driver_short() argument
2958 if (!driver) in print_driver_short()
2962 driver->name, driver->size)); in print_driver_short()
2966 print_driver(driver_t *driver, int indent) in print_driver() argument
2968 if (!driver) in print_driver()
2971 print_driver_short(driver, indent); in print_driver()
2977 driverlink_t driver = NULL; in print_driver_list() local
2979 TAILQ_FOREACH(driver, &drivers, link) { in print_driver_list()
2980 print_driver(driver->driver, indent); in print_driver_list()