DEBUG2(printk(KERN_INFO "%s failed:board disabled\n",__func__));  
qla2xxx_eh_device_reset(struct scsi_cmnd *cmd){	int		return_status;	unsigned int	b, t, l;	scsi_qla_host_t	*ha;	os_tgt_t	*tq;	os_lun_t	*lq;	fc_port_t	*fcport_to_reset;	srb_t		*rp;	struct list_head *list, *temp;	return_status = FAILED;	if (cmd == NULL) {		printk(KERN_INFO		    "%s(): **** SCSI mid-layer passing in NULL cmd\n",		    __func__);		return (return_status);	}	b = cmd->device->channel;	t = cmd->device->id;	l = cmd->device->lun;	ha = (scsi_qla_host_t *)cmd->device->host->hostdata;	tq = TGT_Q(ha, t);	if (tq == NULL) {		qla_printk(KERN_INFO, ha,		    "%s(): **** CMD derives a NULL TGT_Q\n", __func__);		return (return_status);	}	lq = (os_lun_t *)LUN_Q(ha, t, l);	if (lq == NULL) {		printk(KERN_INFO		    "%s(): **** CMD derives a NULL LUN_Q\n", __func__);		return (return_status);	}	fcport_to_reset = lq->fclun->fcport;	/* If we are coming in from the back-door, stall I/O until complete. */	if (!cmd->device->host->eh_active)		set_bit(TQF_SUSPENDED, &tq->flags);	qla_printk(KERN_INFO, ha,	    "scsi(%ld:%d:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, b, t, l);	DEBUG2(printk(KERN_INFO	    "scsi(%ld): DEVICE_RESET cmd=%p jiffies = 0x%lx, timeout=%x, "	    "dpc_flags=%lx, status=%x allowed=%d cmd.state=%x\n",	    ha->host_no, cmd, jiffies, cmd->timeout_per_command / HZ,	    ha->dpc_flags, cmd->result, cmd->allowed, cmd->state)); 	/* Clear commands from the retry queue. */ 	spin_lock(&ha->list_lock); 	list_for_each_safe(list, temp, &ha->retry_queue) { 		rp = list_entry(list, srb_t, list);  		if (t != rp->cmd->device->id)  			continue;  		DEBUG2(printk(KERN_INFO		    "qla2xxx_eh_reset: found in retry queue. SP=%p\n", rp));  		__del_from_retry_queue(ha, rp); 		rp->cmd->result = DID_RESET << 16; 		__add_to_done_queue(ha, rp); 	} 	spin_unlock(&ha->list_lock);	spin_unlock_irq(ha->host->host_lock);	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {		DEBUG2(printk(KERN_INFO		    "%s failed:board disabled\n",__func__));		spin_lock_irq(ha->host->host_lock);		goto eh_dev_reset_done;	}	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {		if (qla2x00_device_reset(ha, fcport_to_reset) == 0) {			return_status = SUCCESS;		}#if defined(LOGOUT_AFTER_DEVICE_RESET)		if (return_status == SUCCESS) {			if (fcport_to_reset->flags & FC_FABRIC_DEVICE) {				qla2x00_fabric_logout(ha,				    fcport_to_reset->loop_id);				qla2x00_mark_device_lost(ha, fcport_to_reset);			}		}#endif	} else {		DEBUG2(printk(KERN_INFO		    "%s failed: loop not ready\n",__func__);)	}	spin_lock_irq(ha->host->host_lock);	if (return_status == FAILED) {		DEBUG3(printk("%s(%ld): device reset failed\n",		    __func__, ha->host_no));		qla_printk(KERN_INFO, ha, "%s: device reset failed\n",		    __func__);		goto eh_dev_reset_done;	}	/*	 * If we are coming down the EH path, wait for all commands to	 * complete for the device.	 */	if (cmd->device->host->eh_active) {		if (qla2x00_eh_wait_for_pending_target_commands(ha, t))			return_status = FAILED;		if (return_status == FAILED) {			DEBUG3(printk("%s(%ld): failed while waiting for "			    "commands\n", __func__, ha->host_no));			qla_printk(KERN_INFO, ha,			    "%s: failed while waiting for commands\n",			    __func__); 			goto eh_dev_reset_done;		}	}	qla_printk(KERN_INFO, ha,	    "scsi(%ld:%d:%d:%d): DEVICE RESET SUCCEEDED.\n",	    ha->host_no, b, t, l);eh_dev_reset_done:	if (!cmd->device->host->eh_active)		clear_bit(TQF_SUSPENDED, &tq->flags);	return (return_status);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f4f051ebb40e74ad0ba02d2cb3a6c16b0393472b/qla_os.c/clean/drivers/scsi/qla2xxx/qla_os.c