Lines Matching refs:lpfc_cmd
124 struct lpfc_io_buf *lpfc_cmd) in lpfc_sli4_set_rsp_sgl_last() argument
126 struct sli4_sge *sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl; in lpfc_sli4_set_rsp_sgl_last()
144 lpfc_update_stats(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd) in lpfc_update_stats() argument
149 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; in lpfc_update_stats()
160 latency = jiffies_to_msecs((long)jiffies - (long)lpfc_cmd->start_time); in lpfc_update_stats()
161 rdata = lpfc_cmd->rdata; in lpfc_update_stats()
594 struct lpfc_io_buf *lpfc_cmd = NULL; in lpfc_get_scsi_buf_s3() local
599 list_remove_head(scsi_buf_list_get, lpfc_cmd, struct lpfc_io_buf, in lpfc_get_scsi_buf_s3()
601 if (!lpfc_cmd) { in lpfc_get_scsi_buf_s3()
606 list_remove_head(scsi_buf_list_get, lpfc_cmd, in lpfc_get_scsi_buf_s3()
612 if (lpfc_ndlp_check_qdepth(phba, ndlp) && lpfc_cmd) { in lpfc_get_scsi_buf_s3()
614 lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH; in lpfc_get_scsi_buf_s3()
616 return lpfc_cmd; in lpfc_get_scsi_buf_s3()
633 struct lpfc_io_buf *lpfc_cmd; in lpfc_get_scsi_buf_s4() local
651 lpfc_cmd = lpfc_get_io_buf(phba, ndlp, idx, in lpfc_get_scsi_buf_s4()
653 if (!lpfc_cmd) { in lpfc_get_scsi_buf_s4()
662 lpfc_cmd->cur_iocbq.iocb_flag = LPFC_IO_FCP; in lpfc_get_scsi_buf_s4()
663 lpfc_cmd->prot_seg_cnt = 0; in lpfc_get_scsi_buf_s4()
664 lpfc_cmd->seg_cnt = 0; in lpfc_get_scsi_buf_s4()
665 lpfc_cmd->timeout = 0; in lpfc_get_scsi_buf_s4()
666 lpfc_cmd->flags = 0; in lpfc_get_scsi_buf_s4()
667 lpfc_cmd->start_time = jiffies; in lpfc_get_scsi_buf_s4()
668 lpfc_cmd->waitq = NULL; in lpfc_get_scsi_buf_s4()
669 lpfc_cmd->cpu = cpu; in lpfc_get_scsi_buf_s4()
671 lpfc_cmd->prot_data_type = 0; in lpfc_get_scsi_buf_s4()
673 tmp = lpfc_get_cmd_rsp_buf_per_hdwq(phba, lpfc_cmd); in lpfc_get_scsi_buf_s4()
675 lpfc_release_io_buf(phba, lpfc_cmd, lpfc_cmd->hdwq); in lpfc_get_scsi_buf_s4()
679 lpfc_cmd->fcp_cmnd = tmp->fcp_cmnd; in lpfc_get_scsi_buf_s4()
680 lpfc_cmd->fcp_rsp = tmp->fcp_rsp; in lpfc_get_scsi_buf_s4()
687 sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl; in lpfc_get_scsi_buf_s4()
710 iocb = &lpfc_cmd->cur_iocbq.iocb; in lpfc_get_scsi_buf_s4()
726 lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH; in lpfc_get_scsi_buf_s4()
728 return lpfc_cmd; in lpfc_get_scsi_buf_s4()
835 lpfc_scsi_prep_dma_buf_s3(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) in lpfc_scsi_prep_dma_buf_s3() argument
837 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd; in lpfc_scsi_prep_dma_buf_s3()
839 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_scsi_prep_dma_buf_s3()
840 struct ulp_bde64 *bpl = (struct ulp_bde64 *)lpfc_cmd->dma_sgl; in lpfc_scsi_prep_dma_buf_s3()
841 struct lpfc_iocbq *iocbq = &lpfc_cmd->cur_iocbq; in lpfc_scsi_prep_dma_buf_s3()
842 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; in lpfc_scsi_prep_dma_buf_s3()
868 lpfc_cmd->seg_cnt = nseg; in lpfc_scsi_prep_dma_buf_s3()
869 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) { in lpfc_scsi_prep_dma_buf_s3()
874 lpfc_cmd->seg_cnt); in lpfc_scsi_prep_dma_buf_s3()
875 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); in lpfc_scsi_prep_dma_buf_s3()
876 lpfc_cmd->seg_cnt = 0; in lpfc_scsi_prep_dma_buf_s3()
929 physaddr = lpfc_cmd->dma_handle; in lpfc_scsi_prep_dma_buf_s3()
988 struct lpfc_io_buf *lpfc_cmd = NULL; in lpfc_bg_err_inject() local
1047 lpfc_cmd = (struct lpfc_io_buf *)sc->host_scribble; in lpfc_bg_err_inject()
1075 if (lpfc_cmd) { in lpfc_bg_err_inject()
1076 lpfc_cmd->prot_data_type = in lpfc_bg_err_inject()
1078 lpfc_cmd->prot_data_segment = in lpfc_bg_err_inject()
1080 lpfc_cmd->prot_data = in lpfc_bg_err_inject()
1196 if (lpfc_cmd) { in lpfc_bg_err_inject()
1197 lpfc_cmd->prot_data_type = in lpfc_bg_err_inject()
1199 lpfc_cmd->prot_data_segment = in lpfc_bg_err_inject()
1201 lpfc_cmd->prot_data = in lpfc_bg_err_inject()
1950 struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_setup_sgl() argument
2038 sgl_xtra = lpfc_get_sgl_per_hdwq(phba, lpfc_cmd); in lpfc_bg_setup_sgl()
2041 lpfc_cmd->seg_cnt = 0; in lpfc_bg_setup_sgl()
2130 struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_setup_sgl_prot() argument
2199 sgl_xtra = lpfc_get_sgl_per_hdwq(phba, lpfc_cmd); in lpfc_bg_setup_sgl_prot()
2326 lpfc_cmd); in lpfc_bg_setup_sgl_prot()
2478 struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_scsi_adjust_dl() argument
2480 struct scsi_cmnd *sc = lpfc_cmd->pCmd; in lpfc_bg_scsi_adjust_dl()
2521 struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_scsi_prep_dma_buf_s3() argument
2523 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd; in lpfc_bg_scsi_prep_dma_buf_s3()
2524 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_bg_scsi_prep_dma_buf_s3()
2525 struct ulp_bde64 *bpl = (struct ulp_bde64 *)lpfc_cmd->dma_sgl; in lpfc_bg_scsi_prep_dma_buf_s3()
2526 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; in lpfc_bg_scsi_prep_dma_buf_s3()
2552 lpfc_cmd->seg_cnt = datasegcnt; in lpfc_bg_scsi_prep_dma_buf_s3()
2555 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) { in lpfc_bg_scsi_prep_dma_buf_s3()
2556 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); in lpfc_bg_scsi_prep_dma_buf_s3()
2567 if ((lpfc_cmd->seg_cnt + 2) > phba->cfg_total_seg_cnt) { in lpfc_bg_scsi_prep_dma_buf_s3()
2595 lpfc_cmd->prot_seg_cnt = protsegcnt; in lpfc_bg_scsi_prep_dma_buf_s3()
2601 if ((lpfc_cmd->prot_seg_cnt * 4) > in lpfc_bg_scsi_prep_dma_buf_s3()
2620 lpfc_cmd->seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s3()
2640 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd); in lpfc_bg_scsi_prep_dma_buf_s3()
2659 if (lpfc_cmd->seg_cnt) in lpfc_bg_scsi_prep_dma_buf_s3()
2661 if (lpfc_cmd->prot_seg_cnt) in lpfc_bg_scsi_prep_dma_buf_s3()
2669 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, in lpfc_bg_scsi_prep_dma_buf_s3()
2673 lpfc_cmd->seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s3()
2674 lpfc_cmd->prot_seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s3()
2713 lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) in lpfc_calc_bg_err() argument
2717 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; in lpfc_calc_bg_err()
2747 protsegcnt = lpfc_cmd->prot_seg_cnt; in lpfc_calc_bg_err()
2898 lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, in lpfc_parse_bg_err() argument
2901 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; in lpfc_parse_bg_err()
3026 lpfc_calc_bg_err(phba, lpfc_cmd); in lpfc_parse_bg_err()
3046 lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) in lpfc_scsi_prep_dma_buf_s4() argument
3048 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd; in lpfc_scsi_prep_dma_buf_s4()
3050 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_scsi_prep_dma_buf_s4()
3051 struct sli4_sge *sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl; in lpfc_scsi_prep_dma_buf_s4()
3053 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; in lpfc_scsi_prep_dma_buf_s4()
3087 lpfc_cmd->seg_cnt = nseg; in lpfc_scsi_prep_dma_buf_s4()
3089 lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) { in lpfc_scsi_prep_dma_buf_s4()
3095 lpfc_cmd->seg_cnt); in lpfc_scsi_prep_dma_buf_s4()
3096 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); in lpfc_scsi_prep_dma_buf_s4()
3097 lpfc_cmd->seg_cnt = 0; in lpfc_scsi_prep_dma_buf_s4()
3133 phba, lpfc_cmd); in lpfc_scsi_prep_dma_buf_s4()
3136 lpfc_cmd->seg_cnt = 0; in lpfc_scsi_prep_dma_buf_s4()
3237 lpfc_cmd->cur_iocbq.iocb_flag |= (LPFC_IO_OAS | LPFC_IO_FOF); in lpfc_scsi_prep_dma_buf_s4()
3238 lpfc_cmd->cur_iocbq.priority = ((struct lpfc_device_data *) in lpfc_scsi_prep_dma_buf_s4()
3260 struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_scsi_prep_dma_buf_s4() argument
3262 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd; in lpfc_bg_scsi_prep_dma_buf_s4()
3263 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_bg_scsi_prep_dma_buf_s4()
3264 struct sli4_sge *sgl = (struct sli4_sge *)(lpfc_cmd->dma_sgl); in lpfc_bg_scsi_prep_dma_buf_s4()
3265 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; in lpfc_bg_scsi_prep_dma_buf_s4()
3297 lpfc_cmd->seg_cnt = datasegcnt; in lpfc_bg_scsi_prep_dma_buf_s4()
3300 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt && in lpfc_bg_scsi_prep_dma_buf_s4()
3302 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt); in lpfc_bg_scsi_prep_dma_buf_s4()
3312 if (((lpfc_cmd->seg_cnt + 1) > in lpfc_bg_scsi_prep_dma_buf_s4()
3320 datasegcnt, lpfc_cmd); in lpfc_bg_scsi_prep_dma_buf_s4()
3343 lpfc_cmd->prot_seg_cnt = protsegcnt; in lpfc_bg_scsi_prep_dma_buf_s4()
3348 if (((lpfc_cmd->prot_seg_cnt * 3) > in lpfc_bg_scsi_prep_dma_buf_s4()
3356 datasegcnt, protsegcnt, lpfc_cmd); in lpfc_bg_scsi_prep_dma_buf_s4()
3370 lpfc_cmd->seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s4()
3382 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_STRIP; in lpfc_bg_scsi_prep_dma_buf_s4()
3386 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_INSERT; in lpfc_bg_scsi_prep_dma_buf_s4()
3390 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_PASS; in lpfc_bg_scsi_prep_dma_buf_s4()
3394 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd); in lpfc_bg_scsi_prep_dma_buf_s4()
3417 lpfc_cmd->cur_iocbq.iocb_flag |= (LPFC_IO_OAS | LPFC_IO_FOF); in lpfc_bg_scsi_prep_dma_buf_s4()
3421 if (lpfc_cmd->seg_cnt) in lpfc_bg_scsi_prep_dma_buf_s4()
3423 if (lpfc_cmd->prot_seg_cnt) in lpfc_bg_scsi_prep_dma_buf_s4()
3431 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, in lpfc_bg_scsi_prep_dma_buf_s4()
3435 lpfc_cmd->seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s4()
3436 lpfc_cmd->prot_seg_cnt = 0; in lpfc_bg_scsi_prep_dma_buf_s4()
3453 lpfc_scsi_prep_dma_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) in lpfc_scsi_prep_dma_buf() argument
3455 return phba->lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); in lpfc_scsi_prep_dma_buf()
3472 lpfc_bg_scsi_prep_dma_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) in lpfc_bg_scsi_prep_dma_buf() argument
3474 return phba->lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); in lpfc_bg_scsi_prep_dma_buf()
3489 struct lpfc_io_buf *lpfc_cmd, struct lpfc_iocbq *rsp_iocb) { in lpfc_send_scsi_error_event() argument
3490 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; in lpfc_send_scsi_error_event()
3491 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; in lpfc_send_scsi_error_event()
3496 struct lpfc_nodelist *pnode = lpfc_cmd->rdata->pnode; in lpfc_send_scsi_error_event()
3608 lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd, in lpfc_handle_fcp_err() argument
3612 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; in lpfc_handle_fcp_err()
3613 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd; in lpfc_handle_fcp_err()
3614 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; in lpfc_handle_fcp_err()
3755 lpfc_cmd->cur_iocbq.sli4_xritag : in lpfc_handle_fcp_err()
3783 lpfc_send_scsi_error_event(vport->phba, vport, lpfc_cmd, rsp_iocb); in lpfc_handle_fcp_err()
3800 struct lpfc_io_buf *lpfc_cmd = in lpfc_scsi_cmd_iocb_cmpl() local
3803 struct lpfc_rport_data *rdata = lpfc_cmd->rdata; in lpfc_scsi_cmd_iocb_cmpl()
3813 spin_lock(&lpfc_cmd->buf_lock); in lpfc_scsi_cmd_iocb_cmpl()
3816 cmd = lpfc_cmd->pCmd; in lpfc_scsi_cmd_iocb_cmpl()
3820 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_scsi_cmd_iocb_cmpl()
3824 idx = lpfc_cmd->cur_iocbq.hba_wqidx; in lpfc_scsi_cmd_iocb_cmpl()
3834 lpfc_cmd->result = (pIocbOut->iocb.un.ulpWord[4] & IOERR_PARAM_MASK); in lpfc_scsi_cmd_iocb_cmpl()
3835 lpfc_cmd->status = pIocbOut->iocb.ulpStatus; in lpfc_scsi_cmd_iocb_cmpl()
3838 lpfc_cmd->flags |= LPFC_SBUF_XBUSY; in lpfc_scsi_cmd_iocb_cmpl()
3840 lpfc_cmd->flags &= ~LPFC_SBUF_XBUSY; in lpfc_scsi_cmd_iocb_cmpl()
3843 if (lpfc_cmd->prot_data_type) { in lpfc_scsi_cmd_iocb_cmpl()
3846 src = (struct scsi_dif_tuple *)lpfc_cmd->prot_data_segment; in lpfc_scsi_cmd_iocb_cmpl()
3851 switch (lpfc_cmd->prot_data_type) { in lpfc_scsi_cmd_iocb_cmpl()
3854 lpfc_cmd->prot_data; in lpfc_scsi_cmd_iocb_cmpl()
3858 (uint16_t)lpfc_cmd->prot_data; in lpfc_scsi_cmd_iocb_cmpl()
3862 (uint16_t)lpfc_cmd->prot_data; in lpfc_scsi_cmd_iocb_cmpl()
3868 lpfc_cmd->prot_data = 0; in lpfc_scsi_cmd_iocb_cmpl()
3869 lpfc_cmd->prot_data_type = 0; in lpfc_scsi_cmd_iocb_cmpl()
3870 lpfc_cmd->prot_data_segment = NULL; in lpfc_scsi_cmd_iocb_cmpl()
3874 if (unlikely(lpfc_cmd->status)) { in lpfc_scsi_cmd_iocb_cmpl()
3875 if (lpfc_cmd->status == IOSTAT_LOCAL_REJECT && in lpfc_scsi_cmd_iocb_cmpl()
3876 (lpfc_cmd->result & IOERR_DRVR_MASK)) in lpfc_scsi_cmd_iocb_cmpl()
3877 lpfc_cmd->status = IOSTAT_DRIVER_REJECT; in lpfc_scsi_cmd_iocb_cmpl()
3878 else if (lpfc_cmd->status >= IOSTAT_CNT) in lpfc_scsi_cmd_iocb_cmpl()
3879 lpfc_cmd->status = IOSTAT_DEFAULT; in lpfc_scsi_cmd_iocb_cmpl()
3880 if (lpfc_cmd->status == IOSTAT_FCP_RSP_ERROR && in lpfc_scsi_cmd_iocb_cmpl()
3881 !lpfc_cmd->fcp_rsp->rspStatus3 && in lpfc_scsi_cmd_iocb_cmpl()
3882 (lpfc_cmd->fcp_rsp->rspStatus2 & RESID_UNDER) && in lpfc_scsi_cmd_iocb_cmpl()
3895 lpfc_cmd->status, lpfc_cmd->result, in lpfc_scsi_cmd_iocb_cmpl()
3899 lpfc_cmd->cur_iocbq.sli4_xritag : 0xffff, in lpfc_scsi_cmd_iocb_cmpl()
3901 lpfc_cmd->cur_iocbq.iocb.ulpIoTag); in lpfc_scsi_cmd_iocb_cmpl()
3903 switch (lpfc_cmd->status) { in lpfc_scsi_cmd_iocb_cmpl()
3906 lpfc_handle_fcp_err(vport, lpfc_cmd, pIocbOut); in lpfc_scsi_cmd_iocb_cmpl()
3917 (lpfc_cmd->status == IOSTAT_NPORT_BSY) ? in lpfc_scsi_cmd_iocb_cmpl()
3938 if (lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_ERROR || in lpfc_scsi_cmd_iocb_cmpl()
3939 lpfc_cmd->result == in lpfc_scsi_cmd_iocb_cmpl()
3941 lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR || in lpfc_scsi_cmd_iocb_cmpl()
3942 lpfc_cmd->result == in lpfc_scsi_cmd_iocb_cmpl()
3947 if (lpfc_cmd->result == IOERR_INVALID_RPI || in lpfc_scsi_cmd_iocb_cmpl()
3948 lpfc_cmd->result == IOERR_NO_RESOURCES || in lpfc_scsi_cmd_iocb_cmpl()
3949 lpfc_cmd->result == IOERR_ABORT_REQUESTED || in lpfc_scsi_cmd_iocb_cmpl()
3950 lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { in lpfc_scsi_cmd_iocb_cmpl()
3954 if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED || in lpfc_scsi_cmd_iocb_cmpl()
3955 lpfc_cmd->result == IOERR_TX_DMA_FAILED) && in lpfc_scsi_cmd_iocb_cmpl()
3962 lpfc_parse_bg_err(phba, lpfc_cmd, in lpfc_scsi_cmd_iocb_cmpl()
3972 if ((lpfc_cmd->status == IOSTAT_REMOTE_STOP) in lpfc_scsi_cmd_iocb_cmpl()
3980 lpfc_cmd->cur_iocbq.sli4_lxritag, in lpfc_scsi_cmd_iocb_cmpl()
3996 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { in lpfc_scsi_cmd_iocb_cmpl()
4007 lpfc_update_stats(vport, lpfc_cmd); in lpfc_scsi_cmd_iocb_cmpl()
4009 time_after(jiffies, lpfc_cmd->start_time + in lpfc_scsi_cmd_iocb_cmpl()
4026 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); in lpfc_scsi_cmd_iocb_cmpl()
4028 lpfc_cmd->pCmd = NULL; in lpfc_scsi_cmd_iocb_cmpl()
4029 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_scsi_cmd_iocb_cmpl()
4032 if (lpfc_cmd->ts_cmd_start) { in lpfc_scsi_cmd_iocb_cmpl()
4033 lpfc_cmd->ts_isr_cmpl = pIocbIn->isr_timestamp; in lpfc_scsi_cmd_iocb_cmpl()
4034 lpfc_cmd->ts_data_io = ktime_get_ns(); in lpfc_scsi_cmd_iocb_cmpl()
4035 phba->ktime_last_cmd = lpfc_cmd->ts_data_io; in lpfc_scsi_cmd_iocb_cmpl()
4036 lpfc_io_ktime(phba, lpfc_cmd); in lpfc_scsi_cmd_iocb_cmpl()
4046 spin_lock(&lpfc_cmd->buf_lock); in lpfc_scsi_cmd_iocb_cmpl()
4047 lpfc_cmd->cur_iocbq.iocb_flag &= ~LPFC_DRIVER_ABORTED; in lpfc_scsi_cmd_iocb_cmpl()
4048 if (lpfc_cmd->waitq) in lpfc_scsi_cmd_iocb_cmpl()
4049 wake_up(lpfc_cmd->waitq); in lpfc_scsi_cmd_iocb_cmpl()
4050 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_scsi_cmd_iocb_cmpl()
4052 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_scsi_cmd_iocb_cmpl()
4083 lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd, in lpfc_scsi_prep_cmnd() argument
4087 struct scsi_cmnd *scsi_cmnd = lpfc_cmd->pCmd; in lpfc_scsi_prep_cmnd()
4088 struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_scsi_prep_cmnd()
4089 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; in lpfc_scsi_prep_cmnd()
4090 struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq); in lpfc_scsi_prep_cmnd()
4101 lpfc_cmd->fcp_rsp->rspSnsLen = 0; in lpfc_scsi_prep_cmnd()
4103 lpfc_cmd->fcp_cmnd->fcpCntl2 = 0; in lpfc_scsi_prep_cmnd()
4105 int_to_scsilun(lpfc_cmd->pCmd->device->lun, in lpfc_scsi_prep_cmnd()
4106 &lpfc_cmd->fcp_cmnd->fcp_lun); in lpfc_scsi_prep_cmnd()
4119 idx = lpfc_cmd->hdwq_no; in lpfc_scsi_prep_cmnd()
4177 piocbq->context1 = lpfc_cmd; in lpfc_scsi_prep_cmnd()
4179 piocbq->iocb.ulpTimeout = lpfc_cmd->timeout; in lpfc_scsi_prep_cmnd()
4199 struct lpfc_io_buf *lpfc_cmd, in lpfc_scsi_prep_task_mgmt_cmd() argument
4206 struct lpfc_rport_data *rdata = lpfc_cmd->rdata; in lpfc_scsi_prep_task_mgmt_cmd()
4213 piocbq = &(lpfc_cmd->cur_iocbq); in lpfc_scsi_prep_task_mgmt_cmd()
4218 fcp_cmnd = lpfc_cmd->fcp_cmnd; in lpfc_scsi_prep_task_mgmt_cmd()
4238 if (lpfc_cmd->timeout > 0xff) { in lpfc_scsi_prep_task_mgmt_cmd()
4245 piocb->ulpTimeout = lpfc_cmd->timeout; in lpfc_scsi_prep_task_mgmt_cmd()
4248 lpfc_sli4_set_rsp_sgl_last(vport->phba, lpfc_cmd); in lpfc_scsi_prep_task_mgmt_cmd()
4308 struct lpfc_io_buf *lpfc_cmd = in lpfc_tskmgmt_def_cmpl() local
4310 if (lpfc_cmd) in lpfc_tskmgmt_def_cmpl()
4311 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_tskmgmt_def_cmpl()
4508 struct lpfc_io_buf *lpfc_cmd; in lpfc_queuecommand() local
4580 lpfc_cmd = lpfc_get_scsi_buf(phba, ndlp, cmnd); in lpfc_queuecommand()
4581 if (lpfc_cmd == NULL) { in lpfc_queuecommand()
4594 lpfc_cmd->pCmd = cmnd; in lpfc_queuecommand()
4595 lpfc_cmd->rdata = rdata; in lpfc_queuecommand()
4596 lpfc_cmd->ndlp = ndlp; in lpfc_queuecommand()
4597 cmnd->host_scribble = (unsigned char *)lpfc_cmd; in lpfc_queuecommand()
4611 err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); in lpfc_queuecommand()
4623 err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); in lpfc_queuecommand()
4634 lpfc_scsi_prep_cmnd(vport, lpfc_cmd, ndlp); in lpfc_queuecommand()
4641 &lpfc_cmd->cur_iocbq, SLI_IOCB_RET_IOCB); in lpfc_queuecommand()
4644 lpfc_cmd->ts_cmd_start = start; in lpfc_queuecommand()
4645 lpfc_cmd->ts_last_cmd = phba->ktime_last_cmd; in lpfc_queuecommand()
4646 lpfc_cmd->ts_cmd_wqput = ktime_get_ns(); in lpfc_queuecommand()
4648 lpfc_cmd->ts_cmd_start = 0; in lpfc_queuecommand()
4662 lpfc_cmd->cur_iocbq.sli4_xritag : 0xffff, in lpfc_queuecommand()
4663 lpfc_cmd->cur_iocbq.iocb.ulpContext, in lpfc_queuecommand()
4664 lpfc_cmd->cur_iocbq.iocb.ulpIoTag, in lpfc_queuecommand()
4665 lpfc_cmd->cur_iocbq.iocb.ulpTimeout, in lpfc_queuecommand()
4680 lpfc_keep_pvt_pool_above_lowwm(phba, lpfc_cmd->hdwq_no); in lpfc_queuecommand()
4685 idx = lpfc_cmd->hdwq_no; in lpfc_queuecommand()
4686 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); in lpfc_queuecommand()
4688 switch (lpfc_cmd->fcp_cmnd->fcpCntl3) { in lpfc_queuecommand()
4699 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_queuecommand()
4707 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_queuecommand()
4733 struct lpfc_io_buf *lpfc_cmd; in lpfc_abort_handler() local
4745 lpfc_cmd = (struct lpfc_io_buf *)cmnd->host_scribble; in lpfc_abort_handler()
4746 if (!lpfc_cmd) in lpfc_abort_handler()
4760 spin_lock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4762 if (!lpfc_cmd->pCmd) { in lpfc_abort_handler()
4770 iocb = &lpfc_cmd->cur_iocbq; in lpfc_abort_handler()
4793 if (lpfc_cmd->pCmd != cmnd) { in lpfc_abort_handler()
4800 BUG_ON(iocb->context1 != lpfc_cmd); in lpfc_abort_handler()
4808 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4853 lpfc_cmd->waitq = &waitq; in lpfc_abort_handler()
4867 lpfc_cmd->waitq = NULL; in lpfc_abort_handler()
4868 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4876 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4886 (lpfc_cmd->pCmd != cmnd), in lpfc_abort_handler()
4889 spin_lock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4891 if (lpfc_cmd->pCmd == cmnd) { in lpfc_abort_handler()
4901 lpfc_cmd->waitq = NULL; in lpfc_abort_handler()
4903 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4910 spin_unlock(&lpfc_cmd->buf_lock); in lpfc_abort_handler()
4957 lpfc_check_fcp_rsp(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd) in lpfc_check_fcp_rsp() argument
4959 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; in lpfc_check_fcp_rsp()
5037 struct lpfc_io_buf *lpfc_cmd; in lpfc_send_taskmgmt() local
5050 lpfc_cmd = lpfc_get_scsi_buf(phba, pnode, NULL); in lpfc_send_taskmgmt()
5051 if (lpfc_cmd == NULL) in lpfc_send_taskmgmt()
5053 lpfc_cmd->timeout = phba->cfg_task_mgmt_tmo; in lpfc_send_taskmgmt()
5054 lpfc_cmd->rdata = rdata; in lpfc_send_taskmgmt()
5055 lpfc_cmd->pCmd = cmnd; in lpfc_send_taskmgmt()
5056 lpfc_cmd->ndlp = pnode; in lpfc_send_taskmgmt()
5058 status = lpfc_scsi_prep_task_mgmt_cmd(vport, lpfc_cmd, lun_id, in lpfc_send_taskmgmt()
5061 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_send_taskmgmt()
5065 iocbq = &lpfc_cmd->cur_iocbq; in lpfc_send_taskmgmt()
5068 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_send_taskmgmt()
5081 iocbq, iocbqrsp, lpfc_cmd->timeout); in lpfc_send_taskmgmt()
5099 ret = lpfc_check_fcp_rsp(vport, lpfc_cmd); in lpfc_send_taskmgmt()
5113 lpfc_release_scsi_buf(phba, lpfc_cmd); in lpfc_send_taskmgmt()