sp->tgt_queue = tq;  sp->lun_queue = lq; lq->io_cnt++; sp->fclun = lq->fclun;  
qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)){	scsi_qla_host_t *ha = to_qla_host(cmd->device->host);	os_tgt_t *tq = (os_tgt_t *) cmd->device->hostdata;	fc_port_t *fcport = tq->fcport;	os_lun_t *lq;	srb_t *sp;	int rval;	lq = GET_LU_Q(ha, cmd->device->id, cmd->device->lun);	if (!fcport || !lq) {		cmd->result = DID_NO_CONNECT << 16;		goto qc_fail_command;	}	if (atomic_read(&fcport->state) != FCS_ONLINE) {		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||		    atomic_read(&ha->loop_state) == LOOP_DEAD) {			cmd->result = DID_NO_CONNECT << 16;			goto qc_fail_command;		}		goto qc_host_busy;	}	spin_unlock_irq(ha->host->host_lock);	/* Allocate a command packet from the "sp" pool. */	if ((sp = qla2x00_get_new_sp(ha)) == NULL) {		goto qc_host_busy_lock;	}	sp->ha = ha;	sp->cmd = cmd;	sp->tgt_queue = tq;	sp->lun_queue = lq;	lq->io_cnt++;	sp->fclun = lq->fclun;	sp->flags = 0;	sp->err_id = 0;	CMD_SP(cmd) = (void *)sp;	cmd->scsi_done = done;	rval = qla2x00_start_scsi(sp);	if (rval != QLA_SUCCESS)		goto qc_host_busy_free_sp;	/* Manage unprocessed RIO/ZIO commands in response queue. */	if (ha->flags.online && ha->flags.process_response_queue &&	    ha->response_ring_ptr->signature != RESPONSE_PROCESSED) {		unsigned long flags;		spin_lock_irqsave(&ha->hardware_lock, flags);		qla2x00_process_response_queue(ha);		spin_unlock_irqrestore(&ha->hardware_lock, flags);	}	spin_lock_irq(ha->host->host_lock);	return 0;qc_host_busy_free_sp:	qla2x00_sp_free_dma(ha, sp);	CMD_SP(cmd) = NULL;	mempool_free(sp, ha->srb_mempool);qc_host_busy_lock:	spin_lock_irq(ha->host->host_lock);qc_host_busy:	return SCSI_MLQUEUE_HOST_BUSY;qc_fail_command:	done(cmd);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bdf796210e01145fd77bbb3ae644d04f982b6c3b/qla_os.c/buggy/drivers/scsi/qla2xxx/qla_os.c