From 32ec48443c461a15d144367160ff9d1128cfb328 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 24 Feb 2011 21:15:29 +0000 Subject: [PATCH] Disable accepting initiator mode commands if initiator mode not enabled git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3261 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_os.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index df9f2f632..9cfe44e2c 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -527,6 +527,15 @@ qla24xx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) goto qc24_host_busy; } +#ifdef CONFIG_SCSI_QLA2XXX_TARGET + if (unlikely(!qla_ini_mode_enabled(ha))) { + DEBUG2_3_11(printk("%s(%ld): Initiator command in the initiator " + "disabled mode\n", __func__, ha->host_no)); + cmd->result = DID_NO_CONNECT << 16; + goto qc24_fail_command; + } +#endif + spin_unlock_irq(ha->host->host_lock); sp = qla2x00_get_new_sp(pha, fcport, cmd, done);