diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 50 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 15 |
2 files changed, 65 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 | |||
1003 | reset_hw_out: | 1007 | reset_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 | **/ | ||
2553 | static 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 | |||
2584 | wwn_prefix_out: | ||
2585 | return 0; | ||
2586 | } | ||
2587 | |||
2539 | static struct ixgbe_mac_operations mac_ops_82599 = { | 2588 | static 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, |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 1cab53eb22f3..21b6633da578 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -1539,6 +1539,16 @@ | |||
1539 | #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 | 1539 | #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 |
1540 | #define IXGBE_FW_PATCH_VERSION_4 0x7 | 1540 | #define IXGBE_FW_PATCH_VERSION_4 0x7 |
1541 | 1541 | ||
1542 | /* Alternative SAN MAC Address Block */ | ||
1543 | #define IXGBE_ALT_SAN_MAC_ADDR_BLK_PTR 0x27 /* Alt. SAN MAC block */ | ||
1544 | #define IXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET 0x0 /* Alt. SAN MAC capability */ | ||
1545 | #define IXGBE_ALT_SAN_MAC_ADDR_PORT0_OFFSET 0x1 /* Alt. SAN MAC 0 offset */ | ||
1546 | #define IXGBE_ALT_SAN_MAC_ADDR_PORT1_OFFSET 0x4 /* Alt. SAN MAC 1 offset */ | ||
1547 | #define IXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET 0x7 /* Alt. WWNN prefix offset */ | ||
1548 | #define IXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET 0x8 /* Alt. WWPN prefix offset */ | ||
1549 | #define IXGBE_ALT_SAN_MAC_ADDR_CAPS_SANMAC 0x0 /* Alt. SAN MAC exists */ | ||
1550 | #define IXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN 0x1 /* Alt. WWN base exists */ | ||
1551 | |||
1542 | /* PCI Bus Info */ | 1552 | /* PCI Bus Info */ |
1543 | #define IXGBE_PCI_LINK_STATUS 0xB2 | 1553 | #define IXGBE_PCI_LINK_STATUS 0xB2 |
1544 | #define IXGBE_PCI_DEVICE_CONTROL2 0xC8 | 1554 | #define IXGBE_PCI_DEVICE_CONTROL2 0xC8 |
@@ -2345,6 +2355,7 @@ struct ixgbe_mac_operations { | |||
2345 | s32 (*get_mac_addr)(struct ixgbe_hw *, u8 *); | 2355 | s32 (*get_mac_addr)(struct ixgbe_hw *, u8 *); |
2346 | s32 (*get_san_mac_addr)(struct ixgbe_hw *, u8 *); | 2356 | s32 (*get_san_mac_addr)(struct ixgbe_hw *, u8 *); |
2347 | s32 (*get_device_caps)(struct ixgbe_hw *, u16 *); | 2357 | s32 (*get_device_caps)(struct ixgbe_hw *, u16 *); |
2358 | s32 (*get_wwn_prefix)(struct ixgbe_hw *, u16 *, u16 *); | ||
2348 | s32 (*stop_adapter)(struct ixgbe_hw *); | 2359 | s32 (*stop_adapter)(struct ixgbe_hw *); |
2349 | s32 (*get_bus_info)(struct ixgbe_hw *); | 2360 | s32 (*get_bus_info)(struct ixgbe_hw *); |
2350 | void (*set_lan_id)(struct ixgbe_hw *); | 2361 | void (*set_lan_id)(struct ixgbe_hw *); |
@@ -2416,6 +2427,10 @@ struct ixgbe_mac_info { | |||
2416 | u8 addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; | 2427 | u8 addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; |
2417 | u8 perm_addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; | 2428 | u8 perm_addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; |
2418 | u8 san_addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; | 2429 | u8 san_addr[IXGBE_ETH_LENGTH_OF_ADDRESS]; |
2430 | /* prefix for World Wide Node Name (WWNN) */ | ||
2431 | u16 wwnn_prefix; | ||
2432 | /* prefix for World Wide Port Name (WWPN) */ | ||
2433 | u16 wwpn_prefix; | ||
2419 | s32 mc_filter_type; | 2434 | s32 mc_filter_type; |
2420 | u32 mcft_size; | 2435 | u32 mcft_size; |
2421 | u32 vft_size; | 2436 | u32 vft_size; |