]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2fc: Obtain WWNN/WWPN from the shared memory
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>
Fri, 5 Aug 2011 00:38:50 +0000 (17:38 -0700)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 01:36:46 +0000 (09:36 +0800)
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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 5243960777a8d5f0dfabd0e67035d13ac6eaf304)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c

index fc3be98a1406dd09cd9cfebf3319dbde7699ea2c..4c39f31a132e989762e4813f08c0ebe72d6d69d5 100644 (file)
@@ -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);
@@ -738,7 +737,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;
@@ -764,11 +763,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);
        }
@@ -1368,7 +1372,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;