print_Scsi_Cmnd(cmd); 
scsi_print_command(cmd); 
static int NCR5380_abort(Scsi_Cmnd * cmd) {	NCR5380_local_declare();	struct Scsi_Host *instance = cmd->device->host;	struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;	Scsi_Cmnd *tmp, **prev;		printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no);	print_Scsi_Cmnd(cmd);	NCR5380_print_status(instance);	NCR5380_setup(instance);	dprintk(NDEBUG_ABORT, ("scsi%d : abort called\n", instance->host_no));	dprintk(NDEBUG_ABORT, ("        basr 0x%X, sr 0x%X\n", NCR5380_read(BUS_AND_STATUS_REG), NCR5380_read(STATUS_REG)));#if 0/* * Case 1 : If the command is the currently executing command,  * we'll set the aborted flag and return control so that  * information transfer routine can exit cleanly. */	if (hostdata->connected == cmd) {		dprintk(NDEBUG_ABORT, ("scsi%d : aborting connected command\n", instance->host_no));		hostdata->aborted = 1;/* * We should perform BSY checking, and make sure we haven't slipped * into BUS FREE. */		NCR5380_write(INITIATOR_COMMAND_REG, ICR_ASSERT_ATN);/*  * Since we can't change phases until we've completed the current  * handshake, we have to source or sink a byte of data if the current * phase is not MSGOUT. *//*  * Return control to the executing NCR drive so we can clear the * aborted flag and get back into our main loop. */		return 0;	}#endif/*  * Case 2 : If the command hasn't been issued yet, we simply remove it  *          from the issue queue. */ 	dprintk(NDEBUG_ABORT, ("scsi%d : abort going into loop.\n", instance->host_no));	for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue), tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble)		if (cmd == tmp) {			REMOVE(5, *prev, tmp, tmp->host_scribble);			(*prev) = (Scsi_Cmnd *) tmp->host_scribble;			tmp->host_scribble = NULL;			tmp->result = DID_ABORT << 16;			dprintk(NDEBUG_ABORT, ("scsi%d : abort removed command from issue queue.\n", instance->host_no));			tmp->done(tmp);			return SUCCESS;		}#if (NDEBUG  & NDEBUG_ABORT)	/* KLL */		else if (prev == tmp)			printk(KERN_ERR "scsi%d : LOOP\n", instance->host_no);#endif/*  * Case 3 : If any commands are connected, we're going to fail the abort *          and let the high level SCSI driver retry at a later time or  *          issue a reset. * *          Timeouts, and therefore aborted commands, will be highly unlikely *          and handling them cleanly in this situation would make the common *          case of noresets less efficient, and would pollute our code.  So, *          we fail. */	if (hostdata->connected) {		dprintk(NDEBUG_ABORT, ("scsi%d : abort failed, command connected.\n", instance->host_no));		return FAILED;	}/* * Case 4: If the command is currently disconnected from the bus, and  *      there are no connected commands, we reconnect the I_T_L or  *      I_T_L_Q nexus associated with it, go into message out, and send  *      an abort message. * * This case is especially ugly. In order to reestablish the nexus, we * need to call NCR5380_select().  The easiest way to implement this  * function was to abort if the bus was busy, and let the interrupt * handler triggered on the SEL for reselect take care of lost arbitrations * where necessary, meaning interrupts need to be enabled. * * When interrupts are enabled, the queues may change - so we  * can't remove it from the disconnected queue before selecting it * because that could cause a failure in hashing the nexus if that  * device reselected. *  * Since the queues may change, we can't use the pointers from when we * first locate it. * * So, we must first locate the command, and if NCR5380_select() * succeeds, then issue the abort, relocate the command and remove * it from the disconnected queue. */	for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; tmp = (Scsi_Cmnd *) tmp->host_scribble)		if (cmd == tmp) {			dprintk(NDEBUG_ABORT, ("scsi%d : aborting disconnected command.\n", instance->host_no));			if (NCR5380_select(instance, cmd, (int) cmd->tag))				return FAILED;			dprintk(NDEBUG_ABORT, ("scsi%d : nexus reestablished.\n", instance->host_no));			do_abort(instance);			for (prev = (Scsi_Cmnd **) & (hostdata->disconnected_queue), tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble)				if (cmd == tmp) {					REMOVE(5, *prev, tmp, tmp->host_scribble);					*prev = (Scsi_Cmnd *) tmp->host_scribble;					tmp->host_scribble = NULL;					tmp->result = DID_ABORT << 16;					tmp->done(tmp);					return SUCCESS;				}		}/* * Case 5 : If we reached this point, the command was not found in any of  *          the queues. * * We probably reached this point because of an unlikely race condition * between the command completing successfully and the abortion code, * so we won't panic, but we will notify the user in case something really * broke. */	printk(KERN_WARNING "scsi%d : warning : SCSI command probably completed successfully\n"			"         before abortion\n", instance->host_no);	return FAILED;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1409277c4aad2e87ad27b2b8a6901ce78eaf8081/NCR5380.c/buggy/drivers/scsi/NCR5380.c