Lines Matching refs:se_cmd
51 static int tcm_loop_queue_status(struct se_cmd *se_cmd);
56 static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) in tcm_loop_check_stop_free() argument
63 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) in tcm_loop_check_stop_free()
69 transport_generic_free_cmd(se_cmd, 0); in tcm_loop_check_stop_free()
73 static void tcm_loop_release_cmd(struct se_cmd *se_cmd) in tcm_loop_release_cmd() argument
75 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_release_cmd()
116 struct se_cmd *se_cmd = &tl_cmd->tl_se_cmd; in tcm_loop_submission_work() local
152 se_cmd->se_cmd_flags |= SCF_BIDI; in tcm_loop_submission_work()
159 se_cmd->prot_pto = true; in tcm_loop_submission_work()
168 rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, in tcm_loop_submission_work()
222 struct se_cmd *se_cmd = NULL; in tcm_loop_issue_tmr() local
253 se_cmd = &tl_cmd->tl_se_cmd; in tcm_loop_issue_tmr()
259 transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, in tcm_loop_issue_tmr()
263 rc = core_tmr_alloc_req(se_cmd, tl_tmr, tmr, GFP_KERNEL); in tcm_loop_issue_tmr()
268 se_cmd->se_tmr_req->ref_task_tag = task; in tcm_loop_issue_tmr()
273 if (transport_lookup_tmr_lun(se_cmd, lun) < 0) { in tcm_loop_issue_tmr()
281 transport_generic_handle_tmr(se_cmd); in tcm_loop_issue_tmr()
287 ret = se_cmd->se_tmr_req->response; in tcm_loop_issue_tmr()
289 if (se_cmd) in tcm_loop_issue_tmr()
290 transport_generic_free_cmd(se_cmd, 1); in tcm_loop_issue_tmr()
745 static u32 tcm_loop_get_task_tag(struct se_cmd *se_cmd) in tcm_loop_get_task_tag() argument
747 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_get_task_tag()
753 static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd) in tcm_loop_get_cmd_state() argument
755 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_get_cmd_state()
771 static int tcm_loop_write_pending(struct se_cmd *se_cmd) in tcm_loop_write_pending() argument
782 target_execute_cmd(se_cmd); in tcm_loop_write_pending()
786 static int tcm_loop_write_pending_status(struct se_cmd *se_cmd) in tcm_loop_write_pending_status() argument
791 static int tcm_loop_queue_data_in(struct se_cmd *se_cmd) in tcm_loop_queue_data_in() argument
793 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_queue_data_in()
802 if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || in tcm_loop_queue_data_in()
803 (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) in tcm_loop_queue_data_in()
804 scsi_set_resid(sc, se_cmd->residual_count); in tcm_loop_queue_data_in()
809 static int tcm_loop_queue_status(struct se_cmd *se_cmd) in tcm_loop_queue_status() argument
811 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, in tcm_loop_queue_status()
818 if (se_cmd->sense_buffer && in tcm_loop_queue_status()
819 ((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || in tcm_loop_queue_status()
820 (se_cmd->se_cmd_flags & SCF_EMULATED_TASK_SENSE))) { in tcm_loop_queue_status()
822 memcpy(sc->sense_buffer, se_cmd->sense_buffer, in tcm_loop_queue_status()
827 sc->result = se_cmd->scsi_status; in tcm_loop_queue_status()
830 if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || in tcm_loop_queue_status()
831 (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) in tcm_loop_queue_status()
832 scsi_set_resid(sc, se_cmd->residual_count); in tcm_loop_queue_status()
837 static void tcm_loop_queue_tm_rsp(struct se_cmd *se_cmd) in tcm_loop_queue_tm_rsp() argument
839 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; in tcm_loop_queue_tm_rsp()
849 static void tcm_loop_aborted_task(struct se_cmd *se_cmd) in tcm_loop_aborted_task() argument