unsigned char target = SCpnt->device->id; 
unsigned char target = scmd_id(SCpnt); 
static int nsp_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)){#ifdef NSP_DEBUG	/*unsigned int host_id = SCpnt->device->host->this_id;*/	/*unsigned int base    = SCpnt->device->host->io_port;*/	unsigned char target = SCpnt->device->id;#endif	nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;	nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "SCpnt=0x%p target=%d lun=%d buff=0x%p bufflen=%d use_sg=%d",		   SCpnt, target, SCpnt->device->lun, SCpnt->request_buffer, SCpnt->request_bufflen, SCpnt->use_sg);	//nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "before CurrentSC=0x%p", data->CurrentSC);	SCpnt->scsi_done	= done;	if (data->CurrentSC != NULL) {		nsp_msg(KERN_DEBUG, "CurrentSC!=NULL this can't be happen");		SCpnt->result   = DID_BAD_TARGET << 16;		nsp_scsi_done(SCpnt);		return 0;	}#if 0	/* XXX: pcmcia-cs generates SCSI command with "scsi_info" utility.	        This makes kernel crash when suspending... */	if (data->ScsiInfo->stop != 0) {		nsp_msg(KERN_INFO, "suspending device. reject command.");		SCpnt->result  = DID_BAD_TARGET << 16;		nsp_scsi_done(SCpnt);		return SCSI_MLQUEUE_HOST_BUSY;	}#endif	show_command(SCpnt);	data->CurrentSC		= SCpnt;	SCpnt->SCp.Status	= CHECK_CONDITION;	SCpnt->SCp.Message	= 0;	SCpnt->SCp.have_data_in = IO_UNKNOWN;	SCpnt->SCp.sent_command = 0;	SCpnt->SCp.phase	= PH_UNDETERMINED;	SCpnt->resid	        = SCpnt->request_bufflen;	/* setup scratch area	   SCp.ptr		: buffer pointer	   SCp.this_residual	: buffer length	   SCp.buffer		: next buffer	   SCp.buffers_residual : left buffers in list	   SCp.phase		: current state of the command */	if (SCpnt->use_sg) {		SCpnt->SCp.buffer	    = (struct scatterlist *) SCpnt->request_buffer;		SCpnt->SCp.ptr		    = BUFFER_ADDR;		SCpnt->SCp.this_residual    = SCpnt->SCp.buffer->length;		SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;	} else {		SCpnt->SCp.ptr		    = (char *) SCpnt->request_buffer;		SCpnt->SCp.this_residual    = SCpnt->request_bufflen;		SCpnt->SCp.buffer	    = NULL;		SCpnt->SCp.buffers_residual = 0;	}	if (nsphw_start_selection(SCpnt) == FALSE) {		nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "selection fail");		SCpnt->result   = DID_BUS_BUSY << 16;		nsp_scsi_done(SCpnt);		return 0;	}	//nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "out");#ifdef NSP_DEBUG	data->CmdId++;#endif	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/422c0d61d591cbfb70f029e13505fb437e169d68/nsp_cs.c/buggy/drivers/scsi/pcmcia/nsp_cs.c