Lines Matching refs:se_cmd
47 static int tcm_loop_queue_status(struct se_cmd *se_cmd);
52 static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) in tcm_loop_check_stop_free() argument
59 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) in tcm_loop_check_stop_free()
65 transport_generic_free_cmd(se_cmd, 0); in tcm_loop_check_stop_free()
69 static void tcm_loop_release_cmd(struct se_cmd *se_cmd) in tcm_loop_release_cmd() argument
71 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_release_cmd()
112 struct se_cmd *se_cmd = &tl_cmd->tl_se_cmd; in tcm_loop_submission_work() local
148 se_cmd->se_cmd_flags |= SCF_BIDI; in tcm_loop_submission_work()
155 se_cmd->prot_pto = true; in tcm_loop_submission_work()
164 se_cmd->tag = tl_cmd->sc_cmd_tag; in tcm_loop_submission_work()
165 rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, in tcm_loop_submission_work()
219 struct se_cmd *se_cmd = NULL; in tcm_loop_issue_tmr() local
250 se_cmd = &tl_cmd->tl_se_cmd; in tcm_loop_issue_tmr()
256 transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, in tcm_loop_issue_tmr()
260 rc = core_tmr_alloc_req(se_cmd, tl_tmr, tmr, GFP_KERNEL); in tcm_loop_issue_tmr()
265 se_cmd->se_tmr_req->ref_task_tag = task; in tcm_loop_issue_tmr()
270 if (transport_lookup_tmr_lun(se_cmd, lun) < 0) { in tcm_loop_issue_tmr()
278 transport_generic_handle_tmr(se_cmd); in tcm_loop_issue_tmr()
284 ret = se_cmd->se_tmr_req->response; in tcm_loop_issue_tmr()
286 if (se_cmd) in tcm_loop_issue_tmr()
287 transport_generic_free_cmd(se_cmd, 1); in tcm_loop_issue_tmr()
596 static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd) in tcm_loop_get_cmd_state() argument
598 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_get_cmd_state()
604 static int tcm_loop_write_pending(struct se_cmd *se_cmd) in tcm_loop_write_pending() argument
615 target_execute_cmd(se_cmd); in tcm_loop_write_pending()
619 static int tcm_loop_write_pending_status(struct se_cmd *se_cmd) in tcm_loop_write_pending_status() argument
624 static int tcm_loop_queue_data_in(struct se_cmd *se_cmd) in tcm_loop_queue_data_in() argument
626 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_queue_data_in()
635 if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || in tcm_loop_queue_data_in()
636 (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) in tcm_loop_queue_data_in()
637 scsi_set_resid(sc, se_cmd->residual_count); in tcm_loop_queue_data_in()
642 static int tcm_loop_queue_status(struct se_cmd *se_cmd) in tcm_loop_queue_status() argument
644 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_queue_status()
651 if (se_cmd->sense_buffer && in tcm_loop_queue_status()
652 ((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || in tcm_loop_queue_status()
653 (se_cmd->se_cmd_flags & SCF_EMULATED_TASK_SENSE))) { in tcm_loop_queue_status()
655 memcpy(sc->sense_buffer, se_cmd->sense_buffer, in tcm_loop_queue_status()
660 sc->result = se_cmd->scsi_status; in tcm_loop_queue_status()
663 if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || in tcm_loop_queue_status()
664 (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) in tcm_loop_queue_status()
665 scsi_set_resid(sc, se_cmd->residual_count); in tcm_loop_queue_status()
670 static void tcm_loop_queue_tm_rsp(struct se_cmd *se_cmd) in tcm_loop_queue_tm_rsp() argument
672 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; in tcm_loop_queue_tm_rsp()
682 static void tcm_loop_aborted_task(struct se_cmd *se_cmd) in tcm_loop_aborted_task() argument