FreeBSD/sys/kern/subr_bus.c
/**
 * @brief Helper function for implementing BUS_NEW_PASS().
 *
 * This implementing of BUS_NEW_PASS() first calls the identify
 * routines for any drivers that probe at the current pass.  Then it
 * walks the list of devices for this bus.  If a device is already
 * attached, then it calls BUS_NEW_PASS() on that device.  If the
 * device is not already attached, it attempts to attach a driver to
 * it.
 */
@brief Helper function for implementing BUS_NEW_PASS().
This implementing of BUS_NEW_PASS() first calls the identify
routines for any drivers that probe at the current pass.  Then it
walks the list of devices for this bus.  If a device is already
attached, then it calls BUS_NEW_PASS() on that device.  If the
device is not already attached, it attempts to attach a driver to
it.
@brief Helper function for implementing BUS_NEW_PASS () . This implementing of BUS_NEW_PASS () first calls the identify routines for any drivers that probe at the current pass . Then it walks the list of devices for this bus . If a device is already attached then it calls BUS_NEW_PASS () on that device . If the device is not already attached it attempts to attach a driver to it .
void
bus_generic_new_pass(device_t dev)
{
	driverlink_t dl;
	devclass_t dc;
	device_t child;
	dc = dev->devclass;
	TAILQ_FOREACH(dl, &dc->drivers, link) {
		if (dl->pass == bus_current_pass)
			DEVICE_IDENTIFY(dl->driver, dev);
	}
	TAILQ_FOREACH(child, &dev->children, link) {
		if (child->state >= DS_ATTACHED)
			BUS_NEW_PASS(child);
		else if (child->state == DS_NOTPRESENT)
			device_probe_and_attach(child);
	}
}
void bus_generic_new_pass ( device_t dev ) { driverlink_t dl ; devclass_t dc ; device_t child ; dc = dev -> devclass ; TAILQ_FOREACH ( dl , & dc -> drivers , link ) { if ( dl -> pass == bus_current_pass ) DEVICE_IDENTIFY ( dl -> driver , dev ) ; } TAILQ_FOREACH ( child , & dev -> children , link ) { if ( child -> state >= DS_ATTACHED ) BUS_NEW_PASS ( child ) ; else if ( child -> state == DS_NOTPRESENT ) device_probe_and_attach ( child ) ; } }
@brief Helper function for implementing BUS_NEW_PASS().
@brief Helper function for implementing BUS_NEW_PASS () .