From: Chad Dupuis <chad.dupuis@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, chad.dupuis@qlogic.com,
andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 12/14] qla2xxx: Correct fc_host port_state display.
Date: Fri, 18 Nov 2011 09:02:20 -0800 [thread overview]
Message-ID: <1321635742-16426-13-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1321635742-16426-1-git-send-email-chad.dupuis@qlogic.com>
From: Saurav Kashyap <saurav.kashyap@qlogic.com>
Add more fine grain parsing of vha->loop_state to export a more accurate
fc_host port_state.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index ac326c4..7acd442 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1762,12 +1762,31 @@ qla2x00_get_host_port_state(struct Scsi_Host *shost)
scsi_qla_host_t *vha = shost_priv(shost);
struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
- if (!base_vha->flags.online)
+ if (!base_vha->flags.online) {
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
- else if (atomic_read(&base_vha->loop_state) == LOOP_TIMEOUT)
- fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
- else
+ return;
+ }
+
+ switch (atomic_read(&base_vha->loop_state)) {
+ case LOOP_UPDATE:
+ fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
+ break;
+ case LOOP_DOWN:
+ if(test_bit(LOOP_RESYNC_NEEDED, &base_vha->dpc_flags))
+ fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
+ else
+ fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
+ break;
+ case LOOP_DEAD:
+ fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
+ break;
+ case LOOP_READY:
fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
+ break;
+ default:
+ fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
+ break;
+ }
}
static int
--
1.6.0.2
next prev parent reply other threads:[~2011-11-18 17:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 17:02 [PATCH 00/14] qla2xxx: Patches for 3.2-rc Chad Dupuis
2011-11-18 17:02 ` [PATCH 01/14] qla2xxx: Remove qla2x00_wait_for_loop_ready function Chad Dupuis
2011-11-18 17:02 ` [PATCH 02/14] qla2xxx: Check for SCSI status on underruns Chad Dupuis
2011-11-18 17:02 ` [PATCH 03/14] qla2xxx: Don't call alloc_fw_dump for ISP82XX Chad Dupuis
2011-11-18 17:02 ` [PATCH 04/14] qla2xxx: Revert back the request queue mapping to request queue 0 Chad Dupuis
2011-11-18 17:02 ` [PATCH 05/14] qla2xxx: Stop unconditional completion of mailbox commands issued in interrupt mode during firmware hang Chad Dupuis
2011-11-18 17:02 ` [PATCH 06/14] qla2xxx: Enable Minidump by default with default capture mask 0x1f Chad Dupuis
2011-11-18 17:02 ` [PATCH 07/14] qla2xxx: Return the correct value for a mailbox command if 82xx is in reset recovery Chad Dupuis
2011-11-18 17:02 ` [PATCH 08/14] qla2xxx: Display IPE error message for ISP82xx Chad Dupuis
2011-11-18 17:02 ` [PATCH 09/14] qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware hang Chad Dupuis
2011-11-18 17:02 ` [PATCH 10/14] qla2xxx: Clear mailbox busy flag during premature mailbox completion for ISP82xx Chad Dupuis
2011-11-18 17:02 ` [PATCH 11/14] qla2xxx: Disable generating pause frames when firmware hang detected " Chad Dupuis
2011-11-18 17:02 ` Chad Dupuis [this message]
2011-12-12 8:50 ` [PATCH 12/14] qla2xxx: Correct fc_host port_state display James Bottomley
2011-12-12 19:31 ` Chad Dupuis
2011-11-18 17:02 ` [PATCH 13/14] qla2xxx: Submit all chained IOCBs for passthrough commands on request queue 0 Chad Dupuis
2011-11-18 17:02 ` [PATCH 14/14] qla2xxx: Update version number to 8.03.07.12-k Chad Dupuis
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=1321635742-16426-13-git-send-email-chad.dupuis@qlogic.com \
--to=chad.dupuis@qlogic.com \
--cc=andrew.vasquez@qlogic.com \
--cc=giridhar.malavali@qlogic.com \
--cc=jbottomley@parallels.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;
as well as URLs for NNTP newsgroup(s).