Lines Matching refs:se_cmd
116 static int target_xcopy_parse_tiddesc_e4(struct se_cmd *se_cmd, struct xcopy_op *xop, in target_xcopy_parse_tiddesc_e4() argument
176 xop->src_dev = se_cmd->se_dev; in target_xcopy_parse_tiddesc_e4()
193 xop->dst_dev = se_cmd->se_dev; in target_xcopy_parse_tiddesc_e4()
202 static int target_xcopy_parse_target_descriptors(struct se_cmd *se_cmd, in target_xcopy_parse_target_descriptors() argument
206 struct se_device *local_dev = se_cmd->se_dev; in target_xcopy_parse_target_descriptors()
242 rc = target_xcopy_parse_tiddesc_e4(se_cmd, xop, in target_xcopy_parse_target_descriptors()
260 rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess, in target_xcopy_parse_target_descriptors()
266 rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess, in target_xcopy_parse_target_descriptors()
392 struct se_cmd se_cmd; member
401 static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) in xcopy_pt_get_cmd_state() argument
416 static void xcopy_pt_release_cmd(struct se_cmd *se_cmd) in xcopy_pt_release_cmd() argument
418 struct xcopy_pt_cmd *xpt_cmd = container_of(se_cmd, in xcopy_pt_release_cmd()
419 struct xcopy_pt_cmd, se_cmd); in xcopy_pt_release_cmd()
425 static int xcopy_pt_check_stop_free(struct se_cmd *se_cmd) in xcopy_pt_check_stop_free() argument
427 struct xcopy_pt_cmd *xpt_cmd = container_of(se_cmd, in xcopy_pt_check_stop_free()
428 struct xcopy_pt_cmd, se_cmd); in xcopy_pt_check_stop_free()
434 static int xcopy_pt_write_pending(struct se_cmd *se_cmd) in xcopy_pt_write_pending() argument
439 static int xcopy_pt_queue_data_in(struct se_cmd *se_cmd) in xcopy_pt_queue_data_in() argument
444 static int xcopy_pt_queue_status(struct se_cmd *se_cmd) in xcopy_pt_queue_status() argument
518 struct se_cmd *cmd = &xpt_cmd->se_cmd; in target_xcopy_setup_pt_cmd()
552 struct se_cmd *se_cmd = &xpt_cmd->se_cmd; in target_xcopy_issue_pt_cmd() local
555 sense_rc = transport_generic_new_cmd(se_cmd); in target_xcopy_issue_pt_cmd()
559 if (se_cmd->data_direction == DMA_TO_DEVICE) in target_xcopy_issue_pt_cmd()
560 target_execute_cmd(se_cmd); in target_xcopy_issue_pt_cmd()
565 se_cmd->scsi_status); in target_xcopy_issue_pt_cmd()
567 return (se_cmd->scsi_status) ? -EINVAL : 0; in target_xcopy_issue_pt_cmd()
571 struct se_cmd *ec_cmd, in target_xcopy_read_source()
578 struct se_cmd *se_cmd = &xpt_cmd.se_cmd; in target_xcopy_read_source() local
594 __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, src_bytes, in target_xcopy_read_source()
600 ec_cmd->scsi_status = se_cmd->scsi_status; in target_xcopy_read_source()
609 ec_cmd->scsi_status = se_cmd->scsi_status; in target_xcopy_read_source()
611 transport_generic_free_cmd(se_cmd, 0); in target_xcopy_read_source()
616 struct se_cmd *ec_cmd, in target_xcopy_write_destination()
623 struct se_cmd *se_cmd = &xpt_cmd.se_cmd; in target_xcopy_write_destination() local
639 __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, dst_bytes, in target_xcopy_write_destination()
645 ec_cmd->scsi_status = se_cmd->scsi_status; in target_xcopy_write_destination()
651 ec_cmd->scsi_status = se_cmd->scsi_status; in target_xcopy_write_destination()
653 transport_generic_free_cmd(se_cmd, 0); in target_xcopy_write_destination()
660 struct se_cmd *ec_cmd = xop->xop_se_cmd; in target_xcopy_do_work()
789 struct se_cmd *se_cmd = xop->xop_se_cmd; in target_parse_xcopy_cmd() local
796 p = transport_kmap_data_sg(se_cmd); in target_parse_xcopy_cmd()
823 if (se_cmd->data_length < (XCOPY_HDR_LEN + tdll + sdll + inline_dl)) { in target_parse_xcopy_cmd()
826 se_cmd->data_length, tdll, sdll, inline_dl); in target_parse_xcopy_cmd()
848 rc = target_xcopy_parse_target_descriptors(se_cmd, xop, &p[16], tdll, &ret); in target_parse_xcopy_cmd()
865 transport_kunmap_data_sg(se_cmd); in target_parse_xcopy_cmd()
870 transport_kunmap_data_sg(se_cmd); in target_parse_xcopy_cmd()
874 sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) in target_do_xcopy() argument
876 struct se_device *dev = se_cmd->se_dev; in target_do_xcopy()
885 sa = se_cmd->t_task_cdb[1] & 0x1f; in target_do_xcopy()
891 if (se_cmd->data_length == 0) { in target_do_xcopy()
892 target_complete_cmd(se_cmd, SAM_STAT_GOOD); in target_do_xcopy()
895 if (se_cmd->data_length < XCOPY_HDR_LEN) { in target_do_xcopy()
897 se_cmd->data_length, XCOPY_HDR_LEN); in target_do_xcopy()
904 xop->xop_se_cmd = se_cmd; in target_do_xcopy()
917 static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd) in target_rcr_operating_parameters() argument
921 p = transport_kmap_data_sg(se_cmd); in target_rcr_operating_parameters()
928 if (se_cmd->data_length < 54) { in target_rcr_operating_parameters()
930 " too small: %u\n", se_cmd->data_length); in target_rcr_operating_parameters()
931 transport_kunmap_data_sg(se_cmd); in target_rcr_operating_parameters()
1001 transport_kunmap_data_sg(se_cmd); in target_rcr_operating_parameters()
1002 target_complete_cmd(se_cmd, SAM_STAT_GOOD); in target_rcr_operating_parameters()
1007 sense_reason_t target_do_receive_copy_results(struct se_cmd *se_cmd) in target_do_receive_copy_results() argument
1009 unsigned char *cdb = &se_cmd->t_task_cdb[0]; in target_do_receive_copy_results()
1011 struct se_device *dev = se_cmd->se_dev; in target_do_receive_copy_results()
1020 " 0x%02x, AL: %u\n", sa, list_id, se_cmd->data_length); in target_do_receive_copy_results()
1030 rc = target_rcr_operating_parameters(se_cmd); in target_do_receive_copy_results()