/* * 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, id)) ret = FAILED; 
/* Flush outstanding commands. */ if (qla2x00_eh_wait_for_pending_target_commands(ha, id)) ret = FAILED; if (ret == 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__); } else qla_printk(KERN_INFO, ha, "scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun); 
qla2xxx_eh_device_reset(struct scsi_cmnd *cmd){	scsi_qla_host_t *ha = to_qla_host(cmd->device->host);	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;	srb_t *sp;	int ret;	unsigned int id, lun;	unsigned long serial;	ret = FAILED;	id = cmd->device->id;	lun = cmd->device->lun;	serial = cmd->serial_number;	sp = (srb_t *) CMD_SP(cmd);	if (!sp || !fcport)		return ret;	qla_printk(KERN_INFO, ha,	    "scsi(%ld:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, id, lun);	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)		goto eh_dev_reset_done;	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {		if (qla2x00_device_reset(ha, fcport) == 0)			ret = SUCCESS;#if defined(LOGOUT_AFTER_DEVICE_RESET)		if (ret == SUCCESS) {			if (fcport->flags & FC_FABRIC_DEVICE) {				ha->isp_ops.fabric_logout(ha, fcport->loop_id);				qla2x00_mark_device_lost(ha, fcport);			}		}#endif	} else {		DEBUG2(printk(KERN_INFO		    "%s failed: loop not ready\n",__func__);)	}	if (ret == 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, id))			ret = FAILED;		if (ret == 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): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun);eh_dev_reset_done:	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/9a41a62b74388827998253d62c58707e63cc5874/qla_os.c/buggy/drivers/scsi/qla2xxx/qla_os.c