aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-11-20 18:22:21 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-10 10:45:53 -0500
commitdcece412da92aa619c0d891a17306b9adf86ab0e (patch)
tree4d7c49efc33ec71cd97904808cd2050a3798e54d /drivers/scsi/fcoe/fcoe.c
parente46b63b37c3296f0aca92d8b62bbf130f2bec7dd (diff)
[SCSI] fcoe: Use LLD's WWPN and WWNN for lport if LLD supports ndo_fcoe_get_wwn
If the LLD wants its own WWNN/WWPN to be used, it should implement the netdev_ops.ndo_fcoe_get_wwn(). If that is the case, we query the LLD and use the queried WWNN/WWPN from the LLD. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r--drivers/scsi/fcoe/fcoe.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index a30ffaa1222c..9b6aebbb47d3 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -545,6 +545,23 @@ static void fcoe_queue_timer(ulong lport)
545} 545}
546 546
547/** 547/**
548 * fcoe_get_wwn() - Get the world wide name from LLD if it supports it
549 * @netdev: the associated net device
550 * @wwn: the output WWN
551 * @type: the type of WWN (WWPN or WWNN)
552 *
553 * Returns: 0 for success
554 */
555static int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type)
556{
557 const struct net_device_ops *ops = netdev->netdev_ops;
558
559 if (ops->ndo_fcoe_get_wwn)
560 return ops->ndo_fcoe_get_wwn(netdev, wwn, type);
561 return -EINVAL;
562}
563
564/**
548 * fcoe_netdev_config() - Set up net devive for SW FCoE 565 * fcoe_netdev_config() - Set up net devive for SW FCoE
549 * @lport: The local port that is associated with the net device 566 * @lport: The local port that is associated with the net device
550 * @netdev: The associated net device 567 * @netdev: The associated net device
@@ -611,9 +628,13 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)
611 */ 628 */
612 if (netdev->priv_flags & IFF_802_1Q_VLAN) 629 if (netdev->priv_flags & IFF_802_1Q_VLAN)
613 vid = vlan_dev_vlan_id(netdev); 630 vid = vlan_dev_vlan_id(netdev);
614 wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0); 631
632 if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN))
633 wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0);
615 fc_set_wwnn(lport, wwnn); 634 fc_set_wwnn(lport, wwnn);
616 wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 2, vid); 635 if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN))
636 wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr,
637 2, vid);
617 fc_set_wwpn(lport, wwpn); 638 fc_set_wwpn(lport, wwpn);
618 } 639 }
619 640