/* Adapters that have been claimed by drivers and those that are disabled are not reported. This function thus allows a driver to scan for further cards when some may already be driven.  */
int mca_find_unused_adapter(int id, int start)
/* Adapters that have been claimed by drivers and those that are disabled are not reported. This function thus allows a driver to scan for further cards when some may already be driven.  */
int mca_find_unused_adapter(int id, int start)
{
	struct mca_find_adapter_info info = { 0 };
	if (!MCA_bus || id == 0xffff)
		return MCA_NOTFOUND;
	info.slot = start;
	info.id = id;
	info.mca_dev = NULL;
	for(;;) {
		bus_for_each_dev(&mca_bus_type, NULL, &info, mca_find_adapter_callback);
		if(info.mca_dev == NULL)
			return MCA_NOTFOUND;
		if(info.mca_dev->status != MCA_ADAPTER_DISABLED
		   && !info.mca_dev->driver_loaded)
			break;
		info.slot = info.mca_dev->slot + 1;
		info.mca_dev = NULL;
	}
	return info.mca_dev->slot;
}