Lines Matching refs:se_cmd

177 	struct se_cmd *se_cmd;  member
581 struct se_cmd *se_cmd = cmd->se_cmd; in tcmu_cmd_set_block_cnts() local
584 cmd->dbi_cnt = DIV_ROUND_UP(se_cmd->data_length, blk_size); in tcmu_cmd_set_block_cnts()
586 if (se_cmd->se_cmd_flags & SCF_BIDI) { in tcmu_cmd_set_block_cnts()
587 BUG_ON(!(se_cmd->t_bidi_data_sg && se_cmd->t_bidi_data_nents)); in tcmu_cmd_set_block_cnts()
588 for (i = 0, len = 0; i < se_cmd->t_bidi_data_nents; i++) in tcmu_cmd_set_block_cnts()
589 len += se_cmd->t_bidi_data_sg[i].length; in tcmu_cmd_set_block_cnts()
633 static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd) in tcmu_alloc_cmd() argument
635 struct se_device *se_dev = se_cmd->se_dev; in tcmu_alloc_cmd()
644 tcmu_cmd->se_cmd = se_cmd; in tcmu_alloc_cmd()
777 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in scatter_data_area() local
779 tcmu_copy_data(udev, tcmu_cmd, TCMU_SG_TO_DATA_AREA, se_cmd->t_data_sg, in scatter_data_area()
780 se_cmd->t_data_nents, iov, se_cmd->data_length); in scatter_data_area()
786 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in gather_data_area() local
791 data_sg = se_cmd->t_data_sg; in gather_data_area()
792 data_nents = se_cmd->t_data_nents; in gather_data_area()
802 data_sg = se_cmd->t_bidi_data_sg; in gather_data_area()
803 data_nents = se_cmd->t_bidi_data_nents; in gather_data_area()
880 iov_cnt = tcmu_get_empty_blocks(udev, cmd, cmd->se_cmd->data_length); in tcmu_alloc_data_space()
903 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in tcmu_cmd_get_cmd_size() local
907 round_up(scsi_command_size(se_cmd->t_task_cdb), in tcmu_cmd_get_cmd_size()
1015 struct se_cmd *se_cmd = tcmu_cmd->se_cmd; in queue_cmd_ring() local
1098 if (se_cmd->data_direction == DMA_TO_DEVICE || in queue_cmd_ring()
1099 se_cmd->se_cmd_flags & SCF_BIDI) in queue_cmd_ring()
1102 tcmu_setup_iovs(udev, tcmu_cmd, &iov, se_cmd->data_length); in queue_cmd_ring()
1107 if (se_cmd->se_cmd_flags & SCF_BIDI) { in queue_cmd_ring()
1121 memcpy((void *) mb + cdb_off, se_cmd->t_task_cdb, scsi_command_size(se_cmd->t_task_cdb)); in queue_cmd_ring()
1203 tcmu_queue_cmd(struct se_cmd *se_cmd) in tcmu_queue_cmd() argument
1205 struct se_device *se_dev = se_cmd->se_dev; in tcmu_queue_cmd()
1211 tcmu_cmd = tcmu_alloc_cmd(se_cmd); in tcmu_queue_cmd()
1216 if (!(se_cmd->transport_state & CMD_T_ABORTED)) in tcmu_queue_cmd()
1221 se_cmd->priv = tcmu_cmd; in tcmu_queue_cmd()
1261 struct se_cmd *se_cmd; in tcmu_tmr_notify() local
1268 list_for_each_entry(se_cmd, cmd_list, state_list) { in tcmu_tmr_notify()
1270 if (!se_cmd->priv) in tcmu_tmr_notify()
1272 cmd = se_cmd->priv; in tcmu_tmr_notify()
1283 se_cmd->priv = NULL; in tcmu_tmr_notify()
1284 target_complete_cmd(se_cmd, SAM_STAT_TASK_ABORTED); in tcmu_tmr_notify()
1305 list_for_each_entry(se_cmd, cmd_list, state_list) { in tcmu_tmr_notify()
1306 if (!se_cmd->priv) in tcmu_tmr_notify()
1308 cmd = se_cmd->priv; in tcmu_tmr_notify()
1323 struct se_cmd *se_cmd = cmd->se_cmd; in tcmu_handle_completion() local
1334 WARN_ON_ONCE(se_cmd); in tcmu_handle_completion()
1351 cmd->se_cmd); in tcmu_handle_completion()
1356 read_len = se_cmd->data_length; in tcmu_handle_completion()
1357 if (se_cmd->data_direction == DMA_FROM_DEVICE && in tcmu_handle_completion()
1365 transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer); in tcmu_handle_completion()
1369 se_cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL; in tcmu_handle_completion()
1371 if (se_cmd->se_cmd_flags & SCF_BIDI) { in tcmu_handle_completion()
1374 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { in tcmu_handle_completion()
1376 } else if (se_cmd->data_direction == DMA_TO_DEVICE) { in tcmu_handle_completion()
1378 } else if (se_cmd->data_direction != DMA_NONE) { in tcmu_handle_completion()
1380 se_cmd->data_direction); in tcmu_handle_completion()
1384 se_cmd->priv = NULL; in tcmu_handle_completion()
1387 target_complete_cmd_with_length(cmd->se_cmd, in tcmu_handle_completion()
1390 target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); in tcmu_handle_completion()
1520 struct se_cmd *se_cmd; in tcmu_check_expired_ring_cmd() local
1527 se_cmd = cmd->se_cmd; in tcmu_check_expired_ring_cmd()
1528 se_cmd->priv = NULL; in tcmu_check_expired_ring_cmd()
1529 cmd->se_cmd = NULL; in tcmu_check_expired_ring_cmd()
1534 target_complete_cmd(se_cmd, SAM_STAT_CHECK_CONDITION); in tcmu_check_expired_ring_cmd()
1539 struct se_cmd *se_cmd; in tcmu_check_expired_queue_cmd() local
1548 se_cmd = cmd->se_cmd; in tcmu_check_expired_queue_cmd()
1551 se_cmd->priv = NULL; in tcmu_check_expired_queue_cmd()
1552 target_complete_cmd(se_cmd, SAM_STAT_TASK_SET_FULL); in tcmu_check_expired_queue_cmd()
1778 tcmu_cmd->se_cmd->priv = NULL; in run_qfull_queue()
1779 target_complete_cmd(tcmu_cmd->se_cmd, SAM_STAT_BUSY); in run_qfull_queue()
1792 tcmu_cmd->se_cmd->priv = NULL; in run_qfull_queue()
1793 target_complete_cmd(tcmu_cmd->se_cmd, in run_qfull_queue()
2381 WARN_ON(!cmd->se_cmd); in tcmu_reset_ring()
2383 cmd->se_cmd->priv = NULL; in tcmu_reset_ring()
2389 target_complete_cmd(cmd->se_cmd, SAM_STAT_BUSY); in tcmu_reset_ring()
2392 target_complete_cmd(cmd->se_cmd, in tcmu_reset_ring()
2668 tcmu_parse_cdb(struct se_cmd *cmd) in tcmu_parse_cdb()