Lines Matching refs:lpfc_cmd
94 * @lpfc_cmd: lpfc scsi command object pointer.
101 struct lpfc_io_buf *lpfc_cmd)
103 struct sli4_sge *sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl;
563 struct lpfc_io_buf *lpfc_cmd = NULL;
568 list_remove_head(scsi_buf_list_get, lpfc_cmd, struct lpfc_io_buf,
570 if (!lpfc_cmd) {
575 list_remove_head(scsi_buf_list_get, lpfc_cmd,
581 if (lpfc_ndlp_check_qdepth(phba, ndlp) && lpfc_cmd) {
583 lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH;
585 return lpfc_cmd;
604 struct lpfc_io_buf *lpfc_cmd;
621 lpfc_cmd = lpfc_get_io_buf(phba, ndlp, idx,
623 if (!lpfc_cmd) {
632 lpfc_cmd->cur_iocbq.cmd_flag = LPFC_IO_FCP;
633 lpfc_cmd->prot_seg_cnt = 0;
634 lpfc_cmd->seg_cnt = 0;
635 lpfc_cmd->timeout = 0;
636 lpfc_cmd->flags = 0;
637 lpfc_cmd->start_time = jiffies;
638 lpfc_cmd->waitq = NULL;
639 lpfc_cmd->cpu = cpu;
641 lpfc_cmd->prot_data_type = 0;
643 tmp = lpfc_get_cmd_rsp_buf_per_hdwq(phba, lpfc_cmd);
645 lpfc_release_io_buf(phba, lpfc_cmd, lpfc_cmd->hdwq);
649 lpfc_cmd->fcp_cmnd = tmp->fcp_cmnd;
650 lpfc_cmd->fcp_rsp = tmp->fcp_rsp;
657 sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl;
678 lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH;
680 return lpfc_cmd;
797 * @lpfc_cmd: The scsi buffer which is going to be mapped.
800 * field of @lpfc_cmd for device with SLI-3 interface spec. This routine scans
809 lpfc_scsi_prep_dma_buf_s3(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
811 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
813 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
814 struct ulp_bde64 *bpl = (struct ulp_bde64 *)lpfc_cmd->dma_sgl;
815 struct lpfc_iocbq *iocbq = &lpfc_cmd->cur_iocbq;
816 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
842 lpfc_cmd->seg_cnt = nseg;
843 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) {
848 lpfc_cmd->seg_cnt);
849 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
850 lpfc_cmd->seg_cnt = 0;
903 physaddr = lpfc_cmd->dma_handle;
963 struct lpfc_io_buf *lpfc_cmd = NULL;
1022 lpfc_cmd = (struct lpfc_io_buf *)sc->host_scribble;
1050 if (lpfc_cmd) {
1051 lpfc_cmd->prot_data_type =
1053 lpfc_cmd->prot_data_segment =
1055 lpfc_cmd->prot_data =
1171 if (lpfc_cmd) {
1172 lpfc_cmd->prot_data_type =
1174 lpfc_cmd->prot_data_segment =
1176 lpfc_cmd->prot_data =
1897 * @lpfc_cmd: lpfc scsi command object pointer.
1924 struct lpfc_io_buf *lpfc_cmd)
2012 sgl_xtra = lpfc_get_sgl_per_hdwq(phba, lpfc_cmd);
2015 lpfc_cmd->seg_cnt = 0;
2071 * @lpfc_cmd: lpfc scsi command object pointer.
2105 struct lpfc_io_buf *lpfc_cmd)
2174 sgl_xtra = lpfc_get_sgl_per_hdwq(phba, lpfc_cmd);
2300 lpfc_cmd);
2442 * @lpfc_cmd: The scsi buffer which is going to be adjusted.
2451 struct lpfc_io_buf *lpfc_cmd)
2453 struct scsi_cmnd *sc = lpfc_cmd->pCmd;
2483 * @lpfc_cmd: The scsi buffer which is going to be prep'ed.
2494 struct lpfc_io_buf *lpfc_cmd)
2496 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
2497 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
2498 struct ulp_bde64 *bpl = (struct ulp_bde64 *)lpfc_cmd->dma_sgl;
2499 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
2525 lpfc_cmd->seg_cnt = datasegcnt;
2528 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) {
2529 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
2540 if ((lpfc_cmd->seg_cnt + 2) > phba->cfg_total_seg_cnt) {
2568 lpfc_cmd->prot_seg_cnt = protsegcnt;
2574 if ((lpfc_cmd->prot_seg_cnt * 4) >
2593 lpfc_cmd->seg_cnt = 0;
2613 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd);
2632 if (lpfc_cmd->seg_cnt)
2634 if (lpfc_cmd->prot_seg_cnt)
2642 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
2646 lpfc_cmd->seg_cnt = 0;
2647 lpfc_cmd->prot_seg_cnt = 0;
2686 lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
2690 struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
2720 protsegcnt = lpfc_cmd->prot_seg_cnt;
2865 lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
2868 struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
3025 lpfc_calc_bg_err(phba, lpfc_cmd);
3034 * @lpfc_cmd: The scsi buffer which is going to be mapped.
3037 * field of @lpfc_cmd for device with SLI-4 interface spec.
3045 lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
3047 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
3049 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
3050 struct sli4_sge *sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl;
3052 struct lpfc_iocbq *pwqeq = &lpfc_cmd->cur_iocbq;
3087 lpfc_cmd->seg_cnt = nseg;
3089 lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) {
3095 lpfc_cmd->seg_cnt);
3096 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
3097 lpfc_cmd->seg_cnt = 0;
3133 phba, lpfc_cmd);
3136 lpfc_cmd->seg_cnt = 0;
3256 lpfc_cmd->cur_iocbq.cmd_flag |= (LPFC_IO_OAS | LPFC_IO_FOF);
3257 lpfc_cmd->cur_iocbq.priority = ((struct lpfc_device_data *)
3264 if (lpfc_cmd->cur_iocbq.priority)
3266 (lpfc_cmd->cur_iocbq.priority << 1));
3278 * @lpfc_cmd: The scsi buffer which is going to be mapped.
3290 struct lpfc_io_buf *lpfc_cmd)
3292 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
3293 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
3294 struct sli4_sge *sgl = (struct sli4_sge *)(lpfc_cmd->dma_sgl);
3295 struct lpfc_iocbq *pwqeq = &lpfc_cmd->cur_iocbq;
3328 lpfc_cmd->seg_cnt = datasegcnt;
3331 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt &&
3333 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
3343 if (((lpfc_cmd->seg_cnt + 1) >
3351 datasegcnt, lpfc_cmd);
3374 lpfc_cmd->prot_seg_cnt = protsegcnt;
3379 if (((lpfc_cmd->prot_seg_cnt * 3) >
3387 datasegcnt, protsegcnt, lpfc_cmd);
3401 lpfc_cmd->seg_cnt = 0;
3413 lpfc_cmd->cur_iocbq.cmd_flag |= LPFC_IO_DIF_STRIP;
3417 lpfc_cmd->cur_iocbq.cmd_flag |= LPFC_IO_DIF_INSERT;
3421 lpfc_cmd->cur_iocbq.cmd_flag |= LPFC_IO_DIF_PASS;
3425 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd);
3452 lpfc_cmd->cur_iocbq.cmd_flag |= (LPFC_IO_OAS | LPFC_IO_FOF);
3462 if (lpfc_cmd->cur_iocbq.cmd_flag & LPFC_IO_DIF_PASS)
3464 else if (lpfc_cmd->cur_iocbq.cmd_flag & LPFC_IO_DIF_STRIP)
3466 else if (lpfc_cmd->cur_iocbq.cmd_flag & LPFC_IO_DIF_INSERT)
3469 lpfc_cmd->cur_iocbq.cmd_flag &= ~(LPFC_IO_DIF_PASS |
3474 if (lpfc_cmd->seg_cnt)
3476 if (lpfc_cmd->prot_seg_cnt)
3484 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
3488 lpfc_cmd->seg_cnt = 0;
3489 lpfc_cmd->prot_seg_cnt = 0;
3496 * @lpfc_cmd: The scsi buffer which is going to be mapped.
3506 lpfc_scsi_prep_dma_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
3508 return phba->lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);
3515 * @lpfc_cmd: The scsi buffer which is going to be mapped.
3525 lpfc_bg_scsi_prep_dma_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
3527 return phba->lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd);
3534 * @lpfc_cmd: The scsi buffer which is going to be mapped.
3544 lpfc_scsi_prep_cmnd_buf(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd,
3547 return vport->phba->lpfc_scsi_prep_cmnd_buf(vport, lpfc_cmd, tmo);
3554 * @lpfc_cmd: Pointer to lpfc scsi command which reported the error.
3562 struct lpfc_io_buf *lpfc_cmd, uint32_t fcpi_parm) {
3563 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
3564 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
3568 struct lpfc_nodelist *pnode = lpfc_cmd->rdata->pnode;
3650 * field of @lpfc_cmd for device with SLI-3 interface spec.
3810 * @lpfc_cmd: Pointer to lpfc_io_buf data structure.
3818 lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd,
3821 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
3822 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd;
3823 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
3835 * scsi packet associated with this lpfc_cmd. The driver
3988 lpfc_send_scsi_error_event(vport->phba, vport, lpfc_cmd, fcpi_parm);
4005 struct lpfc_io_buf *lpfc_cmd = pwqeIn->io_buf;
4020 if (!lpfc_cmd) {
4022 "9032 Null lpfc_cmd pointer. No "
4027 rdata = lpfc_cmd->rdata;
4031 cmd = lpfc_cmd->pCmd;
4035 lpfc_release_scsi_buf(phba, lpfc_cmd);
4039 spin_lock(&lpfc_cmd->buf_lock);
4040 idx = lpfc_cmd->cur_iocbq.hba_wqidx;
4050 lpfc_cmd->status = bf_get(lpfc_wcqe_c_status, wcqe);
4051 lpfc_cmd->result = (wcqe->parameter & IOERR_PARAM_MASK);
4053 lpfc_cmd->flags &= ~LPFC_SBUF_XBUSY;
4055 lpfc_cmd->flags |= LPFC_SBUF_XBUSY;
4061 if (lpfc_cmd->prot_data_type) {
4064 src = (struct scsi_dif_tuple *)lpfc_cmd->prot_data_segment;
4069 switch (lpfc_cmd->prot_data_type) {
4072 lpfc_cmd->prot_data;
4076 (uint16_t)lpfc_cmd->prot_data;
4080 (uint16_t)lpfc_cmd->prot_data;
4086 lpfc_cmd->prot_data = 0;
4087 lpfc_cmd->prot_data_type = 0;
4088 lpfc_cmd->prot_data_segment = NULL;
4091 if (unlikely(lpfc_cmd->status)) {
4092 if (lpfc_cmd->status == IOSTAT_FCP_RSP_ERROR &&
4093 !lpfc_cmd->fcp_rsp->rspStatus3 &&
4094 (lpfc_cmd->fcp_rsp->rspStatus2 & RESID_UNDER) &&
4107 lpfc_cmd->status, lpfc_cmd->result,
4110 lpfc_cmd->cur_iocbq.sli4_xritag,
4112 lpfc_cmd->cur_iocbq.iotag);
4115 switch (lpfc_cmd->status) {
4120 lpfc_handle_fcp_err(vport, lpfc_cmd,
4133 (lpfc_cmd->status == IOSTAT_NPORT_BSY) ?
4160 lpfc_cmd->status, lpfc_cmd->result,
4163 lpfc_cmd->cur_iocbq.sli4_xritag,
4166 lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
4170 lpfc_cmd->result = IOERR_RX_DMA_FAILED;
4172 lpfc_cmd->result = IOERR_TX_DMA_FAILED;
4176 lpfc_cmd->cur_iocbq.sli4_xritag,
4177 lpfc_cmd->status, wcqe->parameter,
4181 lpfc_parse_bg_err(phba, lpfc_cmd, pwqeOut);
4195 lpfc_cmd->cur_iocbq.sli4_lxritag,
4200 if (lpfc_cmd->result & IOERR_DRVR_MASK)
4201 lpfc_cmd->status = IOSTAT_DRIVER_REJECT;
4202 if (lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_ERROR ||
4203 lpfc_cmd->result ==
4205 lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR ||
4206 lpfc_cmd->result ==
4211 if (lpfc_cmd->result == IOERR_INVALID_RPI ||
4212 lpfc_cmd->result == IOERR_LINK_DOWN ||
4213 lpfc_cmd->result == IOERR_NO_RESOURCES ||
4214 lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
4215 lpfc_cmd->result == IOERR_RPI_SUSPENDED ||
4216 lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
4229 lpfc_cmd->status, lpfc_cmd->result,
4232 lpfc_cmd->cur_iocbq.sli4_xritag,
4235 lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
4243 lpfc_cmd->cur_iocbq.sli4_xritag,
4244 lpfc_cmd->status, lpfc_cmd->result,
4248 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
4262 time_after(jiffies, lpfc_cmd->start_time +
4279 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
4282 if (lpfc_cmd->ts_cmd_start) {
4283 lpfc_cmd->ts_isr_cmpl = lpfc_cmd->cur_iocbq.isr_timestamp;
4284 lpfc_cmd->ts_data_io = ktime_get_ns();
4285 phba->ktime_last_cmd = lpfc_cmd->ts_data_io;
4286 lpfc_io_ktime(phba, lpfc_cmd);
4290 lpfc_cmd->pCmd = NULL;
4291 spin_unlock(&lpfc_cmd->buf_lock);
4298 lat = ktime_get_ns() - lpfc_cmd->rx_cmd_start;
4312 spin_lock(&lpfc_cmd->buf_lock);
4313 lpfc_cmd->cur_iocbq.cmd_flag &= ~LPFC_DRIVER_ABORTED;
4314 if (lpfc_cmd->waitq)
4315 wake_up(lpfc_cmd->waitq);
4316 spin_unlock(&lpfc_cmd->buf_lock);
4318 lpfc_release_scsi_buf(phba, lpfc_cmd);
4335 struct lpfc_io_buf *lpfc_cmd =
4338 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
4348 spin_lock(&lpfc_cmd->buf_lock);
4351 cmd = lpfc_cmd->pCmd;
4355 spin_unlock(&lpfc_cmd->buf_lock);
4359 idx = lpfc_cmd->cur_iocbq.hba_wqidx;
4369 lpfc_cmd->result = (pIocbOut->iocb.un.ulpWord[4] & IOERR_PARAM_MASK);
4370 lpfc_cmd->status = pIocbOut->iocb.ulpStatus;
4372 lpfc_cmd->flags &= ~LPFC_SBUF_XBUSY;
4374 lpfc_cmd->flags |= LPFC_SBUF_XBUSY;
4377 if (lpfc_cmd->prot_data_type) {
4380 src = (struct scsi_dif_tuple *)lpfc_cmd->prot_data_segment;
4385 switch (lpfc_cmd->prot_data_type) {
4388 lpfc_cmd->prot_data;
4392 (uint16_t)lpfc_cmd->prot_data;
4396 (uint16_t)lpfc_cmd->prot_data;
4402 lpfc_cmd->prot_data = 0;
4403 lpfc_cmd->prot_data_type = 0;
4404 lpfc_cmd->prot_data_segment = NULL;
4408 if (unlikely(lpfc_cmd->status)) {
4409 if (lpfc_cmd->status == IOSTAT_LOCAL_REJECT &&
4410 (lpfc_cmd->result & IOERR_DRVR_MASK))
4411 lpfc_cmd->status = IOSTAT_DRIVER_REJECT;
4412 else if (lpfc_cmd->status >= IOSTAT_CNT)
4413 lpfc_cmd->status = IOSTAT_DEFAULT;
4414 if (lpfc_cmd->status == IOSTAT_FCP_RSP_ERROR &&
4415 !lpfc_cmd->fcp_rsp->rspStatus3 &&
4416 (lpfc_cmd->fcp_rsp->rspStatus2 & RESID_UNDER) &&
4429 lpfc_cmd->status, lpfc_cmd->result,
4433 lpfc_cmd->cur_iocbq.sli4_xritag : 0xffff,
4435 lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
4437 switch (lpfc_cmd->status) {
4440 lpfc_handle_fcp_err(vport, lpfc_cmd,
4452 (lpfc_cmd->status == IOSTAT_NPORT_BSY) ?
4473 if (lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_ERROR ||
4474 lpfc_cmd->result ==
4476 lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR ||
4477 lpfc_cmd->result ==
4482 if (lpfc_cmd->result == IOERR_INVALID_RPI ||
4483 lpfc_cmd->result == IOERR_NO_RESOURCES ||
4484 lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
4485 lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
4489 if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
4490 lpfc_cmd->result == IOERR_TX_DMA_FAILED) &&
4497 lpfc_parse_bg_err(phba, lpfc_cmd,
4507 if ((lpfc_cmd->status == IOSTAT_REMOTE_STOP)
4515 lpfc_cmd->cur_iocbq.sli4_lxritag,
4530 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
4542 time_after(jiffies, lpfc_cmd->start_time +
4559 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
4561 lpfc_cmd->pCmd = NULL;
4562 spin_unlock(&lpfc_cmd->buf_lock);
4565 if (lpfc_cmd->ts_cmd_start) {
4566 lpfc_cmd->ts_isr_cmpl = pIocbIn->isr_timestamp;
4567 lpfc_cmd->ts_data_io = ktime_get_ns();
4568 phba->ktime_last_cmd = lpfc_cmd->ts_data_io;
4569 lpfc_io_ktime(phba, lpfc_cmd);
4580 spin_lock(&lpfc_cmd->buf_lock);
4581 lpfc_cmd->cur_iocbq.cmd_flag &= ~LPFC_DRIVER_ABORTED;
4582 if (lpfc_cmd->waitq)
4583 wake_up(lpfc_cmd->waitq);
4584 spin_unlock(&lpfc_cmd->buf_lock);
4586 lpfc_release_scsi_buf(phba, lpfc_cmd);
4592 * @lpfc_cmd: The scsi buffer which is going to be prep'ed.
4602 struct lpfc_io_buf *lpfc_cmd,
4605 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
4606 struct lpfc_iocbq *piocbq = &lpfc_cmd->cur_iocbq;
4607 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
4608 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
4609 struct lpfc_nodelist *pnode = lpfc_cmd->ndlp;
4658 piocbq->io_buf = lpfc_cmd;
4669 * @lpfc_cmd: The scsi buffer which is going to be prep'ed.
4679 struct lpfc_io_buf *lpfc_cmd,
4683 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
4684 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
4686 struct lpfc_iocbq *pwqeq = &lpfc_cmd->cur_iocbq;
4687 struct lpfc_nodelist *pnode = lpfc_cmd->ndlp;
4689 u16 idx = lpfc_cmd->hdwq_no;
4770 pwqeq->io_buf = lpfc_cmd;
4771 pwqeq->hba_wqidx = lpfc_cmd->hdwq_no;
4780 * @lpfc_cmd: The scsi command which needs to send.
4787 lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd,
4790 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd;
4791 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
4797 lpfc_cmd->fcp_rsp->rspSnsLen = 0;
4799 lpfc_cmd->fcp_cmnd->fcpCntl2 = 0;
4801 int_to_scsilun(lpfc_cmd->pCmd->device->lun,
4802 &lpfc_cmd->fcp_cmnd->fcp_lun);
4813 lpfc_scsi_prep_cmnd_buf(vport, lpfc_cmd, lpfc_cmd->timeout);
4821 * @lpfc_cmd: Pointer to lpfc_io_buf data structure.
4834 struct lpfc_io_buf *lpfc_cmd,
4840 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
4846 piocbq = &(lpfc_cmd->cur_iocbq);
4851 fcp_cmnd = lpfc_cmd->fcp_cmnd;
4866 if (lpfc_cmd->timeout > 0xff) {
4873 piocb->ulpTimeout = lpfc_cmd->timeout;
4881 * @lpfc_cmd: Pointer to lpfc_io_buf data structure.
4894 struct lpfc_io_buf *lpfc_cmd,
4897 struct lpfc_iocbq *pwqeq = &lpfc_cmd->cur_iocbq;
4900 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
4914 fcp_cmnd = lpfc_cmd->fcp_cmnd;
4932 if (lpfc_cmd->timeout > 0xff) {
4939 bf_set(wqe_tmo, &wqe->fcp_icmd.wqe_com, lpfc_cmd->timeout);
4942 lpfc_prep_embed_io(vport->phba, lpfc_cmd);
4947 lpfc_sli4_set_rsp_sgl_last(vport->phba, lpfc_cmd);
5003 * routine. This routine release scsi buffer associated with lpfc_cmd.
5010 struct lpfc_io_buf *lpfc_cmd = cmdiocbq->io_buf;
5011 if (lpfc_cmd)
5012 lpfc_release_scsi_buf(phba, lpfc_cmd);
5219 struct lpfc_io_buf *lpfc_cmd;
5299 lpfc_cmd = lpfc_get_scsi_buf(phba, ndlp, cmnd);
5300 if (lpfc_cmd == NULL) {
5308 lpfc_cmd->rx_cmd_start = start;
5310 cur_iocbq = &lpfc_cmd->cur_iocbq;
5315 lpfc_cmd->pCmd = cmnd;
5316 lpfc_cmd->rdata = rdata;
5317 lpfc_cmd->ndlp = ndlp;
5319 cmnd->host_scribble = (unsigned char *)lpfc_cmd;
5321 err = lpfc_scsi_prep_cmnd(vport, lpfc_cmd, ndlp);
5337 err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd);
5349 err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);
5388 lpfc_cmd->ts_cmd_start = start;
5389 lpfc_cmd->ts_last_cmd = phba->ktime_last_cmd;
5390 lpfc_cmd->ts_cmd_wqput = ktime_get_ns();
5392 lpfc_cmd->ts_cmd_start = 0;
5429 lpfc_keep_pvt_pool_above_lowwm(phba, lpfc_cmd->hdwq_no);
5434 idx = lpfc_cmd->hdwq_no;
5435 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
5437 switch (lpfc_cmd->fcp_cmnd->fcpCntl3) {
5449 lpfc_release_scsi_buf(phba, lpfc_cmd);
5462 lpfc_release_scsi_buf(phba, lpfc_cmd);
5515 struct lpfc_io_buf *lpfc_cmd;
5527 lpfc_cmd = (struct lpfc_io_buf *)cmnd->host_scribble;
5528 if (!lpfc_cmd)
5532 spin_lock_irqsave(&lpfc_cmd->buf_lock, flags);
5544 if (!lpfc_cmd->pCmd) {
5552 iocb = &lpfc_cmd->cur_iocbq;
5575 if (lpfc_cmd->pCmd != cmnd) {
5582 WARN_ON(iocb->io_buf != lpfc_cmd);
5591 spin_unlock_irqrestore(&lpfc_cmd->buf_lock, flags);
5595 lpfc_cmd->waitq = &waitq;
5611 lpfc_cmd->waitq = NULL;
5618 spin_unlock_irqrestore(&lpfc_cmd->buf_lock, flags);
5630 (lpfc_cmd->pCmd != cmnd),
5633 spin_lock(&lpfc_cmd->buf_lock);
5635 if (lpfc_cmd->pCmd == cmnd) {
5645 lpfc_cmd->waitq = NULL;
5647 spin_unlock(&lpfc_cmd->buf_lock);
5655 spin_unlock_irqrestore(&lpfc_cmd->buf_lock, flags);
5691 * @lpfc_cmd: Pointer to lpfc_io_buf data structure.
5700 lpfc_check_fcp_rsp(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd)
5702 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
5780 struct lpfc_io_buf *lpfc_cmd;
5793 lpfc_cmd = lpfc_get_scsi_buf(phba, rdata->pnode, NULL);
5794 if (lpfc_cmd == NULL)
5796 lpfc_cmd->timeout = phba->cfg_task_mgmt_tmo;
5797 lpfc_cmd->rdata = rdata;
5798 lpfc_cmd->pCmd = NULL;
5799 lpfc_cmd->ndlp = pnode;
5801 status = phba->lpfc_scsi_prep_task_mgmt_cmd(vport, lpfc_cmd, lun_id,
5804 lpfc_release_scsi_buf(phba, lpfc_cmd);
5808 iocbq = &lpfc_cmd->cur_iocbq;
5811 lpfc_release_scsi_buf(phba, lpfc_cmd);
5825 iocbq, iocbqrsp, lpfc_cmd->timeout);
5844 ret = lpfc_check_fcp_rsp(vport, lpfc_cmd);
5859 lpfc_release_scsi_buf(phba, lpfc_cmd);