diff options
author | Yi Zou <yi.zou@intel.com> | 2009-10-28 14:24:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 04:04:03 -0400 |
commit | 61a1fa102ada6d8ee9f2293d126ed9f580ca0751 (patch) | |
tree | 24c3b42798131f58486c38d1b22c965c58f7485a /drivers/net/ixgbe | |
parent | df5c79452f26f2a3d0883a213102515cfeb7aae9 (diff) |
ixgbe: Add support for netdev_ops.ndo_fcoe_get_wwn to 82599
Implements the netdev_ops.ndo_fcoe_get_wwn in 82599 if it finds valid
prefix for the World Wide Node Name (WWNN) or World Wide Port Name (WWPN),
as well as valid SAN MAC address.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 1 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_fcoe.c | 46 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 1 |
3 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 2b854161c61b..7eb08a6d3f99 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -457,6 +457,7 @@ extern int ixgbe_fcoe_disable(struct net_device *netdev); | |||
457 | extern u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter); | 457 | extern u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter); |
458 | extern u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up); | 458 | extern u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up); |
459 | #endif /* CONFIG_IXGBE_DCB */ | 459 | #endif /* CONFIG_IXGBE_DCB */ |
460 | extern int ixgbe_fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); | ||
460 | #endif /* IXGBE_FCOE */ | 461 | #endif /* IXGBE_FCOE */ |
461 | 462 | ||
462 | #endif /* _IXGBE_H_ */ | 463 | #endif /* _IXGBE_H_ */ |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index a3c9f99515e2..edecdc853c14 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -718,3 +718,49 @@ u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up) | |||
718 | return 1; | 718 | return 1; |
719 | } | 719 | } |
720 | #endif /* CONFIG_IXGBE_DCB */ | 720 | #endif /* CONFIG_IXGBE_DCB */ |
721 | |||
722 | /** | ||
723 | * ixgbe_fcoe_get_wwn - get world wide name for the node or the port | ||
724 | * @netdev : ixgbe adapter | ||
725 | * @wwn : the world wide name | ||
726 | * @type: the type of world wide name | ||
727 | * | ||
728 | * Returns the node or port world wide name if both the prefix and the san | ||
729 | * mac address are valid, then the wwn is formed based on the NAA-2 for | ||
730 | * IEEE Extended name identifier (ref. to T10 FC-LS Spec., Sec. 15.3). | ||
731 | * | ||
732 | * Returns : 0 on success | ||
733 | */ | ||
734 | int ixgbe_fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type) | ||
735 | { | ||
736 | int rc = -EINVAL; | ||
737 | u16 prefix = 0xffff; | ||
738 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
739 | struct ixgbe_mac_info *mac = &adapter->hw.mac; | ||
740 | |||
741 | switch (type) { | ||
742 | case NETDEV_FCOE_WWNN: | ||
743 | prefix = mac->wwnn_prefix; | ||
744 | break; | ||
745 | case NETDEV_FCOE_WWPN: | ||
746 | prefix = mac->wwpn_prefix; | ||
747 | break; | ||
748 | default: | ||
749 | break; | ||
750 | } | ||
751 | |||
752 | if ((prefix != 0xffff) && | ||
753 | is_valid_ether_addr(mac->san_addr)) { | ||
754 | *wwn = ((u64) prefix << 48) | | ||
755 | ((u64) mac->san_addr[0] << 40) | | ||
756 | ((u64) mac->san_addr[1] << 32) | | ||
757 | ((u64) mac->san_addr[2] << 24) | | ||
758 | ((u64) mac->san_addr[3] << 16) | | ||
759 | ((u64) mac->san_addr[4] << 8) | | ||
760 | ((u64) mac->san_addr[5]); | ||
761 | rc = 0; | ||
762 | } | ||
763 | return rc; | ||
764 | } | ||
765 | |||
766 | |||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 4c8a44919705..45c5faf0824a 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -5449,6 +5449,7 @@ static const struct net_device_ops ixgbe_netdev_ops = { | |||
5449 | .ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put, | 5449 | .ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put, |
5450 | .ndo_fcoe_enable = ixgbe_fcoe_enable, | 5450 | .ndo_fcoe_enable = ixgbe_fcoe_enable, |
5451 | .ndo_fcoe_disable = ixgbe_fcoe_disable, | 5451 | .ndo_fcoe_disable = ixgbe_fcoe_disable, |
5452 | .ndo_fcoe_get_wwn = ixgbe_fcoe_get_wwn, | ||
5452 | #endif /* IXGBE_FCOE */ | 5453 | #endif /* IXGBE_FCOE */ |
5453 | }; | 5454 | }; |
5454 | 5455 | ||