/* Before PDC_SYSTEM_MAP was invented, the PDC_MEM_MAP call was used. To use it, we initialise the mod_path.bc to 0xff and try all values of mod to get the HPA for the top-level devices. Bus adapters may have sub-devices which are discovered by setting bc to 0 and bc to the module, then trying all possible functions.  */
static void __init snake_inventory(void)
/* Before PDC_SYSTEM_MAP was invented, the PDC_MEM_MAP call was used. To use it, we initialise the mod_path.bc to 0xff and try all values of mod to get the HPA for the top-level devices. Bus adapters may have sub-devices which are discovered by setting bc to 0 and bc to the module, then trying all possible functions.  */
static void __init snake_inventory(void)
{
	int mod;
	for (mod = 0; mod < 16; mod++) {
		struct parisc_device *dev;
		struct pdc_module_path module_path;
		struct pdc_memory_map r_addr;
		unsigned int func;
		memset(module_path.path.bc, 0xff, 6);
		module_path.path.mod = mod;
		dev = legacy_create_device(&r_addr, &module_path);
		if ((!dev) || (dev->id.hw_type != HPHW_BA))
			continue;
		memset(module_path.path.bc, 0xff, 4);
		module_path.path.bc[4] = mod;
		for (func = 0; func < 16; func++) {
			module_path.path.bc[5] = 0;
			module_path.path.mod = func;
			legacy_create_device(&r_addr, &module_path);
		}
	}
}