if( scsicmd->device->id > 15 || scsicmd->device->lun > 7) { 
dev = (struct aac_dev *)scsicmd->device->host->hostdata; if (scsicmd->device->id >= dev->maximum_num_physicals || scsicmd->device->lun > 7) { 
static int aac_send_srb_fib(struct scsi_cmnd* scsicmd){	struct fib* cmd_fibcontext;	struct aac_dev* dev;	int status;	struct aac_srb *srbcmd;	u16 fibsize;	u32 flag;	u32 timeout;	if( scsicmd->device->id > 15 || scsicmd->device->lun > 7) {		scsicmd->result = DID_NO_CONNECT << 16;		scsicmd->scsi_done(scsicmd);		return 0;	}	dev = (struct aac_dev *)scsicmd->device->host->hostdata;	switch(scsicmd->sc_data_direction){	case DMA_TO_DEVICE:		flag = SRB_DataOut;		break;	case DMA_BIDIRECTIONAL:		flag = SRB_DataIn | SRB_DataOut;		break;	case DMA_FROM_DEVICE:		flag = SRB_DataIn;		break;	case DMA_NONE:	default:	/* shuts up some versions of gcc */		flag = SRB_NoDataXfer;		break;	}	/*	 *	Allocate and initialize a Fib then setup a BlockWrite command	 */	if (!(cmd_fibcontext = fib_alloc(dev))) {		return -1;	}	fib_init(cmd_fibcontext);	srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext);	srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);	srbcmd->channel  = cpu_to_le32(aac_logical_to_phys(scsicmd->device->channel));	srbcmd->id   = cpu_to_le32(scsicmd->device->id);	srbcmd->lun      = cpu_to_le32(scsicmd->device->lun);	srbcmd->flags    = cpu_to_le32(flag);	timeout = (scsicmd->timeout-jiffies)/HZ;	if(timeout == 0){		timeout = 1;	}	srbcmd->timeout  = cpu_to_le32(timeout);  // timeout in seconds	srbcmd->retry_limit = 0; /* Obsolete parameter */	srbcmd->cdb_size = cpu_to_le32(scsicmd->cmd_len);		if( dev->dac_support == 1 ) {		aac_build_sg64(scsicmd, (struct sgmap64*) &srbcmd->sg);		srbcmd->count = cpu_to_le32(scsicmd->request_bufflen);		memset(srbcmd->cdb, 0, sizeof(srbcmd->cdb));		memcpy(srbcmd->cdb, scsicmd->cmnd, scsicmd->cmd_len);		/*		 *	Build Scatter/Gather list		 */		fibsize = sizeof (struct aac_srb) - sizeof (struct sgentry) +			((le32_to_cpu(srbcmd->sg.count) & 0xff) * 			 sizeof (struct sgentry64));		BUG_ON (fibsize > (dev->max_fib_size -					sizeof(struct aac_fibhdr)));		/*		 *	Now send the Fib to the adapter		 */		status = fib_send(ScsiPortCommand64, cmd_fibcontext, 				fibsize, FsaNormal, 0, 1,				  (fib_callback) aac_srb_callback, 				  (void *) scsicmd);	} else {		aac_build_sg(scsicmd, (struct sgmap*)&srbcmd->sg);		srbcmd->count = cpu_to_le32(scsicmd->request_bufflen);		memset(srbcmd->cdb, 0, sizeof(srbcmd->cdb));		memcpy(srbcmd->cdb, scsicmd->cmnd, scsicmd->cmd_len);		/*		 *	Build Scatter/Gather list		 */		fibsize = sizeof (struct aac_srb) + 			(((le32_to_cpu(srbcmd->sg.count) & 0xff) - 1) * 			 sizeof (struct sgentry));		BUG_ON (fibsize > (dev->max_fib_size -					sizeof(struct aac_fibhdr)));		/*		 *	Now send the Fib to the adapter		 */		status = fib_send(ScsiPortCommand, cmd_fibcontext, fibsize, FsaNormal, 0, 1,				  (fib_callback) aac_srb_callback, (void *) scsicmd);	}	/*	 *	Check that the command queued to the controller	 */	if (status == -EINPROGRESS){		return 0;	}	printk(KERN_WARNING "aac_srb: fib_send failed with status: %d\n", status);	fib_complete(cmd_fibcontext);	fib_free(cmd_fibcontext);	return -1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/849717383abc795b8f5efe7b9e0792b2e1f8916a/aachba.c/buggy/drivers/scsi/aacraid/aachba.c