Lines Matching defs:child
90 device_list_t children; /**< list of child devices */
402 * DC_HAS_CHILDREN flag when a child devclass is created on
529 * DC_HAS_CHILDREN flag when a child devclass is created on
1339 * @brief Make a new device and add it as a child of @p parent
1411 device_print_child(device_t dev, device_t child)
1415 if (device_is_alive(child))
1416 retval += BUS_PRINT_CHILD(dev, child);
1418 retval += device_printf(child, " not found\n");
1426 * This creates a new device and adds it as a child of an existing
1428 * child with order zero.
1431 * new child device
1448 device_t child;
1451 TAILQ_FOREACH(child, &dev->children, link) {
1452 if (!strcmp(device_get_name(child), name))
1453 return (child);
1462 * This creates a new device and adds it as a child of an existing
1464 * child with the same order.
1467 * new child device
1482 device_t child;
1488 ("child device with wildcard name and specific unit number"));
1490 child = make_device(dev, name, unit);
1491 if (child == NULL)
1492 return (child);
1493 child->order = order;
1503 * greater than the new child.
1505 TAILQ_INSERT_BEFORE(place, child, link);
1508 * The new child's order is greater or equal to the order of
1509 * any existing device. Add the child to the tail of the list.
1511 TAILQ_INSERT_TAIL(&dev->children, child, link);
1517 return (child);
1528 * @param child the device to delete
1534 device_delete_child(device_t dev, device_t child)
1539 PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev)));
1542 if ((error = device_detach(child)) != 0)
1546 while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) {
1547 error = device_delete_child(child, grandchild);
1552 if (child->devclass)
1553 devclass_delete_device(child->devclass, child);
1554 if (child->parent)
1555 BUS_CHILD_DELETED(dev, child);
1556 TAILQ_REMOVE(&dev->children, child, link);
1557 TAILQ_REMOVE(&bus_data_devices, child, devlink);
1558 kobj_delete((kobj_t) child, M_BUS);
1569 * finds. If a child device cannot be deleted, this function will
1580 device_t child;
1587 while ((child = TAILQ_FIRST(&dev->children)) != NULL) {
1588 error = device_delete_child(dev, child);
1590 PDEBUG(("Failed deleting %s", DEVICENAME(child)));
1851 device_t child;
1854 TAILQ_FOREACH(child, &dev->children, link) {
1855 device_probe_and_attach(child);
1871 device_t child;
1881 TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
1882 if ((error = device_detach(child)) != 0)
1899 device_t child;
1905 TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
1906 device_shutdown(child);
1913 * @brief Default function for suspending a child device.
1918 bus_generic_suspend_child(device_t dev, device_t child)
1922 error = DEVICE_SUSPEND(child);
1925 child->flags |= DF_SUSPENDED;
1931 * @brief Default function for resuming a child device.
1936 bus_generic_resume_child(device_t dev, device_t child)
1939 DEVICE_RESUME(child);
1940 child->flags &= ~DF_SUSPENDED;
1958 device_t child;
1963 * Other buses, such as acpi, carefully order their child devices to
1967 TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
1968 error = BUS_SUSPEND_CHILD(dev, child);
1970 child = TAILQ_NEXT(child, link);
1971 if (child != NULL) {
1972 TAILQ_FOREACH_FROM(child, &dev->children, link)
1973 BUS_RESUME_CHILD(dev, child);
1990 device_t child;
1992 TAILQ_FOREACH(child, &dev->children, link) {
1993 BUS_RESUME_CHILD(dev, child);
2005 * @p child, including its name, unit and description (if any - see
2011 bus_print_child_header(device_t dev, device_t child)
2015 if (device_get_desc(child)) {
2016 retval += device_printf(child, "<%s>", device_get_desc(child));
2018 retval += printf("%s", device_get_nameunit(child));
2028 * @p child, which consists of the string @c " on " followed by the
2034 bus_print_child_footer(device_t dev, device_t child)
2047 bus_print_child_domain(device_t dev, device_t child)
2052 if (BUS_GET_DOMAIN(dev, child, &domain) != 0)
2067 bus_generic_print_child(device_t dev, device_t child)
2071 retval += bus_print_child_header(dev, child);
2072 retval += bus_print_child_domain(dev, child);
2073 retval += bus_print_child_footer(dev, child);
2083 * and then calls device_probe_and_attach() for each unattached child.
2088 device_t child;
2093 TAILQ_FOREACH(child, &dev->children, link) {
2094 if (child->state == DS_NOTPRESENT ||
2095 (child->flags & DF_REBID))
2096 device_probe_and_attach(child);
2116 device_t child;
2123 TAILQ_FOREACH(child, &dev->children, link) {
2124 if (child->state >= DS_ATTACHED)
2125 BUS_NEW_PASS(child);
2126 else if (child->state == DS_NOTPRESENT)
2127 device_probe_and_attach(child);
2140 bus_generic_child_present(device_t dev, device_t child)
2146 bus_generic_get_domain(device_t dev, device_t child, int *domain)
2175 bus_child_present(device_t child)
2177 return (BUS_CHILD_PRESENT(device_get_parent(child), child));
2423 device_probe_child(device_t dev, device_t child)
2429 int hasclass = (child->devclass != NULL);
2441 if (child->state == DS_ALIVE && (child->flags & DF_REBID) == 0)
2445 for (dl = first_matching_driver(dc, child);
2447 dl = next_matching_driver(dc, child, dl)) {
2453 result = device_set_driver(child, dl->driver);
2459 if (device_set_devclass(child,
2462 device_get_name(child);
2470 (void)device_set_driver(child, NULL);
2476 // resource_int_value(dl->driver->name, child->unit,
2477 // "flags", &child->devflags);
2479 result = DEVICE_PROBE(child);
2482 child->devflags = 0;
2484 (void)device_set_devclass(child, NULL);
2500 device_verbose(child);
2509 !(child->flags & DF_FIXEDCLASS)) {
2518 (void)device_set_driver(child, NULL);
2564 if (child->state > DS_ALIVE && best->driver != child->driver)
2569 if (!child->devclass) {
2570 result = device_set_devclass(child, best->driver->name);
2574 result = device_set_driver(child, best->driver);
2577 // resource_int_value(best->driver->name, child->unit,
2578 // "flags", &child->devflags);
2585 DEVICE_PROBE(child);
2587 child->flags |= DF_REBID;
2590 child->flags &= ~DF_REBID;
2591 child->state = DS_ALIVE;
2735 root_print_child(device_t dev, device_t child)
2739 retval += bus_print_child_header(dev, child);
2798 * device_probe_and_attach() for each child of the @c root0 device.
2926 device_t child;
2933 TAILQ_FOREACH(child, &dev->children, link) {
2934 print_device_tree_short(child, indent+1);
2942 device_t child;
2949 TAILQ_FOREACH(child, &dev->children, link) {
2950 print_device_tree(child, indent+1);