Lines Matching refs:cmd

105 static int srpt_queue_status(struct se_cmd *cmd);
958 enum dma_data_direction dir = target_reverse_dma_direction(&ioctx->cmd); in srpt_alloc_rw_ctxs()
1025 enum dma_data_direction dir = target_reverse_dma_direction(&ioctx->cmd); in srpt_free_rw_ctxs()
1101 ioctx->cmd.data_direction = *dir; in srpt_get_desc_tbl()
1305 memset(&ioctx->cmd, 0, sizeof(ioctx->cmd)); in srpt_get_send_ioctx()
1307 ioctx->cmd.map_tag = tag; in srpt_get_send_ioctx()
1308 ioctx->cmd.map_cpu = cpu; in srpt_get_send_ioctx()
1344 ioctx->state, ioctx->cmd.tag); in srpt_abort_cmd()
1357 pr_debug("tag %#llx: RDMA read error\n", ioctx->cmd.tag); in srpt_abort_cmd()
1358 transport_generic_request_failure(&ioctx->cmd, in srpt_abort_cmd()
1366 transport_generic_free_cmd(&ioctx->cmd, 0); in srpt_abort_cmd()
1369 transport_generic_free_cmd(&ioctx->cmd, 0); in srpt_abort_cmd()
1408 target_execute_cmd(&ioctx->cmd); in srpt_rdma_read_done()
1433 struct se_cmd *cmd = &ioctx->cmd; in srpt_build_cmd_rsp() local
1437 u32 resid = cmd->residual_count; in srpt_build_cmd_rsp()
1449 sense_data_len = ioctx->cmd.scsi_sense_length; in srpt_build_cmd_rsp()
1459 if (cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { in srpt_build_cmd_rsp()
1460 if (cmd->data_direction == DMA_TO_DEVICE) { in srpt_build_cmd_rsp()
1464 } else if (cmd->data_direction == DMA_FROM_DEVICE) { in srpt_build_cmd_rsp()
1469 } else if (cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { in srpt_build_cmd_rsp()
1470 if (cmd->data_direction == DMA_TO_DEVICE) { in srpt_build_cmd_rsp()
1474 } else if (cmd->data_direction == DMA_FROM_DEVICE) { in srpt_build_cmd_rsp()
1538 static int srpt_check_stop_free(struct se_cmd *cmd) in srpt_check_stop_free() argument
1540 struct srpt_send_ioctx *ioctx = container_of(cmd, in srpt_check_stop_free()
1541 struct srpt_send_ioctx, cmd); in srpt_check_stop_free()
1543 return target_put_sess_cmd(&ioctx->cmd); in srpt_check_stop_free()
1556 struct se_cmd *cmd; in srpt_handle_cmd() local
1567 cmd = &send_ioctx->cmd; in srpt_handle_cmd()
1568 cmd->tag = srp_cmd->tag; in srpt_handle_cmd()
1572 cmd->sam_task_attr = TCM_SIMPLE_TAG; in srpt_handle_cmd()
1576 cmd->sam_task_attr = TCM_ORDERED_TAG; in srpt_handle_cmd()
1579 cmd->sam_task_attr = TCM_HEAD_TAG; in srpt_handle_cmd()
1582 cmd->sam_task_attr = TCM_ACA_TAG; in srpt_handle_cmd()
1596 rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0], in srpt_handle_cmd()
1605 if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0, in srpt_handle_cmd()
1609 target_submit(cmd); in srpt_handle_cmd()
1613 target_send_busy(cmd); in srpt_handle_cmd()
1650 struct se_cmd *cmd; in srpt_handle_tsk_mgmt() local
1658 cmd = &send_ioctx->cmd; in srpt_handle_tsk_mgmt()
1665 send_ioctx->cmd.tag = srp_tsk->tag; in srpt_handle_tsk_mgmt()
1667 rc = target_submit_tmr(&send_ioctx->cmd, sess, NULL, in srpt_handle_tsk_mgmt()
1672 send_ioctx->cmd.se_tmr_req->response = TMR_FUNCTION_REJECTED; in srpt_handle_tsk_mgmt()
1673 cmd->se_tfo->queue_tm_rsp(cmd); in srpt_handle_tsk_mgmt()
1834 transport_generic_free_cmd(&ioctx->cmd, 0); in srpt_send_done()
2805 container_of(se_cmd, struct srpt_send_ioctx, cmd); in srpt_write_pending()
2814 target_execute_cmd(&ioctx->cmd); in srpt_write_pending()
2869 static void srpt_queue_response(struct se_cmd *cmd) in srpt_queue_response() argument
2872 container_of(cmd, struct srpt_send_ioctx, cmd); in srpt_queue_response()
2900 if (ioctx->cmd.data_direction == DMA_FROM_DEVICE && in srpt_queue_response()
2901 ioctx->cmd.data_length && in srpt_queue_response()
2912 resp_len = srpt_build_cmd_rsp(ch, ioctx, ioctx->cmd.tag, in srpt_queue_response()
2913 cmd->scsi_status); in srpt_queue_response()
2916 = tcm_to_srp_tsk_mgmt_status(cmd->se_tmr_req->response); in srpt_queue_response()
2918 ioctx->cmd.tag); in srpt_queue_response()
2948 __func__, ioctx->cmd.tag, ret); in srpt_queue_response()
2958 target_put_sess_cmd(&ioctx->cmd); in srpt_queue_response()
2961 static int srpt_queue_data_in(struct se_cmd *cmd) in srpt_queue_data_in() argument
2963 srpt_queue_response(cmd); in srpt_queue_data_in()
2967 static void srpt_queue_tm_rsp(struct se_cmd *cmd) in srpt_queue_tm_rsp() argument
2969 srpt_queue_response(cmd); in srpt_queue_tm_rsp()
2978 static void srpt_aborted_task(struct se_cmd *cmd) in srpt_aborted_task() argument
2980 struct srpt_send_ioctx *ioctx = container_of(cmd, in srpt_aborted_task()
2981 struct srpt_send_ioctx, cmd); in srpt_aborted_task()
2987 static int srpt_queue_status(struct se_cmd *cmd) in srpt_queue_status() argument
2991 ioctx = container_of(cmd, struct srpt_send_ioctx, cmd); in srpt_queue_status()
2992 BUG_ON(ioctx->sense_data != cmd->sense_buffer); in srpt_queue_status()
2993 if (cmd->se_cmd_flags & in srpt_queue_status()
2995 WARN_ON(cmd->scsi_status != SAM_STAT_CHECK_CONDITION); in srpt_queue_status()
2997 srpt_queue_response(cmd); in srpt_queue_status()
3398 struct srpt_send_ioctx, cmd); in srpt_release_cmd()
3403 !(ioctx->cmd.transport_state & CMD_T_ABORTED)); in srpt_release_cmd()
3439 ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd); in srpt_get_tcm_cmd_state()