if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) { scsi_id->query_logins_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun); SBP2_DEBUG("sbp2_query_logins: set lun to %d", ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun)); } 
scsi_id->query_logins_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_lun); 
static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id){	struct sbp2scsi_host_info *hi = scsi_id->hi;	quadlet_t data[2];	int max_logins;	int active_logins;	SBP2_DEBUG("sbp2_query_logins");	scsi_id->query_logins_orb->reserved1 = 0x0;	scsi_id->query_logins_orb->reserved2 = 0x0;	scsi_id->query_logins_orb->query_response_lo = scsi_id->query_logins_response_dma;	scsi_id->query_logins_orb->query_response_hi = ORB_SET_NODE_ID(hi->host->node_id);	SBP2_DEBUG("sbp2_query_logins: query_response_hi/lo initialized");	scsi_id->query_logins_orb->lun_misc = ORB_SET_FUNCTION(SBP2_QUERY_LOGINS_REQUEST);	scsi_id->query_logins_orb->lun_misc |= ORB_SET_NOTIFY(1);	if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {		scsi_id->query_logins_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun);		SBP2_DEBUG("sbp2_query_logins: set lun to %d",			   ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun));	}	SBP2_DEBUG("sbp2_query_logins: lun_misc initialized");	scsi_id->query_logins_orb->reserved_resp_length =		ORB_SET_QUERY_LOGINS_RESP_LENGTH(sizeof(struct sbp2_query_logins_response));	SBP2_DEBUG("sbp2_query_logins: reserved_resp_length initialized");	scsi_id->query_logins_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO +						    SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(scsi_id->ud->id);	scsi_id->query_logins_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |						     SBP2_STATUS_FIFO_ADDRESS_HI);	SBP2_DEBUG("sbp2_query_logins: status FIFO initialized");	sbp2util_cpu_to_be32_buffer(scsi_id->query_logins_orb, sizeof(struct sbp2_query_logins_orb));	SBP2_DEBUG("sbp2_query_logins: orb byte-swapped");	sbp2util_packet_dump(scsi_id->query_logins_orb, sizeof(struct sbp2_query_logins_orb),			     "sbp2 query logins orb", scsi_id->query_logins_orb_dma);	memset(scsi_id->query_logins_response, 0, sizeof(struct sbp2_query_logins_response));	memset(&scsi_id->status_block, 0, sizeof(struct sbp2_status_block));	SBP2_DEBUG("sbp2_query_logins: query_logins_response/status FIFO memset");	data[0] = ORB_SET_NODE_ID(hi->host->node_id);	data[1] = scsi_id->query_logins_orb_dma;	sbp2util_cpu_to_be32_buffer(data, 8);	atomic_set(&scsi_id->sbp2_login_complete, 0);	SBP2_DEBUG("sbp2_query_logins: prepared to write");	hpsb_node_write(scsi_id->ne, scsi_id->sbp2_management_agent_addr, data, 8);	SBP2_DEBUG("sbp2_query_logins: written");	if (sbp2util_down_timeout(&scsi_id->sbp2_login_complete, 2*HZ)) {		SBP2_INFO("Error querying logins to SBP-2 device - timed out");		return(-EIO);	}	if (scsi_id->status_block.ORB_offset_lo != scsi_id->query_logins_orb_dma) {		SBP2_INFO("Error querying logins to SBP-2 device - timed out");		return(-EIO);	}	if (STATUS_GET_RESP(scsi_id->status_block.ORB_offset_hi_misc) ||	    STATUS_GET_DEAD_BIT(scsi_id->status_block.ORB_offset_hi_misc) ||	    STATUS_GET_SBP_STATUS(scsi_id->status_block.ORB_offset_hi_misc)) {		SBP2_INFO("Error querying logins to SBP-2 device - timed out");		return(-EIO);	}	sbp2util_cpu_to_be32_buffer(scsi_id->query_logins_response, sizeof(struct sbp2_query_logins_response));	SBP2_DEBUG("length_max_logins = %x",		   (unsigned int)scsi_id->query_logins_response->length_max_logins);	SBP2_DEBUG("Query logins to SBP-2 device successful");	max_logins = RESPONSE_GET_MAX_LOGINS(scsi_id->query_logins_response->length_max_logins);	SBP2_DEBUG("Maximum concurrent logins supported: %d", max_logins);	active_logins = RESPONSE_GET_ACTIVE_LOGINS(scsi_id->query_logins_response->length_max_logins);	SBP2_DEBUG("Number of active logins: %d", active_logins);	if (active_logins >= max_logins) {		return(-EIO);	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e309fc6d71d61bb0f049ab6d0da10c845da9513f/sbp2.c/clean/drivers/ieee1394/sbp2.c