From 5503fb06465a1ac12124a140e687ac69d35e8b31 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 18 Aug 2011 00:27:12 +0000 Subject: [PATCH] Disable accepting initiator mode commands if initiator mode not enabled for 23xx- chips as well as suggested by ido benda . This is extension of r3261 to qla2x00_queuecommand(). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3819 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_os.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index e1b117baa..a4f7c259e 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -461,6 +461,16 @@ qla2x00_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) goto qc_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 qc_fail_command; + } +#endif + + spin_unlock_irq(ha->host->host_lock); sp = qla2x00_get_new_sp(ha, fcport, cmd, done);