Lines Matching refs:se_cmd

239 	transport_generic_free_cmd(&mcmd->se_cmd, 0);  in tcm_qla2xxx_complete_mcmd()
268 transport_generic_free_cmd(&cmd->se_cmd, 0); in tcm_qla2xxx_complete_free()
283 cmd->se_cmd.map_tag = tag; in tcm_qla2xxx_get_cmd()
284 cmd->se_cmd.map_cpu = cpu; in tcm_qla2xxx_get_cmd()
291 target_free_tag(cmd->sess->se_sess, &cmd->se_cmd); in tcm_qla2xxx_rel_cmd()
314 static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd) in tcm_qla2xxx_check_stop_free() argument
318 if ((se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) == 0) { in tcm_qla2xxx_check_stop_free()
319 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_check_stop_free()
323 return target_put_sess_cmd(se_cmd); in tcm_qla2xxx_check_stop_free()
329 static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd) in tcm_qla2xxx_release_cmd() argument
333 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) { in tcm_qla2xxx_release_cmd()
334 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, in tcm_qla2xxx_release_cmd()
335 struct qla_tgt_mgmt_cmd, se_cmd); in tcm_qla2xxx_release_cmd()
339 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_release_cmd()
385 static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) in tcm_qla2xxx_write_pending() argument
387 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_write_pending()
388 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_write_pending()
397 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_write_pending()
398 cmd->se_cmd.transport_state, in tcm_qla2xxx_write_pending()
399 cmd->se_cmd.t_state, in tcm_qla2xxx_write_pending()
400 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_write_pending()
401 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_write_pending()
406 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_write_pending()
407 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_write_pending()
409 cmd->sg_cnt = se_cmd->t_data_nents; in tcm_qla2xxx_write_pending()
410 cmd->sg = se_cmd->t_data_sg; in tcm_qla2xxx_write_pending()
412 cmd->prot_sg_cnt = se_cmd->t_prot_nents; in tcm_qla2xxx_write_pending()
413 cmd->prot_sg = se_cmd->t_prot_sg; in tcm_qla2xxx_write_pending()
414 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size; in tcm_qla2xxx_write_pending()
415 se_cmd->pi_err = 0; in tcm_qla2xxx_write_pending()
429 static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) in tcm_qla2xxx_get_cmd_state() argument
431 if (!(se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) { in tcm_qla2xxx_get_cmd_state()
432 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_get_cmd_state()
433 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_get_cmd_state()
447 struct se_cmd *se_cmd = &cmd->se_cmd; in tcm_qla2xxx_handle_cmd() local
459 if (se_cmd->cpuid != WORK_CPU_UNBOUND) in tcm_qla2xxx_handle_cmd()
484 return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0], in tcm_qla2xxx_handle_cmd()
500 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
509 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
513 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
517 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
525 if (cmd->se_cmd.pi_err) in tcm_qla2xxx_handle_data_work()
526 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
527 cmd->se_cmd.pi_err); in tcm_qla2xxx_handle_data_work()
529 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
535 return target_execute_cmd(&cmd->se_cmd); in tcm_qla2xxx_handle_data_work()
557 struct se_cmd *se_cmd = &cmd->se_cmd; in tcm_qla2xxx_dif_tags() local
559 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD)) in tcm_qla2xxx_dif_tags()
562 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG)) in tcm_qla2xxx_dif_tags()
575 struct se_cmd *se_cmd = &mcmd->se_cmd; in tcm_qla2xxx_handle_tmr() local
615 return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd, in tcm_qla2xxx_handle_tmr()
623 struct se_cmd *secmd; in tcm_qla2xxx_find_cmd_by_tag()
636 cmd = container_of(secmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_find_cmd_by_tag()
645 static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_data_in() argument
647 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_data_in()
648 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_data_in()
658 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_data_in()
659 cmd->se_cmd.transport_state, in tcm_qla2xxx_queue_data_in()
660 cmd->se_cmd.t_state, in tcm_qla2xxx_queue_data_in()
661 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_data_in()
667 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_data_in()
668 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_data_in()
670 cmd->sg_cnt = se_cmd->t_data_nents; in tcm_qla2xxx_queue_data_in()
671 cmd->sg = se_cmd->t_data_sg; in tcm_qla2xxx_queue_data_in()
674 cmd->prot_sg_cnt = se_cmd->t_prot_nents; in tcm_qla2xxx_queue_data_in()
675 cmd->prot_sg = se_cmd->t_prot_sg; in tcm_qla2xxx_queue_data_in()
676 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size; in tcm_qla2xxx_queue_data_in()
677 se_cmd->pi_err = 0; in tcm_qla2xxx_queue_data_in()
683 se_cmd->scsi_status); in tcm_qla2xxx_queue_data_in()
686 static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_status() argument
688 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_status()
689 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_status()
701 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_status()
702 cmd->se_cmd.transport_state, cmd->se_cmd.t_state, in tcm_qla2xxx_queue_status()
703 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_status()
707 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_status()
711 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_status()
714 if (se_cmd->data_direction == DMA_FROM_DEVICE) { in tcm_qla2xxx_queue_status()
719 if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { in tcm_qla2xxx_queue_status()
720 se_cmd->se_cmd_flags &= ~SCF_OVERFLOW_BIT; in tcm_qla2xxx_queue_status()
721 se_cmd->residual_count = 0; in tcm_qla2xxx_queue_status()
723 se_cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT; in tcm_qla2xxx_queue_status()
724 se_cmd->residual_count += se_cmd->data_length; in tcm_qla2xxx_queue_status()
731 return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); in tcm_qla2xxx_queue_status()
734 static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_tm_rsp() argument
736 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; in tcm_qla2xxx_queue_tm_rsp()
737 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, in tcm_qla2xxx_queue_tm_rsp()
738 struct qla_tgt_mgmt_cmd, se_cmd); in tcm_qla2xxx_queue_tm_rsp()
768 static void tcm_qla2xxx_aborted_task(struct se_cmd *se_cmd) in tcm_qla2xxx_aborted_task() argument
770 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_aborted_task()
771 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_aborted_task()