aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_82599.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-10-28 14:23:57 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-29 04:04:01 -0400
commit383ff34bebc2eccae71686fbd72e1cd948859675 (patch)
treedc7aba22499292a72517e79f04dc67db2795d92b /drivers/net/ixgbe/ixgbe_82599.c
parenteb89bd4f80b9ae7e4d0add925cf66bfbebfee01f (diff)
ixgbe: Add support for 82599 alternative WWNN/WWPN prefix
The 82599 EEPROM supports alternative prefix for World Wide Node Name (WWNN) and World Wide Port Name (WWPN). The prefixes can be used together with the SAN MAC address to form the WWNN and WWPN, which can be used by upper layer drivers such as Fiber Channel over Ethernet (FCoE). Signed-off-by: Yi Zou <yi.zou@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@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/ixgbe_82599.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index ae27c41222e3..72106898a5cb 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -1000,6 +1000,10 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
1000 hw->mac.num_rar_entries--; 1000 hw->mac.num_rar_entries--;
1001 } 1001 }
1002 1002
1003 /* Store the alternative WWNN/WWPN prefix */
1004 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix,
1005 &hw->mac.wwpn_prefix);
1006
1003reset_hw_out: 1007reset_hw_out:
1004 return status; 1008 return status;
1005} 1009}
@@ -2536,6 +2540,51 @@ fw_version_out:
2536 return status; 2540 return status;
2537} 2541}
2538 2542
2543/**
2544 * ixgbe_get_wwn_prefix_82599 - Get alternative WWNN/WWPN prefix from
2545 * the EEPROM
2546 * @hw: pointer to hardware structure
2547 * @wwnn_prefix: the alternative WWNN prefix
2548 * @wwpn_prefix: the alternative WWPN prefix
2549 *
2550 * This function will read the EEPROM from the alternative SAN MAC address
2551 * block to check the support for the alternative WWNN/WWPN prefix support.
2552 **/
2553static s32 ixgbe_get_wwn_prefix_82599(struct ixgbe_hw *hw, u16 *wwnn_prefix,
2554 u16 *wwpn_prefix)
2555{
2556 u16 offset, caps;
2557 u16 alt_san_mac_blk_offset;
2558
2559 /* clear output first */
2560 *wwnn_prefix = 0xFFFF;
2561 *wwpn_prefix = 0xFFFF;
2562
2563 /* check if alternative SAN MAC is supported */
2564 hw->eeprom.ops.read(hw, IXGBE_ALT_SAN_MAC_ADDR_BLK_PTR,
2565 &alt_san_mac_blk_offset);
2566
2567 if ((alt_san_mac_blk_offset == 0) ||
2568 (alt_san_mac_blk_offset == 0xFFFF))
2569 goto wwn_prefix_out;
2570
2571 /* check capability in alternative san mac address block */
2572 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET;
2573 hw->eeprom.ops.read(hw, offset, &caps);
2574 if (!(caps & IXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN))
2575 goto wwn_prefix_out;
2576
2577 /* get the corresponding prefix for WWNN/WWPN */
2578 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET;
2579 hw->eeprom.ops.read(hw, offset, wwnn_prefix);
2580
2581 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET;
2582 hw->eeprom.ops.read(hw, offset, wwpn_prefix);
2583
2584wwn_prefix_out:
2585 return 0;
2586}
2587
2539static struct ixgbe_mac_operations mac_ops_82599 = { 2588static struct ixgbe_mac_operations mac_ops_82599 = {
2540 .init_hw = &ixgbe_init_hw_generic, 2589 .init_hw = &ixgbe_init_hw_generic,
2541 .reset_hw = &ixgbe_reset_hw_82599, 2590 .reset_hw = &ixgbe_reset_hw_82599,
@@ -2547,6 +2596,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
2547 .get_mac_addr = &ixgbe_get_mac_addr_generic, 2596 .get_mac_addr = &ixgbe_get_mac_addr_generic,
2548 .get_san_mac_addr = &ixgbe_get_san_mac_addr_82599, 2597 .get_san_mac_addr = &ixgbe_get_san_mac_addr_82599,
2549 .get_device_caps = &ixgbe_get_device_caps_82599, 2598 .get_device_caps = &ixgbe_get_device_caps_82599,
2599 .get_wwn_prefix = &ixgbe_get_wwn_prefix_82599,
2550 .stop_adapter = &ixgbe_stop_adapter_generic, 2600 .stop_adapter = &ixgbe_stop_adapter_generic,
2551 .get_bus_info = &ixgbe_get_bus_info_generic, 2601 .get_bus_info = &ixgbe_get_bus_info_generic,
2552 .set_lan_id = &ixgbe_set_lan_id_multi_port_pcie, 2602 .set_lan_id = &ixgbe_set_lan_id_multi_port_pcie,