diff options
| -rw-r--r-- | drivers/net/e1000e/82571.c | 30 | ||||
| -rw-r--r-- | drivers/net/e1000e/defines.h | 4 | ||||
| -rw-r--r-- | drivers/net/e1000e/lib.c | 10 |
3 files changed, 31 insertions, 13 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index f844e6c6063b..d3d4a57e2450 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
| @@ -936,12 +936,14 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
| 936 | ew32(IMC, 0xffffffff); | 936 | ew32(IMC, 0xffffffff); |
| 937 | icr = er32(ICR); | 937 | icr = er32(ICR); |
| 938 | 938 | ||
| 939 | /* Install any alternate MAC address into RAR0 */ | 939 | if (hw->mac.type == e1000_82571) { |
| 940 | ret_val = e1000_check_alt_mac_addr_generic(hw); | 940 | /* Install any alternate MAC address into RAR0 */ |
| 941 | if (ret_val) | 941 | ret_val = e1000_check_alt_mac_addr_generic(hw); |
| 942 | return ret_val; | 942 | if (ret_val) |
| 943 | return ret_val; | ||
| 943 | 944 | ||
| 944 | e1000e_set_laa_state_82571(hw, true); | 945 | e1000e_set_laa_state_82571(hw, true); |
| 946 | } | ||
| 945 | 947 | ||
| 946 | /* Reinitialize the 82571 serdes link state machine */ | 948 | /* Reinitialize the 82571 serdes link state machine */ |
| 947 | if (hw->phy.media_type == e1000_media_type_internal_serdes) | 949 | if (hw->phy.media_type == e1000_media_type_internal_serdes) |
| @@ -1618,14 +1620,16 @@ static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) | |||
| 1618 | { | 1620 | { |
| 1619 | s32 ret_val = 0; | 1621 | s32 ret_val = 0; |
| 1620 | 1622 | ||
| 1621 | /* | 1623 | if (hw->mac.type == e1000_82571) { |
| 1622 | * If there's an alternate MAC address place it in RAR0 | 1624 | /* |
| 1623 | * so that it will override the Si installed default perm | 1625 | * If there's an alternate MAC address place it in RAR0 |
| 1624 | * address. | 1626 | * so that it will override the Si installed default perm |
| 1625 | */ | 1627 | * address. |
| 1626 | ret_val = e1000_check_alt_mac_addr_generic(hw); | 1628 | */ |
| 1627 | if (ret_val) | 1629 | ret_val = e1000_check_alt_mac_addr_generic(hw); |
| 1628 | goto out; | 1630 | if (ret_val) |
| 1631 | goto out; | ||
| 1632 | } | ||
| 1629 | 1633 | ||
| 1630 | ret_val = e1000_read_mac_addr_generic(hw); | 1634 | ret_val = e1000_read_mac_addr_generic(hw); |
| 1631 | 1635 | ||
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h index 307a72f483ee..93b3bedae8d2 100644 --- a/drivers/net/e1000e/defines.h +++ b/drivers/net/e1000e/defines.h | |||
| @@ -621,6 +621,7 @@ | |||
| 621 | #define E1000_FLASH_UPDATES 2000 | 621 | #define E1000_FLASH_UPDATES 2000 |
| 622 | 622 | ||
| 623 | /* NVM Word Offsets */ | 623 | /* NVM Word Offsets */ |
| 624 | #define NVM_COMPAT 0x0003 | ||
| 624 | #define NVM_ID_LED_SETTINGS 0x0004 | 625 | #define NVM_ID_LED_SETTINGS 0x0004 |
| 625 | #define NVM_INIT_CONTROL2_REG 0x000F | 626 | #define NVM_INIT_CONTROL2_REG 0x000F |
| 626 | #define NVM_INIT_CONTROL3_PORT_B 0x0014 | 627 | #define NVM_INIT_CONTROL3_PORT_B 0x0014 |
| @@ -643,6 +644,9 @@ | |||
| 643 | /* Mask bits for fields in Word 0x1a of the NVM */ | 644 | /* Mask bits for fields in Word 0x1a of the NVM */ |
| 644 | #define NVM_WORD1A_ASPM_MASK 0x000C | 645 | #define NVM_WORD1A_ASPM_MASK 0x000C |
| 645 | 646 | ||
| 647 | /* Mask bits for fields in Word 0x03 of the EEPROM */ | ||
| 648 | #define NVM_COMPAT_LOM 0x0800 | ||
| 649 | |||
| 646 | /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */ | 650 | /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */ |
| 647 | #define NVM_SUM 0xBABA | 651 | #define NVM_SUM 0xBABA |
| 648 | 652 | ||
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index df4a27922931..0fd4eb5ac5fb 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
| @@ -183,6 +183,16 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) | |||
| 183 | u16 offset, nvm_alt_mac_addr_offset, nvm_data; | 183 | u16 offset, nvm_alt_mac_addr_offset, nvm_data; |
| 184 | u8 alt_mac_addr[ETH_ALEN]; | 184 | u8 alt_mac_addr[ETH_ALEN]; |
| 185 | 185 | ||
| 186 | ret_val = e1000_read_nvm(hw, NVM_COMPAT, 1, &nvm_data); | ||
| 187 | if (ret_val) | ||
| 188 | goto out; | ||
| 189 | |||
| 190 | /* Check for LOM (vs. NIC) or one of two valid mezzanine cards */ | ||
| 191 | if (!((nvm_data & NVM_COMPAT_LOM) || | ||
| 192 | (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_DUAL) || | ||
| 193 | (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD))) | ||
| 194 | goto out; | ||
| 195 | |||
| 186 | ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, | 196 | ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, |
| 187 | &nvm_alt_mac_addr_offset); | 197 | &nvm_alt_mac_addr_offset); |
| 188 | if (ret_val) { | 198 | if (ret_val) { |
