print_msg(msg); 
scsi_print_msg(msg); 
static void NCR5380_reselect (struct Scsi_Host *instance){    SETUP_HOSTDATA(instance);    unsigned char target_mask;    unsigned char lun, phase;    int len;#ifdef SUPPORT_TAGS    unsigned char tag;#endif    unsigned char msg[3];    unsigned char *data;    Scsi_Cmnd *tmp = NULL, *prev;/*    unsigned long flags; */    /*     * 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);    RSL_PRINTK("scsi%d: reselect\n", HOSTNO);    /*      * 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);        while (NCR5380_read(STATUS_REG) & SR_SEL);    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);    /*     * Wait for target to go into MSGIN.     */    while (!(NCR5380_read(STATUS_REG) & SR_REQ));    len = 1;    data = msg;    phase = PHASE_MSGIN;    NCR5380_transfer_pio(instance, &phase, &len, &data);    if (!(msg[0] & 0x80)) {	printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);	print_msg(msg);	do_abort(instance);	return;    }    lun = (msg[0] & 0x07);#ifdef SUPPORT_TAGS    /* If the phase is still MSGIN, the target wants to send some more     * messages. In case it supports tagged queuing, this is probably a     * SIMPLE_QUEUE_TAG for the I_T_L_Q nexus.     */    tag = TAG_NONE;    if (phase == PHASE_MSGIN && setup_use_tagged_queuing) {	/* Accept previous IDENTIFY message by clearing ACK */	NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );	len = 2;	data = msg+1;	if (!NCR5380_transfer_pio(instance, &phase, &len, &data) &&	    msg[1] == SIMPLE_QUEUE_TAG)	    tag = msg[2];	TAG_PRINTK("scsi%d: target mask %02x, lun %d sent tag %d at "		   "reselection\n", HOSTNO, target_mask, lun, tag);    }#endif        /*      * 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 = NEXT(tmp) ) {	if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)#ifdef SUPPORT_TAGS	    && (tag == tmp->tag) #endif	    ) {	    /* ++guenther: prevent race with falcon_release_lock */	    falcon_dont_release++;	    if (prev) {		REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));		NEXT(prev) = NEXT(tmp);	    } else {		REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));		hostdata->disconnected_queue = NEXT(tmp);	    }	    NEXT(tmp) = NULL;	    break;	}    }        if (!tmp) {	printk(KERN_WARNING "scsi%d: warning: target bitmask %02x lun %d "#ifdef SUPPORT_TAGS		"tag %d "#endif		"not in disconnected_queue.\n",		HOSTNO, target_mask, lun#ifdef SUPPORT_TAGS		, tag#endif		);	/* 	 * Since we have an established nexus that we can't do anything	 * with, we must abort it.  	 */	do_abort(instance);	return;    }    /* Accept message by clearing ACK */    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);    hostdata->connected = tmp;    RSL_PRINTK("scsi%d: nexus established, target = %d, lun = %d, tag = %d\n",	       HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag);    falcon_dont_release--;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/db9dff366ba78085d0323364fadbf09bec0e77ee/atari_NCR5380.c/clean/drivers/scsi/atari_NCR5380.c