ulong timeout = jiffies + (TMOUT_SCSI*HZ); 
static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)){	adpt_hba* pHba = NULL;	struct adpt_device* pDev = NULL;	/* dpt per device information */	ulong timeout = jiffies + (TMOUT_SCSI*HZ);	cmd->scsi_done = done;	/*	 * SCSI REQUEST_SENSE commands will be executed automatically by the 	 * Host Adapter for any errors, so they should not be executed 	 * explicitly unless the Sense Data is zero indicating that no error 	 * occurred.	 */	if ((cmd->cmnd[0] == REQUEST_SENSE) && (cmd->sense_buffer[0] != 0)) {		cmd->result = (DID_OK << 16);		cmd->scsi_done(cmd);		return 0;	}	pHba = (adpt_hba*)cmd->device->host->hostdata[0];	if (!pHba) {		return FAILED;	}	rmb();	/*	 * TODO: I need to block here if I am processing ioctl cmds	 * but if the outstanding cmds all finish before the ioctl,	 * the scsi-core will not know to start sending cmds to me again.	 * I need to a way to restart the scsi-cores queues or should I block	 * calling scsi_done on the outstanding cmds instead	 * for now we don't set the IOCTL state	 */	if(((pHba->state) & DPTI_STATE_IOCTL) || ((pHba->state) & DPTI_STATE_RESET)) {		pHba->host->last_reset = jiffies;		pHba->host->resetting = 1;		return 1;	}	// TODO if the cmd->device if offline then I may need to issue a bus rescan	// followed by a get_lct to see if the device is there anymore	if((pDev = (struct adpt_device*) (cmd->device->hostdata)) == NULL) {		/*		 * First command request for this device.  Set up a pointer		 * to the device structure.  This should be a TEST_UNIT_READY		 * command from scan_scsis_single.		 */		if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun)) == NULL) {			// TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response 			// with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue.			cmd->result = (DID_NO_CONNECT << 16);			cmd->scsi_done(cmd);			return 0;		}		cmd->device->hostdata = pDev;	}	pDev->pScsi_dev = cmd->device;	/*	 * If we are being called from when the device is being reset, 	 * delay processing of the command until later.	 */	if (pDev->state & DPTI_DEV_RESET ) {		return FAILED;	}	return adpt_scsi_to_i2o(pHba, cmd, pDev);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a5990120252539bccdaf70a66ac021966e80e3f7/dpt_i2o.c/clean/drivers/scsi/dpt_i2o.c