scsi_id->sbp2_device_type_and_lun = ud->lun; 
scsi_id->sbp2_lun = ORB_SET_LUN(ud->lun); 
static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,				      struct unit_directory *ud){	struct csr1212_keyval *kv;	struct csr1212_dentry *dentry;	u64 management_agent_addr;	u32 command_set_spec_id, command_set, unit_characteristics,		firmware_revision, workarounds;	int i;	SBP2_DEBUG("sbp2_parse_unit_directory");	management_agent_addr = 0x0;	command_set_spec_id = 0x0;	command_set = 0x0;	unit_characteristics = 0x0;	firmware_revision = 0x0;	/* Handle different fields in the unit directory, based on keys */	csr1212_for_each_dir_entry(ud->ne->csr, kv, ud->ud_kv, dentry) {		switch (kv->key.id) {		case CSR1212_KV_ID_DEPENDENT_INFO:			if (kv->key.type == CSR1212_KV_TYPE_CSR_OFFSET) {				/* Save off the management agent address */				management_agent_addr =					CSR1212_REGISTER_SPACE_BASE +					(kv->value.csr_offset << 2);				SBP2_DEBUG("sbp2_management_agent_addr = %x",					   (unsigned int) management_agent_addr);			} else if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) {				scsi_id->sbp2_device_type_and_lun = kv->value.immediate;			}			break;		case SBP2_COMMAND_SET_SPEC_ID_KEY:			/* Command spec organization */			command_set_spec_id = kv->value.immediate;			SBP2_DEBUG("sbp2_command_set_spec_id = %x",				   (unsigned int) command_set_spec_id);			break;		case SBP2_COMMAND_SET_KEY:			/* Command set used by sbp2 device */			command_set = kv->value.immediate;			SBP2_DEBUG("sbp2_command_set = %x",				   (unsigned int) command_set);			break;		case SBP2_UNIT_CHARACTERISTICS_KEY:			/*			 * Unit characterisitcs (orb related stuff			 * that I'm not yet paying attention to)			 */			unit_characteristics = kv->value.immediate;			SBP2_DEBUG("sbp2_unit_characteristics = %x",				   (unsigned int) unit_characteristics);			break;		case SBP2_FIRMWARE_REVISION_KEY:			/* Firmware revision */			firmware_revision = kv->value.immediate;			if (force_inquiry_hack)				SBP2_INFO("sbp2_firmware_revision = %x",				   (unsigned int) firmware_revision);			else	SBP2_DEBUG("sbp2_firmware_revision = %x",				   (unsigned int) firmware_revision);			break;		default:			break;		}	}	/* This is the start of our broken device checking. We try to hack	 * around oddities and known defects.  */	workarounds = 0x0;	/* If the vendor id is 0xa0b8 (Symbios vendor id), then we have a	 * bridge with 128KB max transfer size limitation. For sanity, we	 * only voice this when the current max_sectors setting	 * exceeds the 128k limit. By default, that is not the case.	 *	 * It would be really nice if we could detect this before the scsi	 * host gets initialized. That way we can down-force the	 * max_sectors to account for it. That is not currently	 * possible.  */	if ((firmware_revision & 0xffff00) ==			SBP2_128KB_BROKEN_FIRMWARE &&			(max_sectors * 512) > (128*1024)) {		SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB max transfer size.",				NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid));		SBP2_WARN("WARNING: Current max_sectors setting is larger than 128KB (%d sectors)!",				max_sectors);		workarounds |= SBP2_BREAKAGE_128K_MAX_TRANSFER;	}	/* Check for a blacklisted set of devices that require us to force	 * a 36 byte host inquiry. This can be overriden as a module param	 * (to force all hosts).  */	for (i = 0; i < NUM_BROKEN_INQUIRY_DEVS; i++) {		if ((firmware_revision & 0xffff00) ==				sbp2_broken_inquiry_list[i]) {			SBP2_WARN("Node " NODE_BUS_FMT ": Using 36byte inquiry workaround",					NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid));			workarounds |= SBP2_BREAKAGE_INQUIRY_HACK;			break; /* No need to continue. */		}	}	/* If this is a logical unit directory entry, process the parent	 * to get the values. */	if (ud->flags & UNIT_DIRECTORY_LUN_DIRECTORY) {		struct unit_directory *parent_ud =			container_of(ud->device.parent, struct unit_directory, device);		sbp2_parse_unit_directory(scsi_id, parent_ud);	} else {		scsi_id->sbp2_management_agent_addr = management_agent_addr;		scsi_id->sbp2_command_set_spec_id = command_set_spec_id;		scsi_id->sbp2_command_set = command_set;		scsi_id->sbp2_unit_characteristics = unit_characteristics;		scsi_id->sbp2_firmware_revision = firmware_revision;		scsi_id->workarounds = workarounds;		if (ud->flags & UNIT_DIRECTORY_HAS_LUN)			scsi_id->sbp2_device_type_and_lun = ud->lun;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e309fc6d71d61bb0f049ab6d0da10c845da9513f/sbp2.c/clean/drivers/ieee1394/sbp2.c