Lines Matching refs:se_cmd

57 static void ibmvscsis_determine_resid(struct se_cmd *se_cmd,  in ibmvscsis_determine_resid()  argument
60 u32 residual_count = se_cmd->residual_count; in ibmvscsis_determine_resid()
65 if (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { in ibmvscsis_determine_resid()
66 if (se_cmd->data_direction == DMA_TO_DEVICE) { in ibmvscsis_determine_resid()
70 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { in ibmvscsis_determine_resid()
75 } else if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { in ibmvscsis_determine_resid()
76 if (se_cmd->data_direction == DMA_TO_DEVICE) { in ibmvscsis_determine_resid()
80 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { in ibmvscsis_determine_resid()
1289 memset(&cmd->se_cmd, 0, sizeof(cmd->se_cmd)); in ibmvscsis_get_free_cmd()
1908 if (cmd->se_cmd.transport_state & CMD_T_ABORTED && in ibmvscsis_send_messages()
1909 !(cmd->se_cmd.transport_state & CMD_T_TAS)) { in ibmvscsis_send_messages()
2720 cmd->se_cmd.tag = be64_to_cpu(srp->tag); in ibmvscsis_parse_cmd()
2728 rc = target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb, in ibmvscsis_parse_cmd()
2793 cmd->se_cmd.se_tmr_req->response = in ibmvscsis_parse_task()
2800 cmd->se_cmd.tag = be64_to_cpu(srp_tsk->tag); in ibmvscsis_parse_task()
2810 rc = target_submit_tmr(&cmd->se_cmd, nexus->se_sess, NULL, in ibmvscsis_parse_task()
2819 cmd->se_cmd.se_tmr_req->response = in ibmvscsis_parse_task()
2825 transport_send_check_condition_and_sense(&cmd->se_cmd, 0, 0); in ibmvscsis_parse_task()
3058 struct se_cmd *se_cmd = &cmd->se_cmd; in ibmvscsis_fast_fail() local
3061 u8 rc = se_cmd->scsi_status; in ibmvscsis_fast_fail()
3064 if (scsi_normalize_sense(se_cmd->sense_buffer, in ibmvscsis_fast_fail()
3065 se_cmd->scsi_sense_length, &sshdr)) in ibmvscsis_fast_fail()
3067 (se_cmd->residual_count == 0 || in ibmvscsis_fast_fail()
3068 se_cmd->residual_count == se_cmd->data_length)) { in ibmvscsis_fast_fail()
3089 struct se_cmd *se_cmd = &cmd->se_cmd; in srp_build_response() local
3115 ibmvscsis_determine_resid(se_cmd, rsp); in srp_build_response()
3116 if (se_cmd->scsi_sense_length && se_cmd->sense_buffer) { in srp_build_response()
3118 cpu_to_be32(se_cmd->scsi_sense_length); in srp_build_response()
3120 len += se_cmd->scsi_sense_length; in srp_build_response()
3121 memcpy(data, se_cmd->sense_buffer, in srp_build_response()
3122 se_cmd->scsi_sense_length); in srp_build_response()
3141 switch (se_cmd->se_tmr_req->response) { in srp_build_response()
3724 static int ibmvscsis_check_stop_free(struct se_cmd *se_cmd) in ibmvscsis_check_stop_free() argument
3726 return target_put_sess_cmd(se_cmd); in ibmvscsis_check_stop_free()
3729 static void ibmvscsis_release_cmd(struct se_cmd *se_cmd) in ibmvscsis_release_cmd() argument
3731 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_release_cmd()
3732 se_cmd); in ibmvscsis_release_cmd()
3747 static int ibmvscsis_write_pending(struct se_cmd *se_cmd) in ibmvscsis_write_pending() argument
3749 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_write_pending()
3750 se_cmd); in ibmvscsis_write_pending()
3777 target_execute_cmd(se_cmd); in ibmvscsis_write_pending()
3785 static int ibmvscsis_get_cmd_state(struct se_cmd *se_cmd) in ibmvscsis_get_cmd_state() argument
3790 static int ibmvscsis_queue_data_in(struct se_cmd *se_cmd) in ibmvscsis_queue_data_in() argument
3792 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_queue_data_in()
3793 se_cmd); in ibmvscsis_queue_data_in()
3803 se_cmd->scsi_sense_length = 18; in ibmvscsis_queue_data_in()
3804 memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length); in ibmvscsis_queue_data_in()
3806 scsi_build_sense_buffer(0, se_cmd->sense_buffer, MEDIUM_ERROR, in ibmvscsis_queue_data_in()
3817 static int ibmvscsis_queue_status(struct se_cmd *se_cmd) in ibmvscsis_queue_status() argument
3819 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_queue_status()
3820 se_cmd); in ibmvscsis_queue_status()
3824 dev_dbg(&vscsi->dev, "queue_status %p\n", se_cmd); in ibmvscsis_queue_status()
3833 static void ibmvscsis_queue_tm_rsp(struct se_cmd *se_cmd) in ibmvscsis_queue_tm_rsp() argument
3835 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_queue_tm_rsp()
3836 se_cmd); in ibmvscsis_queue_tm_rsp()
3845 se_cmd, (int)se_cmd->se_tmr_req->response); in ibmvscsis_queue_tm_rsp()
3848 cmd->se_cmd.se_tmr_req->response == TMR_TASK_DOES_NOT_EXIST) { in ibmvscsis_queue_tm_rsp()
3851 if (tag_to_abort == cmd_itr->se_cmd.tag) { in ibmvscsis_queue_tm_rsp()
3865 static void ibmvscsis_aborted_task(struct se_cmd *se_cmd) in ibmvscsis_aborted_task() argument
3867 struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd, in ibmvscsis_aborted_task()
3868 se_cmd); in ibmvscsis_aborted_task()
3872 se_cmd, se_cmd->tag); in ibmvscsis_aborted_task()