All of lore.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
To: jbottomley@parallels.com
Cc: hch@lst.de, giridhar.malavali@qlogic.com,
	himanshu.madhani@qlogic.com, andrew.vasquez@qlogic.com,
	linux-scsi@vger.kernel.org
Subject: [PATCH  05/14] qla2xxx: Add adapter checks for FAWWN functionality.
Date: Tue, 4 Aug 2015 13:37:55 -0400	[thread overview]
Message-ID: <1438709884-623-6-git-send-email-himanshu.madhani@qlogic.com> (raw)
In-Reply-To: <1438709884-623-1-git-send-email-himanshu.madhani@qlogic.com>

From: Saurav Kashyap <saurav.kashyap@qlogic.com>

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_def.h |    1 +
 drivers/scsi/qla2xxx/qla_mbx.c |   30 ++++++++++++++++--------------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 9ad819e..06d61a4 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3166,6 +3166,7 @@ struct qla_hw_data {
 #define IS_TGT_MODE_CAPABLE(ha)	(ha->tgt.atio_q_length)
 #define IS_SHADOW_REG_CAPABLE(ha)  (IS_QLA27XX(ha))
 #define IS_DPORT_CAPABLE(ha)  (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_FAWWN_CAPABLE(ha)	(IS_QLA83XX(ha) || IS_QLA27XX(ha))
 
 	/* HBA serial number */
 	uint8_t		serial0;
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index d19fe1b..5ac6577 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1135,20 +1135,22 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa,
 			vha->fcoe_vn_port_mac[0] = mcp->mb[13] & 0xff;
 		}
 		/* If FA-WWN supported */
-		if (mcp->mb[7] & BIT_14) {
-			vha->port_name[0] = MSB(mcp->mb[16]);
-			vha->port_name[1] = LSB(mcp->mb[16]);
-			vha->port_name[2] = MSB(mcp->mb[17]);
-			vha->port_name[3] = LSB(mcp->mb[17]);
-			vha->port_name[4] = MSB(mcp->mb[18]);
-			vha->port_name[5] = LSB(mcp->mb[18]);
-			vha->port_name[6] = MSB(mcp->mb[19]);
-			vha->port_name[7] = LSB(mcp->mb[19]);
-			fc_host_port_name(vha->host) =
-			    wwn_to_u64(vha->port_name);
-			ql_dbg(ql_dbg_mbx, vha, 0x10ca,
-			    "FA-WWN acquired %016llx\n",
-			    wwn_to_u64(vha->port_name));
+		if (IS_FAWWN_CAPABLE(vha->hw)) {
+			if (mcp->mb[7] & BIT_14) {
+				vha->port_name[0] = MSB(mcp->mb[16]);
+				vha->port_name[1] = LSB(mcp->mb[16]);
+				vha->port_name[2] = MSB(mcp->mb[17]);
+				vha->port_name[3] = LSB(mcp->mb[17]);
+				vha->port_name[4] = MSB(mcp->mb[18]);
+				vha->port_name[5] = LSB(mcp->mb[18]);
+				vha->port_name[6] = MSB(mcp->mb[19]);
+				vha->port_name[7] = LSB(mcp->mb[19]);
+				fc_host_port_name(vha->host) =
+				    wwn_to_u64(vha->port_name);
+				ql_dbg(ql_dbg_mbx, vha, 0x10ca,
+				    "FA-WWN acquired %016llx\n",
+				    wwn_to_u64(vha->port_name));
+			}
 		}
 	}
 
-- 
1.7.7


  parent reply	other threads:[~2015-08-04 18:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 17:37 [PATCH 00/14] qla2xxx: Patches for scsi "misc" branch Himanshu Madhani
2015-08-04 17:37 ` [PATCH 01/14] qla2xxx: Add serdes register read/write support for ISP25xx Himanshu Madhani
2015-08-04 17:37 ` [PATCH 02/14] qla2xxx: Handle AEN8014 incoming port logout Himanshu Madhani
2015-08-04 17:37 ` [PATCH 03/14] qla2xxx: Use ssdid to gate semaphore manipulation Himanshu Madhani
2015-08-04 17:37 ` [PATCH 04/14] qla2xxx: Pause risc before manipulating risc semaphore Himanshu Madhani
2015-08-04 17:37 ` Himanshu Madhani [this message]
2015-08-04 17:37 ` [PATCH 06/14] qla2xxx: Do not crash system for sp ref count zero Himanshu Madhani
2015-08-04 17:37 ` [PATCH 07/14] qla2xxx: Do not reset adapter if SRB handle is in range Himanshu Madhani
2015-08-04 17:37 ` [PATCH 08/14] qla2xxx: Do not reset ISP for error entry with an out of range handle Himanshu Madhani
2015-08-04 17:37 ` [PATCH 09/14] qla2xxx: Add support to show MPI and PEP FW version for ISP27xx Himanshu Madhani
2015-08-04 17:38 ` [PATCH 10/14] qla2xxx: Remove decrement of sp reference count in abort handler Himanshu Madhani
2015-08-04 17:38 ` [PATCH 11/14] qla2xxx: do not clear slot in outstanding cmd array Himanshu Madhani
2015-08-04 17:38 ` [PATCH 12/14] qla2xxx: Fix missing device login retries Himanshu Madhani
2015-08-04 17:38 ` [PATCH 13/14] qla2xxx: Add pci device id 0x2261 Himanshu Madhani
2015-08-04 17:38 ` [PATCH 14/14] qla2xxx: Update driver version to 8.07.00.26-k Himanshu Madhani

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=1438709884-623-6-git-send-email-himanshu.madhani@qlogic.com \
    --to=himanshu.madhani@qlogic.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=hch@lst.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.