print_msg(msg); 
scsi_print_msg(msg); 
static void NCR5380_reselect(struct Scsi_Host *instance) {	NCR5380_local_declare();	struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)	 instance->hostdata;	unsigned char target_mask;	unsigned char lun, phase;	int len;	unsigned char msg[3];	unsigned char *data;	Scsi_Cmnd *tmp = NULL, *prev;	int abort = 0;	NCR5380_setup(instance);	/*	 * Disable arbitration, etc. since the host adapter obviously	 * lost, and tell an interrupted NCR5380_select() to restart.	 */	NCR5380_write(MODE_REG, MR_BASE);	hostdata->restart_select = 1;	target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask);	dprintk(NDEBUG_SELECTION, ("scsi%d : reselect\n", instance->host_no));	/* 	 * At this point, we have detected that our SCSI ID is on the bus,	 * SEL is true and BSY was false for at least one bus settle delay	 * (400 ns).	 *	 * We must assert BSY ourselves, until the target drops the SEL	 * signal.	 */	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_BSY);	/* FIXME: timeout too long, must fail to workqueue */		if(NCR5380_poll_politely(instance, STATUS_REG, SR_SEL, 0, 2*HZ)<0)		abort = 1;			NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);	/*	 * Wait for target to go into MSGIN.	 * FIXME: timeout needed and fail to work queeu	 */	if(NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, SR_REQ, 2*HZ))		abort = 1;	len = 1;	data = msg;	phase = PHASE_MSGIN;	NCR5380_transfer_pio(instance, &phase, &len, &data);	if (!(msg[0] & 0x80)) {		printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no);		print_msg(msg);		abort = 1;	} else {		/* Accept message by clearing ACK */		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);		lun = (msg[0] & 0x07);		/* 		 * We need to add code for SCSI-II to track which devices have		 * I_T_L_Q nexuses established, and which have simple I_T_L		 * nexuses so we can chose to do additional data transfer.		 */		/* 		 * Find the command corresponding to the I_T_L or I_T_L_Q  nexus we 		 * just reestablished, and remove it from the disconnected queue.		 */		for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)			if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)			    ) {				if (prev) {					REMOVE(prev, prev->host_scribble, tmp, tmp->host_scribble);					prev->host_scribble = tmp->host_scribble;				} else {					REMOVE(-1, hostdata->disconnected_queue, tmp, tmp->host_scribble);					hostdata->disconnected_queue = (Scsi_Cmnd *) tmp->host_scribble;				}				tmp->host_scribble = NULL;				break;			}		if (!tmp) {			printk(KERN_ERR "scsi%d : warning : target bitmask %02x lun %d not in disconnect_queue.\n", instance->host_no, target_mask, lun);			/* 			 * Since we have an established nexus that we can't do anything with,			 * we must abort it.  			 */			abort = 1;		}	}	if (abort) {		do_abort(instance);	} else {		hostdata->connected = tmp;		dprintk(NDEBUG_RESELECTION, ("scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->target, tmp->lun, tmp->tag));	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/db9dff366ba78085d0323364fadbf09bec0e77ee/NCR5380.c/buggy/drivers/scsi/NCR5380.c