Lines Matching refs:se_cmd
123 struct se_cmd *se_cmd; member
161 static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd) in tcmu_alloc_cmd() argument
163 struct se_device *se_dev = se_cmd->se_dev; in tcmu_alloc_cmd()
172 tcmu_cmd->se_cmd = se_cmd; in tcmu_alloc_cmd()
312 struct se_cmd *se_cmd = cmd->se_cmd; in gather_data_area() local
324 data_sg = se_cmd->t_data_sg; in gather_data_area()
325 data_nents = se_cmd->t_data_nents; in gather_data_area()
334 count = DIV_ROUND_UP(se_cmd->data_length, DATA_BLOCK_SIZE); in gather_data_area()
340 data_sg = se_cmd->t_bidi_data_sg; in gather_data_area()
341 data_nents = se_cmd->t_bidi_data_nents; in gather_data_area()
420 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in tcmu_cmd_get_data_length() local
421 size_t data_length = round_up(se_cmd->data_length, DATA_BLOCK_SIZE); in tcmu_cmd_get_data_length()
423 if (se_cmd->se_cmd_flags & SCF_BIDI) { in tcmu_cmd_get_data_length()
424 BUG_ON(!(se_cmd->t_bidi_data_sg && se_cmd->t_bidi_data_nents)); in tcmu_cmd_get_data_length()
425 data_length += round_up(se_cmd->t_bidi_data_sg->length, in tcmu_cmd_get_data_length()
443 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in tcmu_queue_cmd_ring() local
469 + round_up(scsi_command_size(se_cmd->t_task_cdb), TCMU_OP_ALIGN_SIZE); in tcmu_queue_cmd_ring()
538 copy_to_data_area = (se_cmd->data_direction == DMA_TO_DEVICE in tcmu_queue_cmd_ring()
539 || se_cmd->se_cmd_flags & SCF_BIDI); in tcmu_queue_cmd_ring()
540 alloc_and_scatter_data_area(udev, se_cmd->t_data_sg, in tcmu_queue_cmd_ring()
541 se_cmd->t_data_nents, &iov, &iov_cnt, copy_to_data_area); in tcmu_queue_cmd_ring()
546 if (se_cmd->se_cmd_flags & SCF_BIDI) { in tcmu_queue_cmd_ring()
549 alloc_and_scatter_data_area(udev, se_cmd->t_bidi_data_sg, in tcmu_queue_cmd_ring()
550 se_cmd->t_bidi_data_nents, &iov, &iov_cnt, in tcmu_queue_cmd_ring()
560 memcpy((void *) mb + cdb_off, se_cmd->t_task_cdb, scsi_command_size(se_cmd->t_task_cdb)); in tcmu_queue_cmd_ring()
579 tcmu_queue_cmd(struct se_cmd *se_cmd) in tcmu_queue_cmd() argument
581 struct se_device *se_dev = se_cmd->se_dev; in tcmu_queue_cmd()
586 tcmu_cmd = tcmu_alloc_cmd(se_cmd); in tcmu_queue_cmd()
605 struct se_cmd *se_cmd = cmd->se_cmd; in tcmu_handle_completion() local
622 cmd->se_cmd); in tcmu_handle_completion()
625 memcpy(se_cmd->sense_buffer, entry->rsp.sense_buffer, in tcmu_handle_completion()
626 se_cmd->scsi_sense_length); in tcmu_handle_completion()
628 } else if (se_cmd->se_cmd_flags & SCF_BIDI) { in tcmu_handle_completion()
632 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { in tcmu_handle_completion()
635 } else if (se_cmd->data_direction == DMA_TO_DEVICE) { in tcmu_handle_completion()
637 } else if (se_cmd->data_direction != DMA_NONE) { in tcmu_handle_completion()
639 se_cmd->data_direction); in tcmu_handle_completion()
642 target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); in tcmu_handle_completion()
643 cmd->se_cmd = NULL; in tcmu_handle_completion()
721 target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION); in tcmu_check_expired_cmd()
722 cmd->se_cmd = NULL; in tcmu_check_expired_cmd()
1169 tcmu_parse_cdb(struct se_cmd *cmd) in tcmu_parse_cdb()