From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>,
James Bottomley <james.bottomley@steeleye.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Subject: [PATCH 4/9] qla2xxx: Detect GPSC capabilities within a fabric.
Date: Wed, 13 Dec 2006 19:20:28 -0800 [thread overview]
Message-ID: <11660664332331-git-send-email-andrew.vasquez@qlogic.com> (raw)
In-Reply-To: <20061214031935.GB538@andrew-vasquezs-powerbook-g4-15.local>
Disable subsequent GPSC queries if Fabric Management services do
not support the operation.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_def.h | 2 ++
drivers/scsi/qla2xxx/qla_gs.c | 18 ++++++++++++++++--
drivers/scsi/qla2xxx/qla_isr.c | 2 ++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index c4fc40f..2c10130 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1602,6 +1602,7 @@ typedef struct fc_port {
#define CT_REJECT_RESPONSE 0x8001
#define CT_ACCEPT_RESPONSE 0x8002
+#define CT_REASON_INVALID_COMMAND_CODE 0x01
#define CT_REASON_CANNOT_PERFORM 0x09
#define CT_EXPL_ALREADY_REGISTERED 0x10
@@ -2079,6 +2080,7 @@ typedef struct scsi_qla_host {
uint32_t msi_enabled :1;
uint32_t msix_enabled :1;
uint32_t disable_serdes :1;
+ uint32_t gpsc_supported :1;
} flags;
atomic_t loop_state;
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 220ec41..ec5b2dd 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -143,6 +143,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt,
DEBUG2_3(qla2x00_dump_buffer(
(uint8_t *)&ct_rsp->header,
sizeof(struct ct_rsp_hdr)));
+ rval = QLA_INVALID_COMMAND;
} else
rval = QLA_SUCCESS;
break;
@@ -1784,6 +1785,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return QLA_FUNCTION_FAILED;
+ if (!ha->flags.gpsc_supported)
+ return QLA_FUNCTION_FAILED;
rval = qla2x00_mgmt_svr_login(ha);
if (rval)
@@ -1813,8 +1816,19 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
/*EMPTY*/
DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB "
"failed (%d).\n", ha->host_no, rval));
- } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp,
- "GPSC") != QLA_SUCCESS) {
+ } else if ((rval = qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp,
+ "GPSC")) != QLA_SUCCESS) {
+ /* FM command unsupported? */
+ if (rval == QLA_INVALID_COMMAND &&
+ ct_rsp->header.reason_code ==
+ CT_REASON_INVALID_COMMAND_CODE) {
+ DEBUG2(printk("scsi(%ld): GPSC command "
+ "unsupported, disabling query...\n",
+ ha->host_no));
+ ha->flags.gpsc_supported = 0;
+ rval = QLA_FUNCTION_FAILED;
+ break;
+ }
rval = QLA_FUNCTION_FAILED;
} else {
/* Save portname */
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index d3b6df4..79115c1 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -475,6 +475,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
}
set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
+
+ ha->flags.gpsc_supported = 1;
break;
case MBA_CHG_IN_CONNECTION: /* Change in connection mode */
--
1.4.4.2.g4cfec
next prev parent reply other threads:[~2006-12-14 3:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 3:19 [PATCH 0/9] qla2xxx: fixes for 2.6.20 [8.01.07-k4] Andrew Vasquez
2006-12-14 3:20 ` [PATCH 1/9] qla2xxx: Don't log trace-control async-events Andrew Vasquez
2006-12-14 3:20 ` [PATCH 2/9] qla2xxx: Correct endianess issue while interrogating MS status Andrew Vasquez
2006-12-14 3:20 ` [PATCH 3/9] qla2xxx: Use proper prep_ms_iocb() function during GFPN_ID Andrew Vasquez
2006-12-14 3:20 ` Andrew Vasquez [this message]
2006-12-14 3:20 ` [PATCH 5/9] qla2xxx: Correct IOCB queueing mechanism for ISP54XX HBAs Andrew Vasquez
2006-12-14 3:20 ` [PATCH 6/9] qla2xxx: Correct reset handling logic Andrew Vasquez
2006-12-14 3:20 ` [PATCH 7/9] qla2xxx: Perform a fw-dump when an ISP23xx RISC-paused state is detected Andrew Vasquez
2006-12-14 3:20 ` [PATCH 8/9] qla2xxx: Use generic isp_ops.fw_dump() function Andrew Vasquez
2006-12-14 3:20 ` [PATCH 9/9] qla2xxx: Update version number to 8.01.07-k4 Andrew Vasquez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11660664332331-git-send-email-andrew.vasquez@qlogic.com \
--to=andrew.vasquez@qlogic.com \
--cc=james.bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox