public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
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/8] qla2xxx: Add support for fabric name FC transport attribute.
Date: Mon,  2 Oct 2006 12:00:46 -0700	[thread overview]
Message-ID: <11598156513789-git-send-email-andrew.vasquez@qlogic.com> (raw)
In-Reply-To: <20061002185947.GF16536@andrew-vasquezs-computer.local>

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_attr.c |   16 ++++++++++++++++
 drivers/scsi/qla2xxx/qla_def.h  |    1 +
 drivers/scsi/qla2xxx/qla_init.c |    3 ++-
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 4e1e175..d4cf51a 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -865,6 +865,20 @@ qla2x00_set_host_system_hostname(struct 
 	set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
 }
 
+static void
+qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
+{
+	scsi_qla_host_t *ha = to_qla_host(shost);
+	u64 node_name;
+
+	if (ha->device_flags & SWITCH_FOUND)
+		node_name = wwn_to_u64(ha->fabric_node_name);
+	else
+		node_name = wwn_to_u64(ha->node_name);
+
+	fc_host_fabric_name(shost) = node_name;
+}
+
 struct fc_function_template qla2xxx_transport_functions = {
 
 	.show_host_node_name = 1,
@@ -881,6 +895,8 @@ struct fc_function_template qla2xxx_tran
 	.show_host_symbolic_name = 1,
 	.set_host_system_hostname = qla2x00_set_host_system_hostname,
 	.show_host_system_hostname = 1,
+	.get_host_fabric_name = qla2x00_get_host_fabric_name,
+	.show_host_fabric_name = 1,
 
 	.dd_fcrport_size = sizeof(struct fc_port *),
 	.show_rport_supported_classes = 1,
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 6d677b0..c37a30a 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2362,6 +2362,7 @@ #define BINZERO		"\0\0\0\0\0\0\0\0\0\0\0
 
 	uint8_t		*node_name;
 	uint8_t		*port_name;
+	uint8_t		fabric_node_name[WWN_SIZE];
 	uint32_t    isp_abort_cnt;
 
 	/* Option ROM information. */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2700964..d5d2627 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2280,7 +2280,7 @@ qla2x00_configure_fabric(scsi_qla_host_t
 		loop_id = NPH_F_PORT;
 	else
 		loop_id = SNS_FL_PORT;
-	rval = qla2x00_get_port_name(ha, loop_id, NULL, 0);
+	rval = qla2x00_get_port_name(ha, loop_id, ha->fabric_node_name, 1);
 	if (rval != QLA_SUCCESS) {
 		DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL "
 		    "Port\n", ha->host_no));
@@ -2288,6 +2288,7 @@ qla2x00_configure_fabric(scsi_qla_host_t
 		ha->device_flags &= ~SWITCH_FOUND;
 		return (QLA_SUCCESS);
 	}
+	ha->device_flags |= SWITCH_FOUND;
 
 	/* Mark devices that need re-synchronization. */
 	rval2 = qla2x00_device_resync(ha);
-- 
1.4.2.3.gf59615


  parent reply	other threads:[~2006-10-02 19:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-02 18:59 [PATCH 0/8] qla2xxx: driver update Andrew Vasquez
2006-10-02 19:00 ` [PATCH 1/8] qla2xxx: Add iIDMA support Andrew Vasquez
2006-10-10  9:29   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 2/8] qla2xxx: Add support for symbolic nodename FC transport attribute Andrew Vasquez
2006-10-10  9:30   ` Christoph Hellwig
2006-10-12 16:37     ` Andrew Vasquez
2006-10-02 19:00 ` [PATCH 3/8] qla2xxx: Add support for system hostname " Andrew Vasquez
2006-10-10  9:32   ` Christoph Hellwig
2006-10-02 19:00 ` Andrew Vasquez [this message]
2006-10-10  9:32   ` [PATCH 4/8] qla2xxx: Add support for fabric name " Christoph Hellwig
2006-10-02 19:00 ` [PATCH 5/8] qla2xxx: Add support for host port state " Andrew Vasquez
2006-10-10  9:33   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 6/8] qla2xxx: Add MODULE_FIRMWARE tags Andrew Vasquez
2006-10-10  9:33   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 7/8] qla2xxx: Stall mid-layer error handlers while rport is blocked Andrew Vasquez
2006-10-02 19:26   ` James Smart
2006-10-02 22:14     ` Matthew Wilcox
2006-10-02 23:05       ` Mike Anderson
2006-10-03 14:24         ` James Smart
2006-10-05 16:09     ` Mike Christie
2006-10-06 15:23       ` James Smart
2006-10-06 17:01         ` Mike Christie
2006-10-06 17:33           ` James Smart
2006-10-10 15:11             ` Patrick Mansfield
2006-10-02 19:00 ` [PATCH 8/8] qla2xxx: Update version number to 8.01.07-k2 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=11598156513789-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