diff options
author | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2009-06-04 12:02:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-07 08:20:26 -0400 |
commit | 794caeb259bc5d341bcc80dd37820073147a231c (patch) | |
tree | c932f796a96c6c7dcd6611ef2c8425b644ad0458 /drivers/net/ixgbe | |
parent | ae540af18597a441bf17a26389179465ea4b9c36 (diff) |
ixgbe: Add FW detection and warning for 82599 SFP+ adapters
82599 has a FW running that helps manage the internal SFI PHY. There are
also a number of pre-production samples of these SFI-based devices in the
field. This patch adds a check to look for the firmware running on all
SFP+ based adapters, and displays a warning to the system log if a
pre-production adapter is identified. The driver will continue loading
though, with no functional degradation.
Also remove an old function prototype from ixgbe_82599.c that isn't being
used.
Signed-off-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')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 58 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 12 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 20 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 3 |
4 files changed, 85 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 5c2627b68c2d..1984cab7d48b 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -71,10 +71,10 @@ s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw); | |||
71 | s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw); | 71 | s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw); |
72 | s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); | 72 | s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); |
73 | s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); | 73 | s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); |
74 | s32 ixgbe_start_hw_rev_0_82599(struct ixgbe_hw *hw); | ||
75 | s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); | 74 | s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); |
76 | s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw); | 75 | s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw); |
77 | u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); | 76 | u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); |
77 | static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); | ||
78 | 78 | ||
79 | void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | 79 | void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) |
80 | { | 80 | { |
@@ -2142,8 +2142,9 @@ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) | |||
2142 | s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) | 2142 | s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) |
2143 | { | 2143 | { |
2144 | u32 q_num; | 2144 | u32 q_num; |
2145 | s32 ret_val; | ||
2145 | 2146 | ||
2146 | ixgbe_start_hw_generic(hw); | 2147 | ret_val = ixgbe_start_hw_generic(hw); |
2147 | 2148 | ||
2148 | /* Clear the rate limiters */ | 2149 | /* Clear the rate limiters */ |
2149 | for (q_num = 0; q_num < hw->mac.max_tx_queues; q_num++) { | 2150 | for (q_num = 0; q_num < hw->mac.max_tx_queues; q_num++) { |
@@ -2155,7 +2156,10 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) | |||
2155 | /* We need to run link autotry after the driver loads */ | 2156 | /* We need to run link autotry after the driver loads */ |
2156 | hw->mac.autotry_restart = true; | 2157 | hw->mac.autotry_restart = true; |
2157 | 2158 | ||
2158 | return 0; | 2159 | if (ret_val == 0) |
2160 | ret_val = ixgbe_verify_fw_version_82599(hw); | ||
2161 | |||
2162 | return ret_val; | ||
2159 | } | 2163 | } |
2160 | 2164 | ||
2161 | /** | 2165 | /** |
@@ -2407,6 +2411,54 @@ san_mac_addr_out: | |||
2407 | return 0; | 2411 | return 0; |
2408 | } | 2412 | } |
2409 | 2413 | ||
2414 | /** | ||
2415 | * ixgbe_verify_fw_version_82599 - verify fw version for 82599 | ||
2416 | * @hw: pointer to hardware structure | ||
2417 | * | ||
2418 | * Verifies that installed the firmware version is 0.6 or higher | ||
2419 | * for SFI devices. All 82599 SFI devices should have version 0.6 or higher. | ||
2420 | * | ||
2421 | * Returns IXGBE_ERR_EEPROM_VERSION if the FW is not present or | ||
2422 | * if the FW version is not supported. | ||
2423 | **/ | ||
2424 | static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) | ||
2425 | { | ||
2426 | s32 status = IXGBE_ERR_EEPROM_VERSION; | ||
2427 | u16 fw_offset, fw_ptp_cfg_offset; | ||
2428 | u16 fw_version = 0; | ||
2429 | |||
2430 | /* firmware check is only necessary for SFI devices */ | ||
2431 | if (hw->phy.media_type != ixgbe_media_type_fiber) { | ||
2432 | status = 0; | ||
2433 | goto fw_version_out; | ||
2434 | } | ||
2435 | |||
2436 | /* get the offset to the Firmware Module block */ | ||
2437 | hw->eeprom.ops.read(hw, IXGBE_FW_PTR, &fw_offset); | ||
2438 | |||
2439 | if ((fw_offset == 0) || (fw_offset == 0xFFFF)) | ||
2440 | goto fw_version_out; | ||
2441 | |||
2442 | /* get the offset to the Pass Through Patch Configuration block */ | ||
2443 | hw->eeprom.ops.read(hw, (fw_offset + | ||
2444 | IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR), | ||
2445 | &fw_ptp_cfg_offset); | ||
2446 | |||
2447 | if ((fw_ptp_cfg_offset == 0) || (fw_ptp_cfg_offset == 0xFFFF)) | ||
2448 | goto fw_version_out; | ||
2449 | |||
2450 | /* get the firmware version */ | ||
2451 | hw->eeprom.ops.read(hw, (fw_ptp_cfg_offset + | ||
2452 | IXGBE_FW_PATCH_VERSION_4), | ||
2453 | &fw_version); | ||
2454 | |||
2455 | if (fw_version > 0x5) | ||
2456 | status = 0; | ||
2457 | |||
2458 | fw_version_out: | ||
2459 | return status; | ||
2460 | } | ||
2461 | |||
2410 | static struct ixgbe_mac_operations mac_ops_82599 = { | 2462 | static struct ixgbe_mac_operations mac_ops_82599 = { |
2411 | .init_hw = &ixgbe_init_hw_generic, | 2463 | .init_hw = &ixgbe_init_hw_generic, |
2412 | .reset_hw = &ixgbe_reset_hw_82599, | 2464 | .reset_hw = &ixgbe_reset_hw_82599, |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index db339d6fe63d..96a185953777 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -106,13 +106,17 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) | |||
106 | **/ | 106 | **/ |
107 | s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw) | 107 | s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw) |
108 | { | 108 | { |
109 | s32 status; | ||
110 | |||
109 | /* Reset the hardware */ | 111 | /* Reset the hardware */ |
110 | hw->mac.ops.reset_hw(hw); | 112 | status = hw->mac.ops.reset_hw(hw); |
111 | 113 | ||
112 | /* Start the HW */ | 114 | if (status == 0) { |
113 | hw->mac.ops.start_hw(hw); | 115 | /* Start the HW */ |
116 | status = hw->mac.ops.start_hw(hw); | ||
117 | } | ||
114 | 118 | ||
115 | return 0; | 119 | return status; |
116 | } | 120 | } |
117 | 121 | ||
118 | /** | 122 | /** |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index ca7c5d508752..543a606f22cc 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2728,6 +2728,15 @@ void ixgbe_reset(struct ixgbe_adapter *adapter) | |||
2728 | case IXGBE_ERR_MASTER_REQUESTS_PENDING: | 2728 | case IXGBE_ERR_MASTER_REQUESTS_PENDING: |
2729 | dev_err(&adapter->pdev->dev, "master disable timed out\n"); | 2729 | dev_err(&adapter->pdev->dev, "master disable timed out\n"); |
2730 | break; | 2730 | break; |
2731 | case IXGBE_ERR_EEPROM_VERSION: | ||
2732 | /* We are running on a pre-production device, log a warning */ | ||
2733 | dev_warn(&adapter->pdev->dev, "This device is a pre-production " | ||
2734 | "adapter/LOM. Please be aware there may be issues " | ||
2735 | "associated with your hardware. If you are " | ||
2736 | "experiencing problems please contact your Intel or " | ||
2737 | "hardware representative who provided you with this " | ||
2738 | "hardware.\n"); | ||
2739 | break; | ||
2731 | default: | 2740 | default: |
2732 | dev_err(&adapter->pdev->dev, "Hardware Error: %d\n", err); | 2741 | dev_err(&adapter->pdev->dev, "Hardware Error: %d\n", err); |
2733 | } | 2742 | } |
@@ -5608,8 +5617,17 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5608 | hw->eeprom.ops.read(hw, 0x29, &adapter->eeprom_version); | 5617 | hw->eeprom.ops.read(hw, 0x29, &adapter->eeprom_version); |
5609 | 5618 | ||
5610 | /* reset the hardware with the new settings */ | 5619 | /* reset the hardware with the new settings */ |
5611 | hw->mac.ops.start_hw(hw); | 5620 | err = hw->mac.ops.start_hw(hw); |
5612 | 5621 | ||
5622 | if (err == IXGBE_ERR_EEPROM_VERSION) { | ||
5623 | /* We are running on a pre-production device, log a warning */ | ||
5624 | dev_warn(&pdev->dev, "This device is a pre-production " | ||
5625 | "adapter/LOM. Please be aware there may be issues " | ||
5626 | "associated with your hardware. If you are " | ||
5627 | "experiencing problems please contact your Intel or " | ||
5628 | "hardware representative who provided you with this " | ||
5629 | "hardware.\n"); | ||
5630 | } | ||
5613 | strcpy(netdev->name, "eth%d"); | 5631 | strcpy(netdev->name, "eth%d"); |
5614 | err = register_netdev(netdev); | 5632 | err = register_netdev(netdev); |
5615 | if (err) | 5633 | if (err) |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 68cac3674f9a..fa87309dc087 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -1516,6 +1516,8 @@ | |||
1516 | #define IXGBE_SAN_MAC_ADDR_PORT1_OFFSET 0x3 | 1516 | #define IXGBE_SAN_MAC_ADDR_PORT1_OFFSET 0x3 |
1517 | #define IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP 0x1 | 1517 | #define IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP 0x1 |
1518 | #define IXGBE_DEVICE_CAPS_FCOE_OFFLOADS 0x2 | 1518 | #define IXGBE_DEVICE_CAPS_FCOE_OFFLOADS 0x2 |
1519 | #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 | ||
1520 | #define IXGBE_FW_PATCH_VERSION_4 0x7 | ||
1519 | 1521 | ||
1520 | /* PCI Bus Info */ | 1522 | /* PCI Bus Info */ |
1521 | #define IXGBE_PCI_LINK_STATUS 0xB2 | 1523 | #define IXGBE_PCI_LINK_STATUS 0xB2 |
@@ -2495,6 +2497,7 @@ struct ixgbe_info { | |||
2495 | #define IXGBE_ERR_SFP_NOT_PRESENT -20 | 2497 | #define IXGBE_ERR_SFP_NOT_PRESENT -20 |
2496 | #define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21 | 2498 | #define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21 |
2497 | #define IXGBE_ERR_FDIR_REINIT_FAILED -23 | 2499 | #define IXGBE_ERR_FDIR_REINIT_FAILED -23 |
2500 | #define IXGBE_ERR_EEPROM_VERSION -24 | ||
2498 | #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF | 2501 | #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF |
2499 | 2502 | ||
2500 | #endif /* _IXGBE_TYPE_H_ */ | 2503 | #endif /* _IXGBE_TYPE_H_ */ |