Lines Matching refs:se_cmd

239 	transport_generic_free_cmd(&mcmd->se_cmd, 0);  in tcm_qla2xxx_complete_mcmd()
273 transport_generic_free_cmd(&cmd->se_cmd, 0); in tcm_qla2xxx_complete_free()
288 cmd->se_cmd.map_tag = tag; in tcm_qla2xxx_get_cmd()
289 cmd->se_cmd.map_cpu = cpu; in tcm_qla2xxx_get_cmd()
296 target_free_tag(cmd->sess->se_sess, &cmd->se_cmd); in tcm_qla2xxx_rel_cmd()
319 static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd) in tcm_qla2xxx_check_stop_free() argument
323 if ((se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) == 0) { in tcm_qla2xxx_check_stop_free()
324 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_check_stop_free()
328 return target_put_sess_cmd(se_cmd); in tcm_qla2xxx_check_stop_free()
334 static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd) in tcm_qla2xxx_release_cmd() argument
338 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) { in tcm_qla2xxx_release_cmd()
339 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, in tcm_qla2xxx_release_cmd()
340 struct qla_tgt_mgmt_cmd, se_cmd); in tcm_qla2xxx_release_cmd()
344 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
460 if (se_cmd->cpuid != WORK_CPU_UNBOUND) in tcm_qla2xxx_handle_cmd()
489 rc = target_init_cmd(se_cmd, se_sess, &cmd->sense_buffer[0], in tcm_qla2xxx_handle_cmd()
495 if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0, in tcm_qla2xxx_handle_cmd()
499 target_submit(se_cmd); in tcm_qla2xxx_handle_cmd()
514 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
523 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
527 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
531 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
539 if (cmd->se_cmd.pi_err) in tcm_qla2xxx_handle_data_work()
540 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
541 cmd->se_cmd.pi_err); in tcm_qla2xxx_handle_data_work()
543 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
549 return target_execute_cmd(&cmd->se_cmd); in tcm_qla2xxx_handle_data_work()
571 struct se_cmd *se_cmd = &cmd->se_cmd; in tcm_qla2xxx_dif_tags() local
573 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD)) in tcm_qla2xxx_dif_tags()
576 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG)) in tcm_qla2xxx_dif_tags()
589 struct se_cmd *se_cmd = &mcmd->se_cmd; in tcm_qla2xxx_handle_tmr() local
627 return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd, in tcm_qla2xxx_handle_tmr()
642 if (cmd->se_cmd.tag == tag) in tcm_qla2xxx_find_cmd_by_tag()
652 static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_data_in() argument
654 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_data_in()
655 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_data_in()
664 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_data_in()
665 cmd->se_cmd.transport_state, in tcm_qla2xxx_queue_data_in()
666 cmd->se_cmd.t_state, in tcm_qla2xxx_queue_data_in()
667 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_data_in()
672 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_data_in()
673 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_data_in()
675 cmd->sg_cnt = se_cmd->t_data_nents; in tcm_qla2xxx_queue_data_in()
676 cmd->sg = se_cmd->t_data_sg; in tcm_qla2xxx_queue_data_in()
679 cmd->prot_sg_cnt = se_cmd->t_prot_nents; in tcm_qla2xxx_queue_data_in()
680 cmd->prot_sg = se_cmd->t_prot_sg; in tcm_qla2xxx_queue_data_in()
681 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size; in tcm_qla2xxx_queue_data_in()
682 se_cmd->pi_err = 0; in tcm_qla2xxx_queue_data_in()
688 se_cmd->scsi_status); in tcm_qla2xxx_queue_data_in()
691 static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_status() argument
693 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_status()
694 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_status()
705 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_status()
706 cmd->se_cmd.transport_state, cmd->se_cmd.t_state, in tcm_qla2xxx_queue_status()
707 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_status()
710 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_status()
714 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_status()
717 if (se_cmd->data_direction == DMA_FROM_DEVICE) { in tcm_qla2xxx_queue_status()
722 if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { in tcm_qla2xxx_queue_status()
723 se_cmd->se_cmd_flags &= ~SCF_OVERFLOW_BIT; in tcm_qla2xxx_queue_status()
724 se_cmd->residual_count = 0; in tcm_qla2xxx_queue_status()
726 se_cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT; in tcm_qla2xxx_queue_status()
727 se_cmd->residual_count += se_cmd->data_length; in tcm_qla2xxx_queue_status()
734 return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); in tcm_qla2xxx_queue_status()
737 static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_tm_rsp() argument
739 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; in tcm_qla2xxx_queue_tm_rsp()
740 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, in tcm_qla2xxx_queue_tm_rsp()
741 struct qla_tgt_mgmt_cmd, se_cmd); in tcm_qla2xxx_queue_tm_rsp()
771 static void tcm_qla2xxx_aborted_task(struct se_cmd *se_cmd) in tcm_qla2xxx_aborted_task() argument
776 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) in tcm_qla2xxx_aborted_task()
779 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_aborted_task()