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()
380 static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) in tcm_qla2xxx_write_pending() argument
382 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_write_pending()
383 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_write_pending()
392 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_write_pending()
393 cmd->se_cmd.transport_state, in tcm_qla2xxx_write_pending()
394 cmd->se_cmd.t_state, in tcm_qla2xxx_write_pending()
395 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_write_pending()
396 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_write_pending()
401 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_write_pending()
402 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_write_pending()
404 cmd->sg_cnt = se_cmd->t_data_nents; in tcm_qla2xxx_write_pending()
405 cmd->sg = se_cmd->t_data_sg; in tcm_qla2xxx_write_pending()
407 cmd->prot_sg_cnt = se_cmd->t_prot_nents; in tcm_qla2xxx_write_pending()
408 cmd->prot_sg = se_cmd->t_prot_sg; in tcm_qla2xxx_write_pending()
409 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size; in tcm_qla2xxx_write_pending()
410 se_cmd->pi_err = 0; in tcm_qla2xxx_write_pending()
419 static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) in tcm_qla2xxx_get_cmd_state() argument
421 if (!(se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) { in tcm_qla2xxx_get_cmd_state()
422 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_get_cmd_state()
423 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_get_cmd_state()
437 struct se_cmd *se_cmd = &cmd->se_cmd; in tcm_qla2xxx_handle_cmd() local
450 if (se_cmd->cpuid != WORK_CPU_UNBOUND) in tcm_qla2xxx_handle_cmd()
479 rc = target_init_cmd(se_cmd, se_sess, &cmd->sense_buffer[0], in tcm_qla2xxx_handle_cmd()
485 if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0, in tcm_qla2xxx_handle_cmd()
489 target_submit(se_cmd); in tcm_qla2xxx_handle_cmd()
504 transport_generic_request_failure(&cmd->se_cmd, 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()
521 cmd->se_cmd.pi_err = in tcm_qla2xxx_handle_data_work()
529 if (cmd->se_cmd.pi_err) in tcm_qla2xxx_handle_data_work()
530 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
531 cmd->se_cmd.pi_err); in tcm_qla2xxx_handle_data_work()
533 transport_generic_request_failure(&cmd->se_cmd, in tcm_qla2xxx_handle_data_work()
539 return target_execute_cmd(&cmd->se_cmd); in tcm_qla2xxx_handle_data_work()
561 struct se_cmd *se_cmd = &cmd->se_cmd; in tcm_qla2xxx_dif_tags() local
563 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD)) in tcm_qla2xxx_dif_tags()
566 if (!(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG)) in tcm_qla2xxx_dif_tags()
579 struct se_cmd *se_cmd = &mcmd->se_cmd; in tcm_qla2xxx_handle_tmr() local
617 return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd, in tcm_qla2xxx_handle_tmr()
632 if (cmd->se_cmd.tag == tag) in tcm_qla2xxx_find_cmd_by_tag()
642 static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_data_in() argument
644 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_data_in()
645 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_data_in()
654 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_data_in()
655 cmd->se_cmd.transport_state, in tcm_qla2xxx_queue_data_in()
656 cmd->se_cmd.t_state, in tcm_qla2xxx_queue_data_in()
657 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_data_in()
662 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_data_in()
663 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_data_in()
665 cmd->sg_cnt = se_cmd->t_data_nents; in tcm_qla2xxx_queue_data_in()
666 cmd->sg = se_cmd->t_data_sg; in tcm_qla2xxx_queue_data_in()
669 cmd->prot_sg_cnt = se_cmd->t_prot_nents; in tcm_qla2xxx_queue_data_in()
670 cmd->prot_sg = se_cmd->t_prot_sg; in tcm_qla2xxx_queue_data_in()
671 cmd->blk_sz = se_cmd->se_dev->dev_attrib.block_size; in tcm_qla2xxx_queue_data_in()
672 se_cmd->pi_err = 0; in tcm_qla2xxx_queue_data_in()
678 se_cmd->scsi_status); in tcm_qla2xxx_queue_data_in()
681 static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_status() argument
683 struct qla_tgt_cmd *cmd = container_of(se_cmd, in tcm_qla2xxx_queue_status()
684 struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_queue_status()
695 cmd, kref_read(&cmd->se_cmd.cmd_kref), in tcm_qla2xxx_queue_status()
696 cmd->se_cmd.transport_state, cmd->se_cmd.t_state, in tcm_qla2xxx_queue_status()
697 cmd->se_cmd.se_cmd_flags); in tcm_qla2xxx_queue_status()
700 cmd->bufflen = se_cmd->data_length; in tcm_qla2xxx_queue_status()
704 cmd->dma_data_direction = target_reverse_dma_direction(se_cmd); in tcm_qla2xxx_queue_status()
707 if (se_cmd->data_direction == DMA_FROM_DEVICE) { in tcm_qla2xxx_queue_status()
712 if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { in tcm_qla2xxx_queue_status()
713 se_cmd->se_cmd_flags &= ~SCF_OVERFLOW_BIT; in tcm_qla2xxx_queue_status()
714 se_cmd->residual_count = 0; in tcm_qla2xxx_queue_status()
716 se_cmd->se_cmd_flags |= SCF_UNDERFLOW_BIT; in tcm_qla2xxx_queue_status()
717 se_cmd->residual_count += se_cmd->data_length; in tcm_qla2xxx_queue_status()
724 return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); in tcm_qla2xxx_queue_status()
727 static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) in tcm_qla2xxx_queue_tm_rsp() argument
729 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; in tcm_qla2xxx_queue_tm_rsp()
730 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, in tcm_qla2xxx_queue_tm_rsp()
731 struct qla_tgt_mgmt_cmd, se_cmd); in tcm_qla2xxx_queue_tm_rsp()
761 static void tcm_qla2xxx_aborted_task(struct se_cmd *se_cmd) in tcm_qla2xxx_aborted_task() argument
766 if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) in tcm_qla2xxx_aborted_task()
769 cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); in tcm_qla2xxx_aborted_task()