FreeBSD/sys/isa/isa_common.c
/*
 * Called after other devices have initialised to probe for isa devices.
 */
Called after other devices have initialised to probe for isa devices.
Called after other devices have initialised to probe for isa devices .
void
isa_probe_children(device_t dev)
{
	struct isa_device *idev;
	device_t *children, child;
	struct isa_config *cfg;
	int nchildren, i;
	bus_generic_probe(dev);
	if (device_get_children(dev, &children, &nchildren))
		return;
	if (bootverbose)
		printf("isa_probe_children: disabling PnP devices\n");
	cfg = malloc(sizeof(*cfg), M_TEMP, M_NOWAIT|M_ZERO);
	if (cfg == NULL) {
		free(children, M_TEMP);
		return;
	}
	for (i = 0; i < nchildren; i++) {
		idev = DEVTOISA(children[i]);
		bzero(cfg, sizeof(*cfg));
		if (idev->id_config_cb)
			idev->id_config_cb(idev->id_config_arg, cfg, 0);
	}
	free(cfg, M_TEMP);
	for (i = 0; i < nchildren; i++) {
		child = children[i];
		idev = DEVTOISA(child);
		if (idev->id_order > ISA_ORDER_PNPBIOS)
			continue;
		if (!TAILQ_EMPTY(&idev->id_configs) &&
		    !isa_assign_resources(child))
			continue;
		if (device_probe_and_attach(child) == 0)
			isa_claim_resources(dev, child);
	}
	free(children, M_TEMP);
	bus_enumerate_hinted_children(dev);
	if (device_get_children(dev, &children, &nchildren))
		return;
	if (bootverbose)
		printf("isa_probe_children: probing non-PnP devices\n");
	for (i = 0; i < nchildren; i++) {
		child = children[i];
		idev = DEVTOISA(child);
		if (device_is_attached(child) ||
		    !TAILQ_EMPTY(&idev->id_configs))
			continue;
		device_probe_and_attach(child);
	}
	if (bootverbose)
		printf("isa_probe_children: probing PnP devices\n");
	for (i = 0; i < nchildren; i++) {
		child = children[i];
		idev = DEVTOISA(child);
		if (device_is_attached(child) || TAILQ_EMPTY(&idev->id_configs))
			continue;
		if (isa_assign_resources(child)) {
			device_probe_and_attach(child);
			isa_claim_resources(dev, child);
		}
	}
	free(children, M_TEMP);
	isa_running = 1;
}
void isa_probe_children ( device_t dev ) { struct isa_device * idev ; device_t * children , child ; struct isa_config * cfg ; int nchildren , i ; bus_generic_probe ( dev ) ; if ( device_get_children ( dev , & children , & nchildren ) ) return ; if ( bootverbose ) printf ( " \n " ) ; cfg = malloc ( sizeof ( * cfg ) , M_TEMP , M_NOWAIT | M_ZERO ) ; if ( cfg == NULL ) { free ( children , M_TEMP ) ; return ; } for ( i = 0 ; i < nchildren ; i ++ ) { idev = DEVTOISA ( children [ i ] ) ; bzero ( cfg , sizeof ( * cfg ) ) ; if ( idev -> id_config_cb ) idev -> id_config_cb ( idev -> id_config_arg , cfg , 0 ) ; } free ( cfg , M_TEMP ) ; for ( i = 0 ; i < nchildren ; i ++ ) { child = children [ i ] ; idev = DEVTOISA ( child ) ; if ( idev -> id_order > ISA_ORDER_PNPBIOS ) continue ; if ( ! TAILQ_EMPTY ( & idev -> id_configs ) && ! isa_assign_resources ( child ) ) continue ; if ( device_probe_and_attach ( child ) == 0 ) isa_claim_resources ( dev , child ) ; } free ( children , M_TEMP ) ; bus_enumerate_hinted_children ( dev ) ; if ( device_get_children ( dev , & children , & nchildren ) ) return ; if ( bootverbose ) printf ( " \n " ) ; for ( i = 0 ; i < nchildren ; i ++ ) { child = children [ i ] ; idev = DEVTOISA ( child ) ; if ( device_is_attached ( child ) || ! TAILQ_EMPTY ( & idev -> id_configs ) ) continue ; device_probe_and_attach ( child ) ; } if ( bootverbose ) printf ( " \n " ) ; for ( i = 0 ; i < nchildren ; i ++ ) { child = children [ i ] ; idev = DEVTOISA ( child ) ; if ( device_is_attached ( child ) || TAILQ_EMPTY ( & idev -> id_configs ) ) continue ; if ( isa_assign_resources ( child ) ) { device_probe_and_attach ( child ) ; isa_claim_resources ( dev , child ) ; } } free ( children , M_TEMP ) ; isa_running = 1 ; }
Called after other devices have initialised to probe for isa devices.
Called after other devices have initialised to probe for isa devices .
/*
	 * Create all the non-hinted children by calling drivers'
	 * identify methods.
	 */ /*
	 * First disable all pnp devices so that they don't get
	 * matched by legacy probes.
	 */ /*
	 * Next, probe all the PnP BIOS devices so they can subsume any
	 * hints.
	 */ /*
	 * Next, enumerate hinted devices and probe all non-pnp devices so
	 * that they claim their resources first.
	 */ /*
	 * Finally assign resource to pnp devices and probe them.
	 */