public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bhanu Prakash Gollapudi" <bprakash@broadcom.com>
To: JBottomley@parallels.com, linux-scsi@vger.kernel.org
Cc: michaelc@cs.wisc.edu, mchan@broadcom.com,
	robert.w.love@intel.com, devel@open-fcoe.org,
	Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Subject: [PATCH v2 16/18] bnx2fc: Obtain WWNN/WWPN from the shared memory
Date: Thu, 4 Aug 2011 17:38:50 -0700	[thread overview]
Message-ID: <1312504732-4572-17-git-send-email-bprakash@broadcom.com> (raw)
In-Reply-To: <1312504732-4572-1-git-send-email-bprakash@broadcom.com>

bnx2x driver would obtain the WWNN/WWPN from the shared memory and can be
obtained by the bnx2fc driver via ndo_fcoe_get_wwn.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 62c0e94..25d3bcd 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -65,7 +65,6 @@ static void bnx2fc_recv_frame(struct sk_buff *skb);
 
 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
 static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev);
-static int bnx2fc_net_config(struct fc_lport *lp);
 static int bnx2fc_lport_config(struct fc_lport *lport);
 static int bnx2fc_em_config(struct fc_lport *lport);
 static int bnx2fc_bind_adapter_devices(struct bnx2fc_hba *hba);
@@ -737,7 +736,7 @@ void bnx2fc_get_link_state(struct bnx2fc_hba *hba)
 		clear_bit(ADAPTER_STATE_LINK_DOWN, &hba->adapter_state);
 }
 
-static int bnx2fc_net_config(struct fc_lport *lport)
+static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)
 {
 	struct bnx2fc_hba *hba;
 	struct bnx2fc_interface *interface;
@@ -763,11 +762,16 @@ static int bnx2fc_net_config(struct fc_lport *lport)
 	bnx2fc_link_speed_update(lport);
 
 	if (!lport->vport) {
-		wwnn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr, 1, 0);
+		if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN))
+			wwnn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr,
+						 1, 0);
 		BNX2FC_HBA_DBG(lport, "WWNN = 0x%llx\n", wwnn);
 		fc_set_wwnn(lport, wwnn);
 
-		wwpn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr, 2, 0);
+		if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN))
+			wwpn = fcoe_wwn_from_mac(interface->ctlr.ctl_src_addr,
+						 2, 0);
+
 		BNX2FC_HBA_DBG(lport, "WWPN = 0x%llx\n", wwpn);
 		fc_set_wwpn(lport, wwpn);
 	}
@@ -1367,7 +1371,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
 		fc_set_wwpn(lport, vport->port_name);
 	}
 	/* Configure netdev and networking properties of the lport */
-	rc = bnx2fc_net_config(lport);
+	rc = bnx2fc_net_config(lport, interface->netdev);
 	if (rc) {
 		printk(KERN_ERR PFX "Error on bnx2fc_net_config\n");
 		goto lp_config_err;
-- 
1.7.0.6



  parent reply	other threads:[~2011-08-05  0:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05  0:38 [PATCH v2 00/18] bnx2fc version 1.0.5 Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 01/18] bnx2fc: Reset the max receive frame size Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 02/18] bnx2fc: Bug fixes in percpu_thread_create/destroy Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 03/18] bnx2fc: Enable bsg_request support for bnx2fc Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 04/18] bnx2fc: Remove erroneous kref_get on IO request Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 05/18] bnx2fc: Do not attempt destroying NPIV port twice Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 06/18] bnx2fc: Change function names of bnx2fc_netdev_setup/bnx2fc_netdev_cleanup Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 07/18] bnx2fc: Reorganize cleanup code between interface_cleanup and if_destory Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 08/18] bnx2fc: Handle NETDEV_UNREGISTER for vlan devices Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 09/18] bnx2fc: Clear DESTROY_CMPL flag after firmware destroy Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 10/18] bnx2fc: Do not reuse the fcoe connection id immediately Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 11/18] bnx2fc: IO errors when receiving unsolicited LOGO Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 12/18] bnx2fc: Fix NULL pointer deref during arm_cq Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 13/18] bnx2fc: code cleanup in bnx2fc_offload_session Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 14/18] bnx2fc: Drop incoming ABTS Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 15/18] fcoe: Move common functions to fcoe_transport library Bhanu Prakash Gollapudi
2011-09-08 11:11   ` Mike Christie
2011-09-08 14:41     ` Bhanu Prakash Gollapudi
2011-08-05  0:38 ` Bhanu Prakash Gollapudi [this message]
2011-08-05  0:38 ` [PATCH v2 17/18] bnx2fc: Prevent creating of NPIV port with duplicate WWN Bhanu Prakash Gollapudi
2011-08-05  0:38 ` [PATCH v2 18/18] bnx2fc: Bump version to 1.0.5 Bhanu Prakash Gollapudi
2011-08-24  5:48 ` [PATCH v2 00/18] bnx2fc version 1.0.5 James Bottomley
2011-08-24 18:29   ` Bhanu Prakash Gollapudi

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=1312504732-4572-17-git-send-email-bprakash@broadcom.com \
    --to=bprakash@broadcom.com \
    --cc=JBottomley@parallels.com \
    --cc=devel@open-fcoe.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=robert.w.love@intel.com \
    /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