Lines Matching defs:se_cmd

239 	transport_generic_free_cmd(&mcmd->se_cmd, 0);
273 transport_generic_free_cmd(&cmd->se_cmd, 0);
288 cmd->se_cmd.map_tag = tag;
289 cmd->se_cmd.map_cpu = cpu;
296 target_free_tag(cmd->sess->se_sess, &cmd->se_cmd);
319 static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd)
323 if ((se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) == 0) {
324 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
328 return target_put_sess_cmd(se_cmd);
332 * fabric descriptor @se_cmd command to release
334 static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd)
338 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
339 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
340 struct qla_tgt_mgmt_cmd, se_cmd);
344 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
380 static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
382 struct qla_tgt_cmd *cmd = container_of(se_cmd,
383 struct qla_tgt_cmd, se_cmd);
392 cmd, kref_read(&cmd->se_cmd.cmd_kref),
393 cmd->se_cmd.transport_state,
394 cmd->se_cmd.t_state,
395 cmd->se_cmd.se_cmd_flags);
396 transport_generic_request_failure(&cmd->se_cmd,
401 cmd->bufflen = se_cmd->data_length;
402 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
404 cmd->sg_cnt = se_cmd->t_data_nents;
405 cmd->sg = se_cmd->t_data_sg;
407 cmd->prot_sg_cnt = se_cmd->t_prot_nents;
408 cmd->prot_sg = se_cmd->t_prot_sg;
409 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size;
410 se_cmd->pi_err = 0;
419 static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd)
421 if (!(se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) {
422 struct qla_tgt_cmd *cmd = container_of(se_cmd,
423 struct qla_tgt_cmd, se_cmd);
437 struct se_cmd *se_cmd = &cmd->se_cmd;
450 if (se_cmd->cpuid != WORK_CPU_UNBOUND)
479 rc = target_init_cmd(se_cmd, se_sess, &cmd->sense_buffer[0],
485 if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0,
489 target_submit(se_cmd);
504 transport_generic_request_failure(&cmd->se_cmd,
513 cmd->se_cmd.pi_err =
517 cmd->se_cmd.pi_err =
521 cmd->se_cmd.pi_err =
529 if (cmd->se_cmd.pi_err)
530 transport_generic_request_failure(&cmd->se_cmd,
531 cmd->se_cmd.pi_err);
533 transport_generic_request_failure(&cmd->se_cmd,
539 return target_execute_cmd(&cmd->se_cmd);
561 struct se_cmd *se_cmd = &cmd->se_cmd;
563 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD))
566 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG))
579 struct se_cmd *se_cmd = &mcmd->se_cmd;
617 return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd,
632 if (cmd->se_cmd.tag == tag)
642 static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd)
644 struct qla_tgt_cmd *cmd = container_of(se_cmd,
645 struct qla_tgt_cmd, se_cmd);
654 cmd, kref_read(&cmd->se_cmd.cmd_kref),
655 cmd->se_cmd.transport_state,
656 cmd->se_cmd.t_state,
657 cmd->se_cmd.se_cmd_flags);
662 cmd->bufflen = se_cmd->data_length;
663 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
665 cmd->sg_cnt = se_cmd->t_data_nents;
666 cmd->sg = se_cmd->t_data_sg;
669 cmd->prot_sg_cnt = se_cmd->t_prot_nents;
670 cmd->prot_sg = se_cmd->t_prot_sg;
671 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size;
672 se_cmd->pi_err = 0;
678 se_cmd->scsi_status);
681 static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd)
683 struct qla_tgt_cmd *cmd = container_of(se_cmd,
684 struct qla_tgt_cmd, se_cmd);
695 cmd, kref_read(&cmd->se_cmd.cmd_kref),
696 cmd->se_cmd.transport_state, cmd->se_cmd.t_state,
697 cmd->se_cmd.se_cmd_flags);
700 cmd->bufflen = se_cmd->data_length;
704 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd);
707 if (se_cmd->data_direction == DMA_FROM_DEVICE) {
712 if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
713 se_cmd->se_cmd_flags &= ~SCF_OVERFLOW_BIT;
714 se_cmd->residual_count = 0;
716 se_cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT;
717 se_cmd->residual_count += se_cmd->data_length;
724 return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status);
727 static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd)
729 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
730 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd,
731 struct qla_tgt_mgmt_cmd, se_cmd);
761 static void tcm_qla2xxx_aborted_task(struct se_cmd *se_cmd)
766 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)
769 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
1787 * Current maximum is ~4.9 MB per se_cmd->t_data_sg with PAGE_SIZE=4096