 list_remove_head(scsi_buf_list, lpfc_cmd, struct lpfc_scsi_buf, list); 
lpfc_cmd = lpfc_sli_get_scsi_buf (phba); 
lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)){	struct lpfc_hba *phba =		(struct lpfc_hba *) cmnd->device->host->hostdata[0];	struct lpfc_sli *psli = &phba->sli;	struct lpfc_rport_data *rdata = cmnd->device->hostdata;	struct lpfc_nodelist *ndlp = rdata->pnode;	struct lpfc_scsi_buf *lpfc_cmd = NULL;	struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));	struct list_head *scsi_buf_list = &phba->lpfc_scsi_buf_list;	int err;	err = fc_remote_port_chkready(rport);	if (err) {		cmnd->result = err;		goto out_fail_command;	}	/*	 * Catch race where our node has transitioned, but the	 * transport is still transitioning.	 */	if (!ndlp) {		cmnd->result = ScsiResult(DID_BUS_BUSY, 0);		goto out_fail_command;	}	list_remove_head(scsi_buf_list, lpfc_cmd, struct lpfc_scsi_buf, list);	if (lpfc_cmd == NULL) {		printk(KERN_WARNING "%s: No buffer available - list empty, "		       "total count %d\n", __FUNCTION__, phba->total_scsi_bufs);		goto out_host_busy;	}	/*	 * Store the midlayer's command structure for the completion phase	 * and complete the command initialization.	 */	lpfc_cmd->pCmd  = cmnd;	lpfc_cmd->rdata = rdata;	lpfc_cmd->timeout = 0;	cmnd->host_scribble = (unsigned char *)lpfc_cmd;	cmnd->scsi_done = done;	err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);	if (err)		goto out_host_busy_free_buf;	lpfc_scsi_prep_cmnd(phba, lpfc_cmd, ndlp);	err = lpfc_sli_issue_iocb(phba, &phba->sli.ring[psli->fcp_ring],				&lpfc_cmd->cur_iocbq, SLI_IOCB_RET_IOCB);	if (err)		goto out_host_busy_free_buf;	return 0; out_host_busy_free_buf:	lpfc_free_scsi_buf(lpfc_cmd);	cmnd->host_scribble = NULL; out_host_busy:	return SCSI_MLQUEUE_HOST_BUSY; out_fail_command:	done(cmnd);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0bd4ca25ad2ace4aa717c83dbd4ed21c53c953cb/lpfc_scsi.c/clean/drivers/scsi/lpfc/lpfc_scsi.c