Lines Matching refs:se_cmd
239 transport_generic_free_cmd(&mcmd->se_cmd, 0);
268 transport_generic_free_cmd(&cmd->se_cmd, 0);
283 cmd->se_cmd.map_tag = tag;
284 cmd->se_cmd.map_cpu = cpu;
291 target_free_tag(cmd->sess->se_sess, &cmd->se_cmd);
314 static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd)
318 if ((se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) == 0) {
319 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
323 return target_put_sess_cmd(se_cmd);
327 * fabric descriptor @se_cmd command to release
329 static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd)
333 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
334 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
335 struct qla_tgt_mgmt_cmd, se_cmd);
339 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
385 static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
387 struct qla_tgt_cmd *cmd = container_of(se_cmd,
388 struct qla_tgt_cmd, se_cmd);
397 cmd, kref_read(&cmd->se_cmd.cmd_kref),
398 cmd->se_cmd.transport_state,
399 cmd->se_cmd.t_state,
400 cmd->se_cmd.se_cmd_flags);
401 transport_generic_request_failure(&cmd->se_cmd,
406 cmd->bufflen = se_cmd->data_length;
407 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
409 cmd->sg_cnt = se_cmd->t_data_nents;
410 cmd->sg = se_cmd->t_data_sg;
412 cmd->prot_sg_cnt = se_cmd->t_prot_nents;
413 cmd->prot_sg = se_cmd->t_prot_sg;
414 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size;
415 se_cmd->pi_err = 0;
429 static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd)
431 if (!(se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) {
432 struct qla_tgt_cmd *cmd = container_of(se_cmd,
433 struct qla_tgt_cmd, se_cmd);
447 struct se_cmd *se_cmd = &cmd->se_cmd;
459 if (se_cmd->cpuid != WORK_CPU_UNBOUND)
484 return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0],
500 transport_generic_request_failure(&cmd->se_cmd,
509 cmd->se_cmd.pi_err =
513 cmd->se_cmd.pi_err =
517 cmd->se_cmd.pi_err =
525 if (cmd->se_cmd.pi_err)
526 transport_generic_request_failure(&cmd->se_cmd,
527 cmd->se_cmd.pi_err);
529 transport_generic_request_failure(&cmd->se_cmd,
535 return target_execute_cmd(&cmd->se_cmd);
557 struct se_cmd *se_cmd = &cmd->se_cmd;
559 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD))
562 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG))
575 struct se_cmd *se_cmd = &mcmd->se_cmd;
615 return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd,
623 struct se_cmd *secmd;
636 cmd = container_of(secmd, struct qla_tgt_cmd, se_cmd);
645 static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd)
647 struct qla_tgt_cmd *cmd = container_of(se_cmd,
648 struct qla_tgt_cmd, se_cmd);
657 cmd, kref_read(&cmd->se_cmd.cmd_kref),
658 cmd->se_cmd.transport_state,
659 cmd->se_cmd.t_state,
660 cmd->se_cmd.se_cmd_flags);
665 cmd->bufflen = se_cmd->data_length;
666 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
668 cmd->sg_cnt = se_cmd->t_data_nents;
669 cmd->sg = se_cmd->t_data_sg;
672 cmd->prot_sg_cnt = se_cmd->t_prot_nents;
673 cmd->prot_sg = se_cmd->t_prot_sg;
674 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size;
675 se_cmd->pi_err = 0;
681 se_cmd->scsi_status);
684 static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd)
686 struct qla_tgt_cmd *cmd = container_of(se_cmd,
687 struct qla_tgt_cmd, se_cmd);
698 cmd, kref_read(&cmd->se_cmd.cmd_kref),
699 cmd->se_cmd.transport_state, cmd->se_cmd.t_state,
700 cmd->se_cmd.se_cmd_flags);
703 cmd->bufflen = se_cmd->data_length;
707 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
710 if (se_cmd->data_direction == DMA_FROM_DEVICE) {
715 if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
716 se_cmd->se_cmd_flags &= ~SCF_OVERFLOW_BIT;
717 se_cmd->residual_count = 0;
719 se_cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT;
720 se_cmd->residual_count += se_cmd->data_length;
727 return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status);
730 static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd)
732 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
733 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
734 struct qla_tgt_mgmt_cmd, se_cmd);
764 static void tcm_qla2xxx_aborted_task(struct se_cmd *se_cmd)
766 struct qla_tgt_cmd *cmd = container_of(se_cmd,
767 struct qla_tgt_cmd, se_cmd);
1835 * Current maximum is ~4.9 MB per se_cmd->t_data_sg with PAGE_SIZE=4096