readcmd->block[0] = cpu_to_le32(lba); readcmd->block[1] = 0; 
readcmd->block[0] = cpu_to_le32((u32)(lba&0xffffffff)); readcmd->block[1] = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); 
static int aac_read(struct scsi_cmnd * scsicmd, int cid){	u32 lba;	u32 count;	int status;	u16 fibsize;	struct aac_dev *dev;	struct fib * cmd_fibcontext;	dev = (struct aac_dev *)scsicmd->device->host->hostdata;	/*	 *	Get block address and transfer length	 */	if (scsicmd->cmnd[0] == READ_6)	/* 6 byte command */	{		dprintk((KERN_DEBUG "aachba: received a read(6) command on id %d.\n", cid));		lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];		count = scsicmd->cmnd[4];		if (count == 0)			count = 256;	} else {		dprintk((KERN_DEBUG "aachba: received a read(10) command on id %d.\n", cid));		lba = (scsicmd->cmnd[2] << 24) | (scsicmd->cmnd[3] << 16) | (scsicmd->cmnd[4] << 8) | scsicmd->cmnd[5];		count = (scsicmd->cmnd[7] << 8) | scsicmd->cmnd[8];	}	dprintk((KERN_DEBUG "aac_read[cpu %d]: lba = %u, t = %ld.\n",	  smp_processor_id(), (unsigned long long)lba, jiffies));	/*	 *	Alocate and initialize a Fib	 */	if (!(cmd_fibcontext = fib_alloc(dev))) {		return -1;	}	fib_init(cmd_fibcontext);	if (dev->raw_io_interface) {		struct aac_raw_io *readcmd;		readcmd = (struct aac_raw_io *) fib_data(cmd_fibcontext);		readcmd->block[0] = cpu_to_le32(lba);		readcmd->block[1] = 0;		readcmd->count = cpu_to_le32(count<<9);		readcmd->cid = cpu_to_le16(cid);		readcmd->flags = cpu_to_le16(1);		readcmd->bpTotal = 0;		readcmd->bpComplete = 0;				aac_build_sgraw(scsicmd, &readcmd->sg);		fibsize = sizeof(struct aac_raw_io) + ((le32_to_cpu(readcmd->sg.count) - 1) * sizeof (struct sgentryraw));		if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr)))			BUG();		/*		 *	Now send the Fib to the adapter		 */		status = fib_send(ContainerRawIo,			  cmd_fibcontext, 			  fibsize, 			  FsaNormal, 			  0, 1, 			  (fib_callback) io_callback, 			  (void *) scsicmd);	} else if (dev->dac_support == 1) {		struct aac_read64 *readcmd;		readcmd = (struct aac_read64 *) fib_data(cmd_fibcontext);		readcmd->command = cpu_to_le32(VM_CtHostRead64);		readcmd->cid = cpu_to_le16(cid);		readcmd->sector_count = cpu_to_le16(count);		readcmd->block = cpu_to_le32(lba);		readcmd->pad   = 0;		readcmd->flags = 0; 		aac_build_sg64(scsicmd, &readcmd->sg);		fibsize = sizeof(struct aac_read64) + 			((le32_to_cpu(readcmd->sg.count) - 1) * 			 sizeof (struct sgentry64));		BUG_ON (fibsize > (dev->max_fib_size - 					sizeof(struct aac_fibhdr)));		/*		 *	Now send the Fib to the adapter		 */		status = fib_send(ContainerCommand64, 			  cmd_fibcontext, 			  fibsize, 			  FsaNormal, 			  0, 1, 			  (fib_callback) io_callback, 			  (void *) scsicmd);	} else {		struct aac_read *readcmd;		readcmd = (struct aac_read *) fib_data(cmd_fibcontext);		readcmd->command = cpu_to_le32(VM_CtBlockRead);		readcmd->cid = cpu_to_le32(cid);		readcmd->block = cpu_to_le32(lba);		readcmd->count = cpu_to_le32(count * 512);		aac_build_sg(scsicmd, &readcmd->sg);		fibsize = sizeof(struct aac_read) + 			((le32_to_cpu(readcmd->sg.count) - 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(ContainerCommand, 			  cmd_fibcontext, 			  fibsize, 			  FsaNormal, 			  0, 1, 			  (fib_callback) io_callback, 			  (void *) scsicmd);	}		/*	 *	Check that the command queued to the controller	 */	if (status == -EINPROGRESS) 		return 0;			printk(KERN_WARNING "aac_read: fib_send failed with status: %d.\n", status);	/*	 *	For some reason, the Fib didn't queue, return QUEUE_FULL	 */	scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;	aac_io_done(scsicmd);	fib_complete(cmd_fibcontext);	fib_free(cmd_fibcontext);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7a8cf29d69e077dfe90e327859201fd9b75a47ce/aachba.c/clean/drivers/scsi/aacraid/aachba.c