diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/e1000e/82571.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/e1000e/82571.c')
-rw-r--r-- | drivers/net/e1000e/82571.c | 419 |
1 files changed, 231 insertions, 188 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index d1e0563a67df..90155552ea09 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel PRO/1000 Linux driver | 3 | Intel PRO/1000 Linux driver |
4 | Copyright(c) 1999 - 2008 Intel Corporation. | 4 | Copyright(c) 1999 - 2009 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -43,10 +43,6 @@ | |||
43 | * 82583V Gigabit Network Connection | 43 | * 82583V Gigabit Network Connection |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/netdevice.h> | ||
47 | #include <linux/delay.h> | ||
48 | #include <linux/pci.h> | ||
49 | |||
50 | #include "e1000.h" | 46 | #include "e1000.h" |
51 | 47 | ||
52 | #define ID_LED_RESERVED_F746 0xF746 | 48 | #define ID_LED_RESERVED_F746 0xF746 |
@@ -69,15 +65,15 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); | |||
69 | static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw); | 65 | static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw); |
70 | static s32 e1000_setup_link_82571(struct e1000_hw *hw); | 66 | static s32 e1000_setup_link_82571(struct e1000_hw *hw); |
71 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw); | 67 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw); |
68 | static void e1000_clear_vfta_82571(struct e1000_hw *hw); | ||
72 | static bool e1000_check_mng_mode_82574(struct e1000_hw *hw); | 69 | static bool e1000_check_mng_mode_82574(struct e1000_hw *hw); |
73 | static s32 e1000_led_on_82574(struct e1000_hw *hw); | 70 | static s32 e1000_led_on_82574(struct e1000_hw *hw); |
74 | static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); | 71 | static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); |
72 | static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw); | ||
75 | 73 | ||
76 | /** | 74 | /** |
77 | * e1000_init_phy_params_82571 - Init PHY func ptrs. | 75 | * e1000_init_phy_params_82571 - Init PHY func ptrs. |
78 | * @hw: pointer to the HW structure | 76 | * @hw: pointer to the HW structure |
79 | * | ||
80 | * This is a function pointer entry point called by the api module. | ||
81 | **/ | 77 | **/ |
82 | static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) | 78 | static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) |
83 | { | 79 | { |
@@ -93,6 +89,9 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) | |||
93 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 89 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
94 | phy->reset_delay_us = 100; | 90 | phy->reset_delay_us = 100; |
95 | 91 | ||
92 | phy->ops.power_up = e1000_power_up_phy_copper; | ||
93 | phy->ops.power_down = e1000_power_down_phy_copper_82571; | ||
94 | |||
96 | switch (hw->mac.type) { | 95 | switch (hw->mac.type) { |
97 | case e1000_82571: | 96 | case e1000_82571: |
98 | case e1000_82572: | 97 | case e1000_82572: |
@@ -140,8 +139,6 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) | |||
140 | /** | 139 | /** |
141 | * e1000_init_nvm_params_82571 - Init NVM func ptrs. | 140 | * e1000_init_nvm_params_82571 - Init NVM func ptrs. |
142 | * @hw: pointer to the HW structure | 141 | * @hw: pointer to the HW structure |
143 | * | ||
144 | * This is a function pointer entry point called by the api module. | ||
145 | **/ | 142 | **/ |
146 | static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) | 143 | static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) |
147 | { | 144 | { |
@@ -205,8 +202,6 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) | |||
205 | /** | 202 | /** |
206 | * e1000_init_mac_params_82571 - Init MAC func ptrs. | 203 | * e1000_init_mac_params_82571 - Init MAC func ptrs. |
207 | * @hw: pointer to the HW structure | 204 | * @hw: pointer to the HW structure |
208 | * | ||
209 | * This is a function pointer entry point called by the api module. | ||
210 | **/ | 205 | **/ |
211 | static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | 206 | static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) |
212 | { | 207 | { |
@@ -240,7 +235,10 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
240 | /* Set rar entry count */ | 235 | /* Set rar entry count */ |
241 | mac->rar_entry_count = E1000_RAR_ENTRIES; | 236 | mac->rar_entry_count = E1000_RAR_ENTRIES; |
242 | /* Set if manageability features are enabled. */ | 237 | /* Set if manageability features are enabled. */ |
243 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0; | 238 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) |
239 | ? true : false; | ||
240 | /* Adaptive IFS supported */ | ||
241 | mac->adaptive_ifs = true; | ||
244 | 242 | ||
245 | /* check for link */ | 243 | /* check for link */ |
246 | switch (hw->phy.media_type) { | 244 | switch (hw->phy.media_type) { |
@@ -269,8 +267,14 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
269 | } | 267 | } |
270 | 268 | ||
271 | switch (hw->mac.type) { | 269 | switch (hw->mac.type) { |
270 | case e1000_82573: | ||
271 | func->set_lan_id = e1000_set_lan_id_single_port; | ||
272 | func->check_mng_mode = e1000e_check_mng_mode_generic; | ||
273 | func->led_on = e1000e_led_on_generic; | ||
274 | break; | ||
272 | case e1000_82574: | 275 | case e1000_82574: |
273 | case e1000_82583: | 276 | case e1000_82583: |
277 | func->set_lan_id = e1000_set_lan_id_single_port; | ||
274 | func->check_mng_mode = e1000_check_mng_mode_82574; | 278 | func->check_mng_mode = e1000_check_mng_mode_82574; |
275 | func->led_on = e1000_led_on_82574; | 279 | func->led_on = e1000_led_on_82574; |
276 | break; | 280 | break; |
@@ -313,7 +317,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
313 | * indicates that the bootagent or EFI code has | 317 | * indicates that the bootagent or EFI code has |
314 | * improperly left this bit enabled | 318 | * improperly left this bit enabled |
315 | */ | 319 | */ |
316 | hw_dbg(hw, "Please update your 82571 Bootagent\n"); | 320 | e_dbg("Please update your 82571 Bootagent\n"); |
317 | } | 321 | } |
318 | ew32(SWSM, swsm & ~E1000_SWSM_SMBI); | 322 | ew32(SWSM, swsm & ~E1000_SWSM_SMBI); |
319 | } | 323 | } |
@@ -332,7 +336,6 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter) | |||
332 | struct e1000_hw *hw = &adapter->hw; | 336 | struct e1000_hw *hw = &adapter->hw; |
333 | static int global_quad_port_a; /* global port a indication */ | 337 | static int global_quad_port_a; /* global port a indication */ |
334 | struct pci_dev *pdev = adapter->pdev; | 338 | struct pci_dev *pdev = adapter->pdev; |
335 | u16 eeprom_data = 0; | ||
336 | int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1; | 339 | int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1; |
337 | s32 rc; | 340 | s32 rc; |
338 | 341 | ||
@@ -383,16 +386,15 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter) | |||
383 | if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) | 386 | if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) |
384 | adapter->flags &= ~FLAG_HAS_WOL; | 387 | adapter->flags &= ~FLAG_HAS_WOL; |
385 | break; | 388 | break; |
386 | |||
387 | case e1000_82573: | 389 | case e1000_82573: |
390 | case e1000_82574: | ||
391 | case e1000_82583: | ||
392 | /* Disable ASPM L0s due to hardware errata */ | ||
393 | e1000e_disable_aspm(adapter->pdev, PCIE_LINK_STATE_L0S); | ||
394 | |||
388 | if (pdev->device == E1000_DEV_ID_82573L) { | 395 | if (pdev->device == E1000_DEV_ID_82573L) { |
389 | if (e1000_read_nvm(&adapter->hw, NVM_INIT_3GIO_3, 1, | 396 | adapter->flags |= FLAG_HAS_JUMBO_FRAMES; |
390 | &eeprom_data) < 0) | 397 | adapter->max_hw_frame_size = DEFAULT_JUMBO; |
391 | break; | ||
392 | if (!(eeprom_data & NVM_WORD1A_ASPM_MASK)) { | ||
393 | adapter->flags |= FLAG_HAS_JUMBO_FRAMES; | ||
394 | adapter->max_hw_frame_size = DEFAULT_JUMBO; | ||
395 | } | ||
396 | } | 398 | } |
397 | break; | 399 | break; |
398 | default: | 400 | default: |
@@ -487,7 +489,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) | |||
487 | } | 489 | } |
488 | 490 | ||
489 | if (i == sw_timeout) { | 491 | if (i == sw_timeout) { |
490 | hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n"); | 492 | e_dbg("Driver can't access device - SMBI bit is set.\n"); |
491 | hw->dev_spec.e82571.smb_counter++; | 493 | hw->dev_spec.e82571.smb_counter++; |
492 | } | 494 | } |
493 | /* Get the FW semaphore. */ | 495 | /* Get the FW semaphore. */ |
@@ -505,7 +507,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) | |||
505 | if (i == fw_timeout) { | 507 | if (i == fw_timeout) { |
506 | /* Release semaphores */ | 508 | /* Release semaphores */ |
507 | e1000_put_hw_semaphore_82571(hw); | 509 | e1000_put_hw_semaphore_82571(hw); |
508 | hw_dbg(hw, "Driver can't access the NVM\n"); | 510 | e_dbg("Driver can't access the NVM\n"); |
509 | return -E1000_ERR_NVM; | 511 | return -E1000_ERR_NVM; |
510 | } | 512 | } |
511 | 513 | ||
@@ -702,8 +704,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, | |||
702 | u16 words, u16 *data) | 704 | u16 words, u16 *data) |
703 | { | 705 | { |
704 | struct e1000_nvm_info *nvm = &hw->nvm; | 706 | struct e1000_nvm_info *nvm = &hw->nvm; |
705 | u32 i; | 707 | u32 i, eewr = 0; |
706 | u32 eewr = 0; | ||
707 | s32 ret_val = 0; | 708 | s32 ret_val = 0; |
708 | 709 | ||
709 | /* | 710 | /* |
@@ -712,7 +713,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, | |||
712 | */ | 713 | */ |
713 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || | 714 | if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || |
714 | (words == 0)) { | 715 | (words == 0)) { |
715 | hw_dbg(hw, "nvm parameter(s) out of bounds\n"); | 716 | e_dbg("nvm parameter(s) out of bounds\n"); |
716 | return -E1000_ERR_NVM; | 717 | return -E1000_ERR_NVM; |
717 | } | 718 | } |
718 | 719 | ||
@@ -753,7 +754,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) | |||
753 | timeout--; | 754 | timeout--; |
754 | } | 755 | } |
755 | if (!timeout) { | 756 | if (!timeout) { |
756 | hw_dbg(hw, "MNG configuration cycle has not completed.\n"); | 757 | e_dbg("MNG configuration cycle has not completed.\n"); |
757 | return -E1000_ERR_RESET; | 758 | return -E1000_ERR_RESET; |
758 | } | 759 | } |
759 | 760 | ||
@@ -763,7 +764,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) | |||
763 | /** | 764 | /** |
764 | * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state | 765 | * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state |
765 | * @hw: pointer to the HW structure | 766 | * @hw: pointer to the HW structure |
766 | * @active: TRUE to enable LPLU, FALSE to disable | 767 | * @active: true to enable LPLU, false to disable |
767 | * | 768 | * |
768 | * Sets the LPLU D0 state according to the active flag. When activating LPLU | 769 | * Sets the LPLU D0 state according to the active flag. When activating LPLU |
769 | * this function also disables smart speed and vice versa. LPLU will not be | 770 | * this function also disables smart speed and vice versa. LPLU will not be |
@@ -834,15 +835,11 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) | |||
834 | * e1000_reset_hw_82571 - Reset hardware | 835 | * e1000_reset_hw_82571 - Reset hardware |
835 | * @hw: pointer to the HW structure | 836 | * @hw: pointer to the HW structure |
836 | * | 837 | * |
837 | * This resets the hardware into a known state. This is a | 838 | * This resets the hardware into a known state. |
838 | * function pointer entry point called by the api module. | ||
839 | **/ | 839 | **/ |
840 | static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | 840 | static s32 e1000_reset_hw_82571(struct e1000_hw *hw) |
841 | { | 841 | { |
842 | u32 ctrl; | 842 | u32 ctrl, extcnf_ctrl, ctrl_ext, icr; |
843 | u32 extcnf_ctrl; | ||
844 | u32 ctrl_ext; | ||
845 | u32 icr; | ||
846 | s32 ret_val; | 843 | s32 ret_val; |
847 | u16 i = 0; | 844 | u16 i = 0; |
848 | 845 | ||
@@ -852,9 +849,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
852 | */ | 849 | */ |
853 | ret_val = e1000e_disable_pcie_master(hw); | 850 | ret_val = e1000e_disable_pcie_master(hw); |
854 | if (ret_val) | 851 | if (ret_val) |
855 | hw_dbg(hw, "PCI-E Master disable polling has failed.\n"); | 852 | e_dbg("PCI-E Master disable polling has failed.\n"); |
856 | 853 | ||
857 | hw_dbg(hw, "Masking off all interrupts\n"); | 854 | e_dbg("Masking off all interrupts\n"); |
858 | ew32(IMC, 0xffffffff); | 855 | ew32(IMC, 0xffffffff); |
859 | 856 | ||
860 | ew32(RCTL, 0); | 857 | ew32(RCTL, 0); |
@@ -893,7 +890,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
893 | 890 | ||
894 | ctrl = er32(CTRL); | 891 | ctrl = er32(CTRL); |
895 | 892 | ||
896 | hw_dbg(hw, "Issuing a global reset to MAC\n"); | 893 | e_dbg("Issuing a global reset to MAC\n"); |
897 | ew32(CTRL, ctrl | E1000_CTRL_RST); | 894 | ew32(CTRL, ctrl | E1000_CTRL_RST); |
898 | 895 | ||
899 | if (hw->nvm.type == e1000_nvm_flash_hw) { | 896 | if (hw->nvm.type == e1000_nvm_flash_hw) { |
@@ -929,9 +926,12 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) | |||
929 | ew32(IMC, 0xffffffff); | 926 | ew32(IMC, 0xffffffff); |
930 | icr = er32(ICR); | 927 | icr = er32(ICR); |
931 | 928 | ||
932 | if (hw->mac.type == e1000_82571 && | 929 | /* Install any alternate MAC address into RAR0 */ |
933 | hw->dev_spec.e82571.alt_mac_addr_is_present) | 930 | ret_val = e1000_check_alt_mac_addr_generic(hw); |
934 | e1000e_set_laa_state_82571(hw, true); | 931 | if (ret_val) |
932 | return ret_val; | ||
933 | |||
934 | e1000e_set_laa_state_82571(hw, true); | ||
935 | 935 | ||
936 | /* Reinitialize the 82571 serdes link state machine */ | 936 | /* Reinitialize the 82571 serdes link state machine */ |
937 | if (hw->phy.media_type == e1000_media_type_internal_serdes) | 937 | if (hw->phy.media_type == e1000_media_type_internal_serdes) |
@@ -951,21 +951,19 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) | |||
951 | struct e1000_mac_info *mac = &hw->mac; | 951 | struct e1000_mac_info *mac = &hw->mac; |
952 | u32 reg_data; | 952 | u32 reg_data; |
953 | s32 ret_val; | 953 | s32 ret_val; |
954 | u16 i; | 954 | u16 i, rar_count = mac->rar_entry_count; |
955 | u16 rar_count = mac->rar_entry_count; | ||
956 | 955 | ||
957 | e1000_initialize_hw_bits_82571(hw); | 956 | e1000_initialize_hw_bits_82571(hw); |
958 | 957 | ||
959 | /* Initialize identification LED */ | 958 | /* Initialize identification LED */ |
960 | ret_val = e1000e_id_led_init(hw); | 959 | ret_val = e1000e_id_led_init(hw); |
961 | if (ret_val) { | 960 | if (ret_val) |
962 | hw_dbg(hw, "Error initializing identification LED\n"); | 961 | e_dbg("Error initializing identification LED\n"); |
963 | return ret_val; | 962 | /* This is not fatal and we should not stop init due to this */ |
964 | } | ||
965 | 963 | ||
966 | /* Disabling VLAN filtering */ | 964 | /* Disabling VLAN filtering */ |
967 | hw_dbg(hw, "Initializing the IEEE VLAN\n"); | 965 | e_dbg("Initializing the IEEE VLAN\n"); |
968 | e1000e_clear_vfta(hw); | 966 | mac->ops.clear_vfta(hw); |
969 | 967 | ||
970 | /* Setup the receive address. */ | 968 | /* Setup the receive address. */ |
971 | /* | 969 | /* |
@@ -978,7 +976,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) | |||
978 | e1000e_init_rx_addrs(hw, rar_count); | 976 | e1000e_init_rx_addrs(hw, rar_count); |
979 | 977 | ||
980 | /* Zero out the Multicast HASH table */ | 978 | /* Zero out the Multicast HASH table */ |
981 | hw_dbg(hw, "Zeroing the MTA\n"); | 979 | e_dbg("Zeroing the MTA\n"); |
982 | for (i = 0; i < mac->mta_reg_count; i++) | 980 | for (i = 0; i < mac->mta_reg_count; i++) |
983 | E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); | 981 | E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); |
984 | 982 | ||
@@ -1125,6 +1123,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) | |||
1125 | reg |= (1 << 22); | 1123 | reg |= (1 << 22); |
1126 | ew32(GCR, reg); | 1124 | ew32(GCR, reg); |
1127 | 1125 | ||
1126 | /* | ||
1127 | * Workaround for hardware errata. | ||
1128 | * apply workaround for hardware errata documented in errata | ||
1129 | * docs Fixes issue where some error prone or unreliable PCIe | ||
1130 | * completions are occurring, particularly with ASPM enabled. | ||
1131 | * Without fix, issue can cause tx timeouts. | ||
1132 | */ | ||
1128 | reg = er32(GCR2); | 1133 | reg = er32(GCR2); |
1129 | reg |= 1; | 1134 | reg |= 1; |
1130 | ew32(GCR2, reg); | 1135 | ew32(GCR2, reg); |
@@ -1137,13 +1142,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) | |||
1137 | } | 1142 | } |
1138 | 1143 | ||
1139 | /** | 1144 | /** |
1140 | * e1000e_clear_vfta - Clear VLAN filter table | 1145 | * e1000_clear_vfta_82571 - Clear VLAN filter table |
1141 | * @hw: pointer to the HW structure | 1146 | * @hw: pointer to the HW structure |
1142 | * | 1147 | * |
1143 | * Clears the register array which contains the VLAN filter table by | 1148 | * Clears the register array which contains the VLAN filter table by |
1144 | * setting all the values to 0. | 1149 | * setting all the values to 0. |
1145 | **/ | 1150 | **/ |
1146 | void e1000e_clear_vfta(struct e1000_hw *hw) | 1151 | static void e1000_clear_vfta_82571(struct e1000_hw *hw) |
1147 | { | 1152 | { |
1148 | u32 offset; | 1153 | u32 offset; |
1149 | u32 vfta_value = 0; | 1154 | u32 vfta_value = 0; |
@@ -1227,32 +1232,6 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw) | |||
1227 | } | 1232 | } |
1228 | 1233 | ||
1229 | /** | 1234 | /** |
1230 | * e1000_update_mc_addr_list_82571 - Update Multicast addresses | ||
1231 | * @hw: pointer to the HW structure | ||
1232 | * @mc_addr_list: array of multicast addresses to program | ||
1233 | * @mc_addr_count: number of multicast addresses to program | ||
1234 | * @rar_used_count: the first RAR register free to program | ||
1235 | * @rar_count: total number of supported Receive Address Registers | ||
1236 | * | ||
1237 | * Updates the Receive Address Registers and Multicast Table Array. | ||
1238 | * The caller must have a packed mc_addr_list of multicast addresses. | ||
1239 | * The parameter rar_count will usually be hw->mac.rar_entry_count | ||
1240 | * unless there are workarounds that change this. | ||
1241 | **/ | ||
1242 | static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw, | ||
1243 | u8 *mc_addr_list, | ||
1244 | u32 mc_addr_count, | ||
1245 | u32 rar_used_count, | ||
1246 | u32 rar_count) | ||
1247 | { | ||
1248 | if (e1000e_get_laa_state_82571(hw)) | ||
1249 | rar_count--; | ||
1250 | |||
1251 | e1000e_update_mc_addr_list_generic(hw, mc_addr_list, mc_addr_count, | ||
1252 | rar_used_count, rar_count); | ||
1253 | } | ||
1254 | |||
1255 | /** | ||
1256 | * e1000_setup_link_82571 - Setup flow control and link settings | 1235 | * e1000_setup_link_82571 - Setup flow control and link settings |
1257 | * @hw: pointer to the HW structure | 1236 | * @hw: pointer to the HW structure |
1258 | * | 1237 | * |
@@ -1294,7 +1273,6 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw) | |||
1294 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | 1273 | static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) |
1295 | { | 1274 | { |
1296 | u32 ctrl; | 1275 | u32 ctrl; |
1297 | u32 led_ctrl; | ||
1298 | s32 ret_val; | 1276 | s32 ret_val; |
1299 | 1277 | ||
1300 | ctrl = er32(CTRL); | 1278 | ctrl = er32(CTRL); |
@@ -1309,11 +1287,6 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) | |||
1309 | break; | 1287 | break; |
1310 | case e1000_phy_igp_2: | 1288 | case e1000_phy_igp_2: |
1311 | ret_val = e1000e_copper_link_setup_igp(hw); | 1289 | ret_val = e1000e_copper_link_setup_igp(hw); |
1312 | /* Setup activity LED */ | ||
1313 | led_ctrl = er32(LEDCTL); | ||
1314 | led_ctrl &= IGP_ACTIVITY_LED_MASK; | ||
1315 | led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); | ||
1316 | ew32(LEDCTL, led_ctrl); | ||
1317 | break; | 1290 | break; |
1318 | default: | 1291 | default: |
1319 | return -E1000_ERR_PHY; | 1292 | return -E1000_ERR_PHY; |
@@ -1360,8 +1333,20 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw) | |||
1360 | * e1000_check_for_serdes_link_82571 - Check for link (Serdes) | 1333 | * e1000_check_for_serdes_link_82571 - Check for link (Serdes) |
1361 | * @hw: pointer to the HW structure | 1334 | * @hw: pointer to the HW structure |
1362 | * | 1335 | * |
1363 | * Checks for link up on the hardware. If link is not up and we have | 1336 | * Reports the link state as up or down. |
1364 | * a signal, then we need to force link up. | 1337 | * |
1338 | * If autonegotiation is supported by the link partner, the link state is | ||
1339 | * determined by the result of autonegotiation. This is the most likely case. | ||
1340 | * If autonegotiation is not supported by the link partner, and the link | ||
1341 | * has a valid signal, force the link up. | ||
1342 | * | ||
1343 | * The link state is represented internally here by 4 states: | ||
1344 | * | ||
1345 | * 1) down | ||
1346 | * 2) autoneg_progress | ||
1347 | * 3) autoneg_complete (the link successfully autonegotiated) | ||
1348 | * 4) forced_up (the link has been forced up, it did not autonegotiate) | ||
1349 | * | ||
1365 | **/ | 1350 | **/ |
1366 | static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | 1351 | static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) |
1367 | { | 1352 | { |
@@ -1387,7 +1372,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | |||
1387 | */ | 1372 | */ |
1388 | mac->serdes_link_state = | 1373 | mac->serdes_link_state = |
1389 | e1000_serdes_link_autoneg_progress; | 1374 | e1000_serdes_link_autoneg_progress; |
1390 | hw_dbg(hw, "AN_UP -> AN_PROG\n"); | 1375 | mac->serdes_has_link = false; |
1376 | e_dbg("AN_UP -> AN_PROG\n"); | ||
1391 | } | 1377 | } |
1392 | break; | 1378 | break; |
1393 | 1379 | ||
@@ -1401,79 +1387,86 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | |||
1401 | if (rxcw & E1000_RXCW_C) { | 1387 | if (rxcw & E1000_RXCW_C) { |
1402 | /* Enable autoneg, and unforce link up */ | 1388 | /* Enable autoneg, and unforce link up */ |
1403 | ew32(TXCW, mac->txcw); | 1389 | ew32(TXCW, mac->txcw); |
1404 | ew32(CTRL, | 1390 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); |
1405 | (ctrl & ~E1000_CTRL_SLU)); | ||
1406 | mac->serdes_link_state = | 1391 | mac->serdes_link_state = |
1407 | e1000_serdes_link_autoneg_progress; | 1392 | e1000_serdes_link_autoneg_progress; |
1408 | hw_dbg(hw, "FORCED_UP -> AN_PROG\n"); | 1393 | mac->serdes_has_link = false; |
1394 | e_dbg("FORCED_UP -> AN_PROG\n"); | ||
1409 | } | 1395 | } |
1410 | break; | 1396 | break; |
1411 | 1397 | ||
1412 | case e1000_serdes_link_autoneg_progress: | 1398 | case e1000_serdes_link_autoneg_progress: |
1413 | /* | 1399 | if (rxcw & E1000_RXCW_C) { |
1414 | * If the LU bit is set in the STATUS register, | 1400 | /* |
1415 | * autoneg has completed sucessfully. If not, | 1401 | * We received /C/ ordered sets, meaning the |
1416 | * try foring the link because the far end may be | 1402 | * link partner has autonegotiated, and we can |
1417 | * available but not capable of autonegotiation. | 1403 | * trust the Link Up (LU) status bit. |
1418 | */ | 1404 | */ |
1419 | if (status & E1000_STATUS_LU) { | 1405 | if (status & E1000_STATUS_LU) { |
1420 | mac->serdes_link_state = | 1406 | mac->serdes_link_state = |
1421 | e1000_serdes_link_autoneg_complete; | 1407 | e1000_serdes_link_autoneg_complete; |
1422 | hw_dbg(hw, "AN_PROG -> AN_UP\n"); | 1408 | e_dbg("AN_PROG -> AN_UP\n"); |
1409 | mac->serdes_has_link = true; | ||
1410 | } else { | ||
1411 | /* Autoneg completed, but failed. */ | ||
1412 | mac->serdes_link_state = | ||
1413 | e1000_serdes_link_down; | ||
1414 | e_dbg("AN_PROG -> DOWN\n"); | ||
1415 | } | ||
1423 | } else { | 1416 | } else { |
1424 | /* | 1417 | /* |
1425 | * Disable autoneg, force link up and | 1418 | * The link partner did not autoneg. |
1426 | * full duplex, and change state to forced | 1419 | * Force link up and full duplex, and change |
1420 | * state to forced. | ||
1427 | */ | 1421 | */ |
1428 | ew32(TXCW, | 1422 | ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); |
1429 | (mac->txcw & ~E1000_TXCW_ANE)); | ||
1430 | ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD); | 1423 | ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD); |
1431 | ew32(CTRL, ctrl); | 1424 | ew32(CTRL, ctrl); |
1432 | 1425 | ||
1433 | /* Configure Flow Control after link up. */ | 1426 | /* Configure Flow Control after link up. */ |
1434 | ret_val = | 1427 | ret_val = e1000e_config_fc_after_link_up(hw); |
1435 | e1000e_config_fc_after_link_up(hw); | ||
1436 | if (ret_val) { | 1428 | if (ret_val) { |
1437 | hw_dbg(hw, "Error config flow control\n"); | 1429 | e_dbg("Error config flow control\n"); |
1438 | break; | 1430 | break; |
1439 | } | 1431 | } |
1440 | mac->serdes_link_state = | 1432 | mac->serdes_link_state = |
1441 | e1000_serdes_link_forced_up; | 1433 | e1000_serdes_link_forced_up; |
1442 | hw_dbg(hw, "AN_PROG -> FORCED_UP\n"); | 1434 | mac->serdes_has_link = true; |
1435 | e_dbg("AN_PROG -> FORCED_UP\n"); | ||
1443 | } | 1436 | } |
1444 | mac->serdes_has_link = true; | ||
1445 | break; | 1437 | break; |
1446 | 1438 | ||
1447 | case e1000_serdes_link_down: | 1439 | case e1000_serdes_link_down: |
1448 | default: | 1440 | default: |
1449 | /* The link was down but the receiver has now gained | 1441 | /* |
1442 | * The link was down but the receiver has now gained | ||
1450 | * valid sync, so lets see if we can bring the link | 1443 | * valid sync, so lets see if we can bring the link |
1451 | * up. */ | 1444 | * up. |
1445 | */ | ||
1452 | ew32(TXCW, mac->txcw); | 1446 | ew32(TXCW, mac->txcw); |
1453 | ew32(CTRL, | 1447 | ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); |
1454 | (ctrl & ~E1000_CTRL_SLU)); | ||
1455 | mac->serdes_link_state = | 1448 | mac->serdes_link_state = |
1456 | e1000_serdes_link_autoneg_progress; | 1449 | e1000_serdes_link_autoneg_progress; |
1457 | hw_dbg(hw, "DOWN -> AN_PROG\n"); | 1450 | e_dbg("DOWN -> AN_PROG\n"); |
1458 | break; | 1451 | break; |
1459 | } | 1452 | } |
1460 | } else { | 1453 | } else { |
1461 | if (!(rxcw & E1000_RXCW_SYNCH)) { | 1454 | if (!(rxcw & E1000_RXCW_SYNCH)) { |
1462 | mac->serdes_has_link = false; | 1455 | mac->serdes_has_link = false; |
1463 | mac->serdes_link_state = e1000_serdes_link_down; | 1456 | mac->serdes_link_state = e1000_serdes_link_down; |
1464 | hw_dbg(hw, "ANYSTATE -> DOWN\n"); | 1457 | e_dbg("ANYSTATE -> DOWN\n"); |
1465 | } else { | 1458 | } else { |
1466 | /* | 1459 | /* |
1467 | * We have sync, and can tolerate one | 1460 | * We have sync, and can tolerate one invalid (IV) |
1468 | * invalid (IV) codeword before declaring | 1461 | * codeword before declaring link down, so reread |
1469 | * link down, so reread to look again | 1462 | * to look again. |
1470 | */ | 1463 | */ |
1471 | udelay(10); | 1464 | udelay(10); |
1472 | rxcw = er32(RXCW); | 1465 | rxcw = er32(RXCW); |
1473 | if (rxcw & E1000_RXCW_IV) { | 1466 | if (rxcw & E1000_RXCW_IV) { |
1474 | mac->serdes_link_state = e1000_serdes_link_down; | 1467 | mac->serdes_link_state = e1000_serdes_link_down; |
1475 | mac->serdes_has_link = false; | 1468 | mac->serdes_has_link = false; |
1476 | hw_dbg(hw, "ANYSTATE -> DOWN\n"); | 1469 | e_dbg("ANYSTATE -> DOWN\n"); |
1477 | } | 1470 | } |
1478 | } | 1471 | } |
1479 | } | 1472 | } |
@@ -1495,7 +1488,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) | |||
1495 | 1488 | ||
1496 | ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); | 1489 | ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); |
1497 | if (ret_val) { | 1490 | if (ret_val) { |
1498 | hw_dbg(hw, "NVM Read Error\n"); | 1491 | e_dbg("NVM Read Error\n"); |
1499 | return ret_val; | 1492 | return ret_val; |
1500 | } | 1493 | } |
1501 | 1494 | ||
@@ -1525,7 +1518,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) | |||
1525 | bool e1000e_get_laa_state_82571(struct e1000_hw *hw) | 1518 | bool e1000e_get_laa_state_82571(struct e1000_hw *hw) |
1526 | { | 1519 | { |
1527 | if (hw->mac.type != e1000_82571) | 1520 | if (hw->mac.type != e1000_82571) |
1528 | return 0; | 1521 | return false; |
1529 | 1522 | ||
1530 | return hw->dev_spec.e82571.laa_is_present; | 1523 | return hw->dev_spec.e82571.laa_is_present; |
1531 | } | 1524 | } |
@@ -1535,7 +1528,7 @@ bool e1000e_get_laa_state_82571(struct e1000_hw *hw) | |||
1535 | * @hw: pointer to the HW structure | 1528 | * @hw: pointer to the HW structure |
1536 | * @state: enable/disable locally administered address | 1529 | * @state: enable/disable locally administered address |
1537 | * | 1530 | * |
1538 | * Enable/Disable the current locally administers address state. | 1531 | * Enable/Disable the current locally administered address state. |
1539 | **/ | 1532 | **/ |
1540 | void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state) | 1533 | void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state) |
1541 | { | 1534 | { |
@@ -1609,6 +1602,51 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) | |||
1609 | } | 1602 | } |
1610 | 1603 | ||
1611 | /** | 1604 | /** |
1605 | * e1000_read_mac_addr_82571 - Read device MAC address | ||
1606 | * @hw: pointer to the HW structure | ||
1607 | **/ | ||
1608 | static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) | ||
1609 | { | ||
1610 | s32 ret_val = 0; | ||
1611 | |||
1612 | /* | ||
1613 | * If there's an alternate MAC address place it in RAR0 | ||
1614 | * so that it will override the Si installed default perm | ||
1615 | * address. | ||
1616 | */ | ||
1617 | ret_val = e1000_check_alt_mac_addr_generic(hw); | ||
1618 | if (ret_val) | ||
1619 | goto out; | ||
1620 | |||
1621 | ret_val = e1000_read_mac_addr_generic(hw); | ||
1622 | |||
1623 | out: | ||
1624 | return ret_val; | ||
1625 | } | ||
1626 | |||
1627 | /** | ||
1628 | * e1000_power_down_phy_copper_82571 - Remove link during PHY power down | ||
1629 | * @hw: pointer to the HW structure | ||
1630 | * | ||
1631 | * In the case of a PHY power down to save power, or to turn off link during a | ||
1632 | * driver unload, or wake on lan is not enabled, remove the link. | ||
1633 | **/ | ||
1634 | static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw) | ||
1635 | { | ||
1636 | struct e1000_phy_info *phy = &hw->phy; | ||
1637 | struct e1000_mac_info *mac = &hw->mac; | ||
1638 | |||
1639 | if (!(phy->ops.check_reset_block)) | ||
1640 | return; | ||
1641 | |||
1642 | /* If the management interface is not enabled, then power down */ | ||
1643 | if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw))) | ||
1644 | e1000_power_down_phy_copper(hw); | ||
1645 | |||
1646 | return; | ||
1647 | } | ||
1648 | |||
1649 | /** | ||
1612 | * e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters | 1650 | * e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters |
1613 | * @hw: pointer to the HW structure | 1651 | * @hw: pointer to the HW structure |
1614 | * | 1652 | * |
@@ -1616,44 +1654,42 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) | |||
1616 | **/ | 1654 | **/ |
1617 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) | 1655 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) |
1618 | { | 1656 | { |
1619 | u32 temp; | ||
1620 | |||
1621 | e1000e_clear_hw_cntrs_base(hw); | 1657 | e1000e_clear_hw_cntrs_base(hw); |
1622 | 1658 | ||
1623 | temp = er32(PRC64); | 1659 | er32(PRC64); |
1624 | temp = er32(PRC127); | 1660 | er32(PRC127); |
1625 | temp = er32(PRC255); | 1661 | er32(PRC255); |
1626 | temp = er32(PRC511); | 1662 | er32(PRC511); |
1627 | temp = er32(PRC1023); | 1663 | er32(PRC1023); |
1628 | temp = er32(PRC1522); | 1664 | er32(PRC1522); |
1629 | temp = er32(PTC64); | 1665 | er32(PTC64); |
1630 | temp = er32(PTC127); | 1666 | er32(PTC127); |
1631 | temp = er32(PTC255); | 1667 | er32(PTC255); |
1632 | temp = er32(PTC511); | 1668 | er32(PTC511); |
1633 | temp = er32(PTC1023); | 1669 | er32(PTC1023); |
1634 | temp = er32(PTC1522); | 1670 | er32(PTC1522); |
1635 | 1671 | ||
1636 | temp = er32(ALGNERRC); | 1672 | er32(ALGNERRC); |
1637 | temp = er32(RXERRC); | 1673 | er32(RXERRC); |
1638 | temp = er32(TNCRS); | 1674 | er32(TNCRS); |
1639 | temp = er32(CEXTERR); | 1675 | er32(CEXTERR); |
1640 | temp = er32(TSCTC); | 1676 | er32(TSCTC); |
1641 | temp = er32(TSCTFC); | 1677 | er32(TSCTFC); |
1642 | 1678 | ||
1643 | temp = er32(MGTPRC); | 1679 | er32(MGTPRC); |
1644 | temp = er32(MGTPDC); | 1680 | er32(MGTPDC); |
1645 | temp = er32(MGTPTC); | 1681 | er32(MGTPTC); |
1646 | 1682 | ||
1647 | temp = er32(IAC); | 1683 | er32(IAC); |
1648 | temp = er32(ICRXOC); | 1684 | er32(ICRXOC); |
1649 | 1685 | ||
1650 | temp = er32(ICRXPTC); | 1686 | er32(ICRXPTC); |
1651 | temp = er32(ICRXATC); | 1687 | er32(ICRXATC); |
1652 | temp = er32(ICTXPTC); | 1688 | er32(ICTXPTC); |
1653 | temp = er32(ICTXATC); | 1689 | er32(ICTXATC); |
1654 | temp = er32(ICTXQEC); | 1690 | er32(ICTXQEC); |
1655 | temp = er32(ICTXQMTC); | 1691 | er32(ICTXQMTC); |
1656 | temp = er32(ICRXDMTC); | 1692 | er32(ICRXDMTC); |
1657 | } | 1693 | } |
1658 | 1694 | ||
1659 | static struct e1000_mac_operations e82571_mac_ops = { | 1695 | static struct e1000_mac_operations e82571_mac_ops = { |
@@ -1663,76 +1699,83 @@ static struct e1000_mac_operations e82571_mac_ops = { | |||
1663 | .cleanup_led = e1000e_cleanup_led_generic, | 1699 | .cleanup_led = e1000e_cleanup_led_generic, |
1664 | .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, | 1700 | .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, |
1665 | .get_bus_info = e1000e_get_bus_info_pcie, | 1701 | .get_bus_info = e1000e_get_bus_info_pcie, |
1702 | .set_lan_id = e1000_set_lan_id_multi_port_pcie, | ||
1666 | /* .get_link_up_info: media type dependent */ | 1703 | /* .get_link_up_info: media type dependent */ |
1667 | /* .led_on: mac type dependent */ | 1704 | /* .led_on: mac type dependent */ |
1668 | .led_off = e1000e_led_off_generic, | 1705 | .led_off = e1000e_led_off_generic, |
1669 | .update_mc_addr_list = e1000_update_mc_addr_list_82571, | 1706 | .update_mc_addr_list = e1000e_update_mc_addr_list_generic, |
1707 | .write_vfta = e1000_write_vfta_generic, | ||
1708 | .clear_vfta = e1000_clear_vfta_82571, | ||
1670 | .reset_hw = e1000_reset_hw_82571, | 1709 | .reset_hw = e1000_reset_hw_82571, |
1671 | .init_hw = e1000_init_hw_82571, | 1710 | .init_hw = e1000_init_hw_82571, |
1672 | .setup_link = e1000_setup_link_82571, | 1711 | .setup_link = e1000_setup_link_82571, |
1673 | /* .setup_physical_interface: media type dependent */ | 1712 | /* .setup_physical_interface: media type dependent */ |
1674 | .setup_led = e1000e_setup_led_generic, | 1713 | .setup_led = e1000e_setup_led_generic, |
1714 | .read_mac_addr = e1000_read_mac_addr_82571, | ||
1675 | }; | 1715 | }; |
1676 | 1716 | ||
1677 | static struct e1000_phy_operations e82_phy_ops_igp = { | 1717 | static struct e1000_phy_operations e82_phy_ops_igp = { |
1678 | .acquire_phy = e1000_get_hw_semaphore_82571, | 1718 | .acquire = e1000_get_hw_semaphore_82571, |
1719 | .check_polarity = e1000_check_polarity_igp, | ||
1679 | .check_reset_block = e1000e_check_reset_block_generic, | 1720 | .check_reset_block = e1000e_check_reset_block_generic, |
1680 | .commit_phy = NULL, | 1721 | .commit = NULL, |
1681 | .force_speed_duplex = e1000e_phy_force_speed_duplex_igp, | 1722 | .force_speed_duplex = e1000e_phy_force_speed_duplex_igp, |
1682 | .get_cfg_done = e1000_get_cfg_done_82571, | 1723 | .get_cfg_done = e1000_get_cfg_done_82571, |
1683 | .get_cable_length = e1000e_get_cable_length_igp_2, | 1724 | .get_cable_length = e1000e_get_cable_length_igp_2, |
1684 | .get_phy_info = e1000e_get_phy_info_igp, | 1725 | .get_info = e1000e_get_phy_info_igp, |
1685 | .read_phy_reg = e1000e_read_phy_reg_igp, | 1726 | .read_reg = e1000e_read_phy_reg_igp, |
1686 | .release_phy = e1000_put_hw_semaphore_82571, | 1727 | .release = e1000_put_hw_semaphore_82571, |
1687 | .reset_phy = e1000e_phy_hw_reset_generic, | 1728 | .reset = e1000e_phy_hw_reset_generic, |
1688 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, | 1729 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, |
1689 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, | 1730 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, |
1690 | .write_phy_reg = e1000e_write_phy_reg_igp, | 1731 | .write_reg = e1000e_write_phy_reg_igp, |
1691 | .cfg_on_link_up = NULL, | 1732 | .cfg_on_link_up = NULL, |
1692 | }; | 1733 | }; |
1693 | 1734 | ||
1694 | static struct e1000_phy_operations e82_phy_ops_m88 = { | 1735 | static struct e1000_phy_operations e82_phy_ops_m88 = { |
1695 | .acquire_phy = e1000_get_hw_semaphore_82571, | 1736 | .acquire = e1000_get_hw_semaphore_82571, |
1737 | .check_polarity = e1000_check_polarity_m88, | ||
1696 | .check_reset_block = e1000e_check_reset_block_generic, | 1738 | .check_reset_block = e1000e_check_reset_block_generic, |
1697 | .commit_phy = e1000e_phy_sw_reset, | 1739 | .commit = e1000e_phy_sw_reset, |
1698 | .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, | 1740 | .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, |
1699 | .get_cfg_done = e1000e_get_cfg_done, | 1741 | .get_cfg_done = e1000e_get_cfg_done, |
1700 | .get_cable_length = e1000e_get_cable_length_m88, | 1742 | .get_cable_length = e1000e_get_cable_length_m88, |
1701 | .get_phy_info = e1000e_get_phy_info_m88, | 1743 | .get_info = e1000e_get_phy_info_m88, |
1702 | .read_phy_reg = e1000e_read_phy_reg_m88, | 1744 | .read_reg = e1000e_read_phy_reg_m88, |
1703 | .release_phy = e1000_put_hw_semaphore_82571, | 1745 | .release = e1000_put_hw_semaphore_82571, |
1704 | .reset_phy = e1000e_phy_hw_reset_generic, | 1746 | .reset = e1000e_phy_hw_reset_generic, |
1705 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, | 1747 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, |
1706 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, | 1748 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, |
1707 | .write_phy_reg = e1000e_write_phy_reg_m88, | 1749 | .write_reg = e1000e_write_phy_reg_m88, |
1708 | .cfg_on_link_up = NULL, | 1750 | .cfg_on_link_up = NULL, |
1709 | }; | 1751 | }; |
1710 | 1752 | ||
1711 | static struct e1000_phy_operations e82_phy_ops_bm = { | 1753 | static struct e1000_phy_operations e82_phy_ops_bm = { |
1712 | .acquire_phy = e1000_get_hw_semaphore_82571, | 1754 | .acquire = e1000_get_hw_semaphore_82571, |
1755 | .check_polarity = e1000_check_polarity_m88, | ||
1713 | .check_reset_block = e1000e_check_reset_block_generic, | 1756 | .check_reset_block = e1000e_check_reset_block_generic, |
1714 | .commit_phy = e1000e_phy_sw_reset, | 1757 | .commit = e1000e_phy_sw_reset, |
1715 | .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, | 1758 | .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, |
1716 | .get_cfg_done = e1000e_get_cfg_done, | 1759 | .get_cfg_done = e1000e_get_cfg_done, |
1717 | .get_cable_length = e1000e_get_cable_length_m88, | 1760 | .get_cable_length = e1000e_get_cable_length_m88, |
1718 | .get_phy_info = e1000e_get_phy_info_m88, | 1761 | .get_info = e1000e_get_phy_info_m88, |
1719 | .read_phy_reg = e1000e_read_phy_reg_bm2, | 1762 | .read_reg = e1000e_read_phy_reg_bm2, |
1720 | .release_phy = e1000_put_hw_semaphore_82571, | 1763 | .release = e1000_put_hw_semaphore_82571, |
1721 | .reset_phy = e1000e_phy_hw_reset_generic, | 1764 | .reset = e1000e_phy_hw_reset_generic, |
1722 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, | 1765 | .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, |
1723 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, | 1766 | .set_d3_lplu_state = e1000e_set_d3_lplu_state, |
1724 | .write_phy_reg = e1000e_write_phy_reg_bm2, | 1767 | .write_reg = e1000e_write_phy_reg_bm2, |
1725 | .cfg_on_link_up = NULL, | 1768 | .cfg_on_link_up = NULL, |
1726 | }; | 1769 | }; |
1727 | 1770 | ||
1728 | static struct e1000_nvm_operations e82571_nvm_ops = { | 1771 | static struct e1000_nvm_operations e82571_nvm_ops = { |
1729 | .acquire_nvm = e1000_acquire_nvm_82571, | 1772 | .acquire = e1000_acquire_nvm_82571, |
1730 | .read_nvm = e1000e_read_nvm_eerd, | 1773 | .read = e1000e_read_nvm_eerd, |
1731 | .release_nvm = e1000_release_nvm_82571, | 1774 | .release = e1000_release_nvm_82571, |
1732 | .update_nvm = e1000_update_nvm_checksum_82571, | 1775 | .update = e1000_update_nvm_checksum_82571, |
1733 | .valid_led_default = e1000_valid_led_default_82571, | 1776 | .valid_led_default = e1000_valid_led_default_82571, |
1734 | .validate_nvm = e1000_validate_nvm_checksum_82571, | 1777 | .validate = e1000_validate_nvm_checksum_82571, |
1735 | .write_nvm = e1000_write_nvm_82571, | 1778 | .write = e1000_write_nvm_82571, |
1736 | }; | 1779 | }; |
1737 | 1780 | ||
1738 | struct e1000_info e1000_82571_info = { | 1781 | struct e1000_info e1000_82571_info = { |
@@ -1747,6 +1790,7 @@ struct e1000_info e1000_82571_info = { | |||
1747 | | FLAG_RESET_OVERWRITES_LAA /* errata */ | 1790 | | FLAG_RESET_OVERWRITES_LAA /* errata */ |
1748 | | FLAG_TARC_SPEED_MODE_BIT /* errata */ | 1791 | | FLAG_TARC_SPEED_MODE_BIT /* errata */ |
1749 | | FLAG_APME_CHECK_PORT_B, | 1792 | | FLAG_APME_CHECK_PORT_B, |
1793 | .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */ | ||
1750 | .pba = 38, | 1794 | .pba = 38, |
1751 | .max_hw_frame_size = DEFAULT_JUMBO, | 1795 | .max_hw_frame_size = DEFAULT_JUMBO, |
1752 | .get_variants = e1000_get_variants_82571, | 1796 | .get_variants = e1000_get_variants_82571, |
@@ -1764,6 +1808,7 @@ struct e1000_info e1000_82572_info = { | |||
1764 | | FLAG_RX_CSUM_ENABLED | 1808 | | FLAG_RX_CSUM_ENABLED |
1765 | | FLAG_HAS_CTRLEXT_ON_LOAD | 1809 | | FLAG_HAS_CTRLEXT_ON_LOAD |
1766 | | FLAG_TARC_SPEED_MODE_BIT, /* errata */ | 1810 | | FLAG_TARC_SPEED_MODE_BIT, /* errata */ |
1811 | .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */ | ||
1767 | .pba = 38, | 1812 | .pba = 38, |
1768 | .max_hw_frame_size = DEFAULT_JUMBO, | 1813 | .max_hw_frame_size = DEFAULT_JUMBO, |
1769 | .get_variants = e1000_get_variants_82571, | 1814 | .get_variants = e1000_get_variants_82571, |
@@ -1775,13 +1820,11 @@ struct e1000_info e1000_82572_info = { | |||
1775 | struct e1000_info e1000_82573_info = { | 1820 | struct e1000_info e1000_82573_info = { |
1776 | .mac = e1000_82573, | 1821 | .mac = e1000_82573, |
1777 | .flags = FLAG_HAS_HW_VLAN_FILTER | 1822 | .flags = FLAG_HAS_HW_VLAN_FILTER |
1778 | | FLAG_HAS_JUMBO_FRAMES | ||
1779 | | FLAG_HAS_WOL | 1823 | | FLAG_HAS_WOL |
1780 | | FLAG_APME_IN_CTRL3 | 1824 | | FLAG_APME_IN_CTRL3 |
1781 | | FLAG_RX_CSUM_ENABLED | 1825 | | FLAG_RX_CSUM_ENABLED |
1782 | | FLAG_HAS_SMART_POWER_DOWN | 1826 | | FLAG_HAS_SMART_POWER_DOWN |
1783 | | FLAG_HAS_AMT | 1827 | | FLAG_HAS_AMT |
1784 | | FLAG_HAS_ERT | ||
1785 | | FLAG_HAS_SWSM_ON_LOAD, | 1828 | | FLAG_HAS_SWSM_ON_LOAD, |
1786 | .pba = 20, | 1829 | .pba = 20, |
1787 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, | 1830 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, |