Lines Matching +full:hw +full:- +full:device +full:- +full:address

2   SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
53 static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw);
54 static void e1000_release_nvm_82571(struct e1000_hw *hw);
55 static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
57 static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw);
58 static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw);
59 static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw);
60 static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw,
62 static s32 e1000_reset_hw_82571(struct e1000_hw *hw);
63 static s32 e1000_init_hw_82571(struct e1000_hw *hw);
64 static void e1000_clear_vfta_82571(struct e1000_hw *hw);
65 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
66 static s32 e1000_led_on_82574(struct e1000_hw *hw);
67 static s32 e1000_setup_link_82571(struct e1000_hw *hw);
68 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
69 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw);
70 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
71 static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data);
72 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
73 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
74 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
75 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
76 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
77 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw,
79 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw,
81 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
82 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
84 static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw);
85 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
88 * e1000_init_phy_params_82571 - Init PHY func ptrs.
89 * @hw: pointer to the HW structure
91 static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) in e1000_init_phy_params_82571() argument
93 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82571()
98 if (hw->phy.media_type != e1000_media_type_copper) { in e1000_init_phy_params_82571()
99 phy->type = e1000_phy_none; in e1000_init_phy_params_82571()
103 phy->addr = 1; in e1000_init_phy_params_82571()
104 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; in e1000_init_phy_params_82571()
105 phy->reset_delay_us = 100; in e1000_init_phy_params_82571()
107 phy->ops.check_reset_block = e1000_check_reset_block_generic; in e1000_init_phy_params_82571()
108 phy->ops.reset = e1000_phy_hw_reset_generic; in e1000_init_phy_params_82571()
109 phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82571; in e1000_init_phy_params_82571()
110 phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; in e1000_init_phy_params_82571()
111 phy->ops.power_up = e1000_power_up_phy_copper; in e1000_init_phy_params_82571()
112 phy->ops.power_down = e1000_power_down_phy_copper_82571; in e1000_init_phy_params_82571()
114 switch (hw->mac.type) { in e1000_init_phy_params_82571()
117 phy->type = e1000_phy_igp_2; in e1000_init_phy_params_82571()
118 phy->ops.get_cfg_done = e1000_get_cfg_done_82571; in e1000_init_phy_params_82571()
119 phy->ops.get_info = e1000_get_phy_info_igp; in e1000_init_phy_params_82571()
120 phy->ops.check_polarity = e1000_check_polarity_igp; in e1000_init_phy_params_82571()
121 phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; in e1000_init_phy_params_82571()
122 phy->ops.get_cable_length = e1000_get_cable_length_igp_2; in e1000_init_phy_params_82571()
123 phy->ops.read_reg = e1000_read_phy_reg_igp; in e1000_init_phy_params_82571()
124 phy->ops.write_reg = e1000_write_phy_reg_igp; in e1000_init_phy_params_82571()
125 phy->ops.acquire = e1000_get_hw_semaphore; in e1000_init_phy_params_82571()
126 phy->ops.release = e1000_put_hw_semaphore; in e1000_init_phy_params_82571()
129 phy->type = e1000_phy_m88; in e1000_init_phy_params_82571()
130 phy->ops.get_cfg_done = e1000_get_cfg_done_generic; in e1000_init_phy_params_82571()
131 phy->ops.get_info = e1000_get_phy_info_m88; in e1000_init_phy_params_82571()
132 phy->ops.check_polarity = e1000_check_polarity_m88; in e1000_init_phy_params_82571()
133 phy->ops.commit = e1000_phy_sw_reset_generic; in e1000_init_phy_params_82571()
134 phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; in e1000_init_phy_params_82571()
135 phy->ops.get_cable_length = e1000_get_cable_length_m88; in e1000_init_phy_params_82571()
136 phy->ops.read_reg = e1000_read_phy_reg_m88; in e1000_init_phy_params_82571()
137 phy->ops.write_reg = e1000_write_phy_reg_m88; in e1000_init_phy_params_82571()
138 phy->ops.acquire = e1000_get_hw_semaphore; in e1000_init_phy_params_82571()
139 phy->ops.release = e1000_put_hw_semaphore; in e1000_init_phy_params_82571()
144 phy->type = e1000_phy_bm; in e1000_init_phy_params_82571()
145 phy->ops.get_cfg_done = e1000_get_cfg_done_generic; in e1000_init_phy_params_82571()
146 phy->ops.get_info = e1000_get_phy_info_m88; in e1000_init_phy_params_82571()
147 phy->ops.check_polarity = e1000_check_polarity_m88; in e1000_init_phy_params_82571()
148 phy->ops.commit = e1000_phy_sw_reset_generic; in e1000_init_phy_params_82571()
149 phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; in e1000_init_phy_params_82571()
150 phy->ops.get_cable_length = e1000_get_cable_length_m88; in e1000_init_phy_params_82571()
151 phy->ops.read_reg = e1000_read_phy_reg_bm2; in e1000_init_phy_params_82571()
152 phy->ops.write_reg = e1000_write_phy_reg_bm2; in e1000_init_phy_params_82571()
153 phy->ops.acquire = e1000_get_hw_semaphore_82574; in e1000_init_phy_params_82571()
154 phy->ops.release = e1000_put_hw_semaphore_82574; in e1000_init_phy_params_82571()
155 phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574; in e1000_init_phy_params_82571()
156 phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574; in e1000_init_phy_params_82571()
159 return -E1000_ERR_PHY; in e1000_init_phy_params_82571()
164 ret_val = e1000_get_phy_id_82571(hw); in e1000_init_phy_params_82571()
171 switch (hw->mac.type) { in e1000_init_phy_params_82571()
174 if (phy->id != IGP01E1000_I_PHY_ID) in e1000_init_phy_params_82571()
175 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82571()
178 if (phy->id != M88E1111_I_PHY_ID) in e1000_init_phy_params_82571()
179 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82571()
183 if (phy->id != BME1000_E_PHY_ID_R2) in e1000_init_phy_params_82571()
184 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82571()
187 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82571()
192 DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); in e1000_init_phy_params_82571()
198 * e1000_init_nvm_params_82571 - Init NVM func ptrs.
199 * @hw: pointer to the HW structure
201 static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) in e1000_init_nvm_params_82571() argument
203 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82571()
204 u32 eecd = E1000_READ_REG(hw, E1000_EECD); in e1000_init_nvm_params_82571()
209 nvm->opcode_bits = 8; in e1000_init_nvm_params_82571()
210 nvm->delay_usec = 1; in e1000_init_nvm_params_82571()
211 switch (nvm->override) { in e1000_init_nvm_params_82571()
213 nvm->page_size = 32; in e1000_init_nvm_params_82571()
214 nvm->address_bits = 16; in e1000_init_nvm_params_82571()
217 nvm->page_size = 8; in e1000_init_nvm_params_82571()
218 nvm->address_bits = 8; in e1000_init_nvm_params_82571()
221 nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; in e1000_init_nvm_params_82571()
222 nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; in e1000_init_nvm_params_82571()
226 switch (hw->mac.type) { in e1000_init_nvm_params_82571()
231 nvm->type = e1000_nvm_flash_hw; in e1000_init_nvm_params_82571()
232 nvm->word_size = 2048; in e1000_init_nvm_params_82571()
237 E1000_WRITE_REG(hw, E1000_EECD, eecd); in e1000_init_nvm_params_82571()
242 nvm->type = e1000_nvm_eeprom_spi; in e1000_init_nvm_params_82571()
245 /* Added to a constant, "size" becomes the left-shift value in e1000_init_nvm_params_82571()
253 nvm->word_size = 1 << size; in e1000_init_nvm_params_82571()
258 switch (hw->mac.type) { in e1000_init_nvm_params_82571()
261 nvm->ops.acquire = e1000_get_hw_semaphore_82574; in e1000_init_nvm_params_82571()
262 nvm->ops.release = e1000_put_hw_semaphore_82574; in e1000_init_nvm_params_82571()
265 nvm->ops.acquire = e1000_acquire_nvm_82571; in e1000_init_nvm_params_82571()
266 nvm->ops.release = e1000_release_nvm_82571; in e1000_init_nvm_params_82571()
269 nvm->ops.read = e1000_read_nvm_eerd; in e1000_init_nvm_params_82571()
270 nvm->ops.update = e1000_update_nvm_checksum_82571; in e1000_init_nvm_params_82571()
271 nvm->ops.validate = e1000_validate_nvm_checksum_82571; in e1000_init_nvm_params_82571()
272 nvm->ops.valid_led_default = e1000_valid_led_default_82571; in e1000_init_nvm_params_82571()
273 nvm->ops.write = e1000_write_nvm_82571; in e1000_init_nvm_params_82571()
279 * e1000_init_mac_params_82571 - Init MAC func ptrs.
280 * @hw: pointer to the HW structure
282 static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) in e1000_init_mac_params_82571() argument
284 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82571()
291 /* Set media type and media-dependent function pointers */ in e1000_init_mac_params_82571()
292 switch (hw->device_id) { in e1000_init_mac_params_82571()
296 hw->phy.media_type = e1000_media_type_fiber; in e1000_init_mac_params_82571()
297 mac->ops.setup_physical_interface = in e1000_init_mac_params_82571()
299 mac->ops.check_for_link = e1000_check_for_fiber_link_generic; in e1000_init_mac_params_82571()
300 mac->ops.get_link_up_info = in e1000_init_mac_params_82571()
307 hw->phy.media_type = e1000_media_type_internal_serdes; in e1000_init_mac_params_82571()
308 mac->ops.setup_physical_interface = in e1000_init_mac_params_82571()
310 mac->ops.check_for_link = e1000_check_for_serdes_link_82571; in e1000_init_mac_params_82571()
311 mac->ops.get_link_up_info = in e1000_init_mac_params_82571()
315 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82571()
316 mac->ops.setup_physical_interface = in e1000_init_mac_params_82571()
318 mac->ops.check_for_link = e1000_check_for_copper_link_generic; in e1000_init_mac_params_82571()
319 mac->ops.get_link_up_info = in e1000_init_mac_params_82571()
325 mac->mta_reg_count = 128; in e1000_init_mac_params_82571()
327 mac->rar_entry_count = E1000_RAR_ENTRIES; in e1000_init_mac_params_82571()
329 mac->asf_firmware_present = true; in e1000_init_mac_params_82571()
331 mac->adaptive_ifs = true; in e1000_init_mac_params_82571()
336 mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic; in e1000_init_mac_params_82571()
338 mac->ops.reset_hw = e1000_reset_hw_82571; in e1000_init_mac_params_82571()
339 /* hw initialization */ in e1000_init_mac_params_82571()
340 mac->ops.init_hw = e1000_init_hw_82571; in e1000_init_mac_params_82571()
342 mac->ops.setup_link = e1000_setup_link_82571; in e1000_init_mac_params_82571()
343 /* multicast address update */ in e1000_init_mac_params_82571()
344 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; in e1000_init_mac_params_82571()
346 mac->ops.write_vfta = e1000_write_vfta_generic; in e1000_init_mac_params_82571()
348 mac->ops.clear_vfta = e1000_clear_vfta_82571; in e1000_init_mac_params_82571()
349 /* read mac address */ in e1000_init_mac_params_82571()
350 mac->ops.read_mac_addr = e1000_read_mac_addr_82571; in e1000_init_mac_params_82571()
352 mac->ops.id_led_init = e1000_id_led_init_generic; in e1000_init_mac_params_82571()
354 mac->ops.setup_led = e1000_setup_led_generic; in e1000_init_mac_params_82571()
356 mac->ops.cleanup_led = e1000_cleanup_led_generic; in e1000_init_mac_params_82571()
358 mac->ops.led_off = e1000_led_off_generic; in e1000_init_mac_params_82571()
360 mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82571; in e1000_init_mac_params_82571()
362 /* MAC-specific function pointers */ in e1000_init_mac_params_82571()
363 switch (hw->mac.type) { in e1000_init_mac_params_82571()
365 mac->ops.set_lan_id = e1000_set_lan_id_single_port; in e1000_init_mac_params_82571()
366 mac->ops.check_mng_mode = e1000_check_mng_mode_generic; in e1000_init_mac_params_82571()
367 mac->ops.led_on = e1000_led_on_generic; in e1000_init_mac_params_82571()
368 mac->ops.blink_led = e1000_blink_led_generic; in e1000_init_mac_params_82571()
371 mac->has_fwsm = true; in e1000_init_mac_params_82571()
375 mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & in e1000_init_mac_params_82571()
380 mac->ops.set_lan_id = e1000_set_lan_id_single_port; in e1000_init_mac_params_82571()
381 mac->ops.check_mng_mode = e1000_check_mng_mode_82574; in e1000_init_mac_params_82571()
382 mac->ops.led_on = e1000_led_on_82574; in e1000_init_mac_params_82571()
385 mac->ops.check_mng_mode = e1000_check_mng_mode_generic; in e1000_init_mac_params_82571()
386 mac->ops.led_on = e1000_led_on_generic; in e1000_init_mac_params_82571()
387 mac->ops.blink_led = e1000_blink_led_generic; in e1000_init_mac_params_82571()
390 mac->has_fwsm = true; in e1000_init_mac_params_82571()
394 /* Ensure that the inter-port SWSM.SMBI lock bit is clear before in e1000_init_mac_params_82571()
395 * first NVM or PHY access. This should be done for single-port in e1000_init_mac_params_82571()
396 * devices, and for one port only on dual-port devices so that in e1000_init_mac_params_82571()
398 * inter-port accesses to the PHY & NVM. in e1000_init_mac_params_82571()
400 switch (hw->mac.type) { in e1000_init_mac_params_82571()
403 swsm2 = E1000_READ_REG(hw, E1000_SWSM2); in e1000_init_mac_params_82571()
407 E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | in e1000_init_mac_params_82571()
421 swsm = E1000_READ_REG(hw, E1000_SWSM); in e1000_init_mac_params_82571()
429 E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); in e1000_init_mac_params_82571()
432 /* Initialze device specific counter of SMBI acquisition timeouts. */ in e1000_init_mac_params_82571()
433 hw->dev_spec._82571.smb_counter = 0; in e1000_init_mac_params_82571()
439 * e1000_init_function_pointers_82571 - Init func ptrs.
440 * @hw: pointer to the HW structure
444 void e1000_init_function_pointers_82571(struct e1000_hw *hw) in e1000_init_function_pointers_82571() argument
448 hw->mac.ops.init_params = e1000_init_mac_params_82571; in e1000_init_function_pointers_82571()
449 hw->nvm.ops.init_params = e1000_init_nvm_params_82571; in e1000_init_function_pointers_82571()
450 hw->phy.ops.init_params = e1000_init_phy_params_82571; in e1000_init_function_pointers_82571()
454 * e1000_get_phy_id_82571 - Retrieve the PHY ID and revision
455 * @hw: pointer to the HW structure
460 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) in e1000_get_phy_id_82571() argument
462 struct e1000_phy_info *phy = &hw->phy; in e1000_get_phy_id_82571()
468 switch (hw->mac.type) { in e1000_get_phy_id_82571()
476 phy->id = IGP01E1000_I_PHY_ID; in e1000_get_phy_id_82571()
479 return e1000_get_phy_id(hw); in e1000_get_phy_id_82571()
483 ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); in e1000_get_phy_id_82571()
487 phy->id = (u32)(phy_id << 16); in e1000_get_phy_id_82571()
489 ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); in e1000_get_phy_id_82571()
493 phy->id |= (u32)(phy_id); in e1000_get_phy_id_82571()
494 phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); in e1000_get_phy_id_82571()
497 return -E1000_ERR_PHY; in e1000_get_phy_id_82571()
505 * e1000_get_hw_semaphore_82574 - Acquire hardware semaphore
506 * @hw: pointer to the HW structure
508 * Acquire the HW semaphore during reset.
512 e1000_get_hw_semaphore_82574(struct e1000_hw *hw) in e1000_get_hw_semaphore_82574() argument
519 ASSERT_CTX_LOCK_HELD(hw); in e1000_get_hw_semaphore_82574()
520 extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); in e1000_get_hw_semaphore_82574()
523 E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); in e1000_get_hw_semaphore_82574()
524 extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); in e1000_get_hw_semaphore_82574()
535 e1000_put_hw_semaphore_82574(hw); in e1000_get_hw_semaphore_82574()
537 return -E1000_ERR_PHY; in e1000_get_hw_semaphore_82574()
544 * e1000_put_hw_semaphore_82574 - Release hardware semaphore
545 * @hw: pointer to the HW structure
551 e1000_put_hw_semaphore_82574(struct e1000_hw *hw) in e1000_put_hw_semaphore_82574() argument
557 extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); in e1000_put_hw_semaphore_82574()
559 E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); in e1000_put_hw_semaphore_82574()
563 * e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state
564 * @hw: pointer to the HW structure
569 * device autonegotiation advertisement meets standards of
574 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) in e1000_set_d0_lplu_state_82574() argument
576 u32 data = E1000_READ_REG(hw, E1000_POEMB); in e1000_set_d0_lplu_state_82574()
585 E1000_WRITE_REG(hw, E1000_POEMB, data); in e1000_set_d0_lplu_state_82574()
590 * e1000_set_d3_lplu_state_82574 - Sets low power link up state for D3
591 * @hw: pointer to the HW structure
600 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active) in e1000_set_d3_lplu_state_82574() argument
602 u32 data = E1000_READ_REG(hw, E1000_POEMB); in e1000_set_d3_lplu_state_82574()
608 } else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || in e1000_set_d3_lplu_state_82574()
609 (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) || in e1000_set_d3_lplu_state_82574()
610 (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) { in e1000_set_d3_lplu_state_82574()
614 E1000_WRITE_REG(hw, E1000_POEMB, data); in e1000_set_d3_lplu_state_82574()
619 * e1000_acquire_nvm_82571 - Request for access to the EEPROM
620 * @hw: pointer to the HW structure
623 * Then for non-82573 hardware, set the EEPROM access request bit and wait
627 static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw) in e1000_acquire_nvm_82571() argument
633 ret_val = e1000_get_hw_semaphore(hw); in e1000_acquire_nvm_82571()
637 switch (hw->mac.type) { in e1000_acquire_nvm_82571()
641 ret_val = e1000_acquire_nvm_generic(hw); in e1000_acquire_nvm_82571()
646 e1000_put_hw_semaphore(hw); in e1000_acquire_nvm_82571()
652 * e1000_release_nvm_82571 - Release exclusive access to EEPROM
653 * @hw: pointer to the HW structure
657 static void e1000_release_nvm_82571(struct e1000_hw *hw) in e1000_release_nvm_82571() argument
661 e1000_release_nvm_generic(hw); in e1000_release_nvm_82571()
662 e1000_put_hw_semaphore(hw); in e1000_release_nvm_82571()
666 * e1000_write_nvm_82571 - Write to EEPROM using appropriate interface
667 * @hw: pointer to the HW structure
672 * For non-82573 silicon, write data to EEPROM at offset using SPI interface.
677 static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, in e1000_write_nvm_82571() argument
684 switch (hw->mac.type) { in e1000_write_nvm_82571()
688 ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data); in e1000_write_nvm_82571()
692 ret_val = e1000_write_nvm_spi(hw, offset, words, data); in e1000_write_nvm_82571()
695 ret_val = -E1000_ERR_NVM; in e1000_write_nvm_82571()
703 * e1000_update_nvm_checksum_82571 - Update EEPROM checksum
704 * @hw: pointer to the HW structure
710 static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) in e1000_update_nvm_checksum_82571() argument
718 ret_val = e1000_update_nvm_checksum_generic(hw); in e1000_update_nvm_checksum_82571()
725 if (hw->nvm.type != e1000_nvm_flash_hw) in e1000_update_nvm_checksum_82571()
731 if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) in e1000_update_nvm_checksum_82571()
736 return -E1000_ERR_NVM; in e1000_update_nvm_checksum_82571()
739 if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) { in e1000_update_nvm_checksum_82571()
743 E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE); in e1000_update_nvm_checksum_82571()
744 E1000_WRITE_FLUSH(hw); in e1000_update_nvm_checksum_82571()
745 E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET); in e1000_update_nvm_checksum_82571()
749 eecd = E1000_READ_REG(hw, E1000_EECD) | E1000_EECD_FLUPD; in e1000_update_nvm_checksum_82571()
750 E1000_WRITE_REG(hw, E1000_EECD, eecd); in e1000_update_nvm_checksum_82571()
754 if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) in e1000_update_nvm_checksum_82571()
759 return -E1000_ERR_NVM; in e1000_update_nvm_checksum_82571()
765 * e1000_validate_nvm_checksum_82571 - Validate EEPROM checksum
766 * @hw: pointer to the HW structure
771 static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw) in e1000_validate_nvm_checksum_82571() argument
775 if (hw->nvm.type == e1000_nvm_flash_hw) in e1000_validate_nvm_checksum_82571()
776 e1000_fix_nvm_checksum_82571(hw); in e1000_validate_nvm_checksum_82571()
778 return e1000_validate_nvm_checksum_generic(hw); in e1000_validate_nvm_checksum_82571()
782 * e1000_write_nvm_eewr_82571 - Write to EEPROM for 82573 silicon
783 * @hw: pointer to the HW structure
795 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, in e1000_write_nvm_eewr_82571() argument
798 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_write_nvm_eewr_82571()
807 if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || in e1000_write_nvm_eewr_82571()
810 return -E1000_ERR_NVM; in e1000_write_nvm_eewr_82571()
818 ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE); in e1000_write_nvm_eewr_82571()
822 E1000_WRITE_REG(hw, E1000_EEWR, eewr); in e1000_write_nvm_eewr_82571()
824 ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE); in e1000_write_nvm_eewr_82571()
833 * e1000_get_cfg_done_82571 - Poll for configuration done
834 * @hw: pointer to the HW structure
838 static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) in e1000_get_cfg_done_82571() argument
845 if (E1000_READ_REG(hw, E1000_EEMNGCTL) & in e1000_get_cfg_done_82571()
849 timeout--; in e1000_get_cfg_done_82571()
853 return -E1000_ERR_RESET; in e1000_get_cfg_done_82571()
860 * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state
861 * @hw: pointer to the HW structure
866 * activated unless the device autonegotiation advertisement meets standards
870 static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) in e1000_set_d0_lplu_state_82571() argument
872 struct e1000_phy_info *phy = &hw->phy; in e1000_set_d0_lplu_state_82571()
878 if (!(phy->ops.read_reg)) in e1000_set_d0_lplu_state_82571()
881 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); in e1000_set_d0_lplu_state_82571()
887 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in e1000_set_d0_lplu_state_82571()
893 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
898 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
904 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in e1000_set_d0_lplu_state_82571()
911 if (phy->smart_speed == e1000_smart_speed_on) { in e1000_set_d0_lplu_state_82571()
912 ret_val = phy->ops.read_reg(hw, in e1000_set_d0_lplu_state_82571()
919 ret_val = phy->ops.write_reg(hw, in e1000_set_d0_lplu_state_82571()
924 } else if (phy->smart_speed == e1000_smart_speed_off) { in e1000_set_d0_lplu_state_82571()
925 ret_val = phy->ops.read_reg(hw, in e1000_set_d0_lplu_state_82571()
932 ret_val = phy->ops.write_reg(hw, in e1000_set_d0_lplu_state_82571()
944 * e1000_reset_hw_82571 - Reset hardware
945 * @hw: pointer to the HW structure
949 static s32 e1000_reset_hw_82571(struct e1000_hw *hw) in e1000_reset_hw_82571() argument
956 /* Prevent the PCI-E bus from sticking if there is no TLP connection in e1000_reset_hw_82571()
959 ret_val = e1000_disable_pcie_master_generic(hw); in e1000_reset_hw_82571()
961 DEBUGOUT("PCI-E Master disable polling has failed.\n"); in e1000_reset_hw_82571()
964 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); in e1000_reset_hw_82571()
966 E1000_WRITE_REG(hw, E1000_RCTL, 0); in e1000_reset_hw_82571()
967 tctl = E1000_READ_REG(hw, E1000_TCTL); in e1000_reset_hw_82571()
969 E1000_WRITE_REG(hw, E1000_TCTL, tctl); in e1000_reset_hw_82571()
970 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82571()
977 switch (hw->mac.type) { in e1000_reset_hw_82571()
981 ret_val = e1000_get_hw_semaphore_82574(hw); in e1000_reset_hw_82571()
987 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_reset_hw_82571()
990 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82571()
993 switch (hw->mac.type) { in e1000_reset_hw_82571()
997 /* Release mutex only if the hw semaphore is acquired */ in e1000_reset_hw_82571()
999 e1000_put_hw_semaphore_82574(hw); in e1000_reset_hw_82571()
1006 if (hw->nvm.type == e1000_nvm_flash_hw) { in e1000_reset_hw_82571()
1008 ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); in e1000_reset_hw_82571()
1010 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); in e1000_reset_hw_82571()
1011 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82571()
1014 ret_val = e1000_get_auto_rd_done_generic(hw); in e1000_reset_hw_82571()
1024 switch (hw->mac.type) { in e1000_reset_hw_82571()
1030 eecd = E1000_READ_REG(hw, E1000_EECD); in e1000_reset_hw_82571()
1032 E1000_WRITE_REG(hw, E1000_EECD, eecd); in e1000_reset_hw_82571()
1044 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); in e1000_reset_hw_82571()
1045 E1000_READ_REG(hw, E1000_ICR); in e1000_reset_hw_82571()
1047 if (hw->mac.type == e1000_82571) { in e1000_reset_hw_82571()
1048 /* Install any alternate MAC address into RAR0 */ in e1000_reset_hw_82571()
1049 ret_val = e1000_check_alt_mac_addr_generic(hw); in e1000_reset_hw_82571()
1053 e1000_set_laa_state_82571(hw, true); in e1000_reset_hw_82571()
1057 if (hw->phy.media_type == e1000_media_type_internal_serdes) in e1000_reset_hw_82571()
1058 hw->mac.serdes_link_state = e1000_serdes_link_down; in e1000_reset_hw_82571()
1064 * e1000_init_hw_82571 - Initialize hardware
1065 * @hw: pointer to the HW structure
1069 static s32 e1000_init_hw_82571(struct e1000_hw *hw) in e1000_init_hw_82571() argument
1071 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82571()
1074 u16 i, rar_count = mac->rar_entry_count; in e1000_init_hw_82571()
1078 e1000_initialize_hw_bits_82571(hw); in e1000_init_hw_82571()
1081 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_82571()
1088 mac->ops.clear_vfta(hw); in e1000_init_hw_82571()
1090 /* Setup the receive address. in e1000_init_hw_82571()
1091 * If, however, a locally administered address was assigned to the in e1000_init_hw_82571()
1095 if (e1000_get_laa_state_82571(hw)) in e1000_init_hw_82571()
1096 rar_count--; in e1000_init_hw_82571()
1097 e1000_init_rx_addrs_generic(hw, rar_count); in e1000_init_hw_82571()
1101 for (i = 0; i < mac->mta_reg_count; i++) in e1000_init_hw_82571()
1102 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); in e1000_init_hw_82571()
1105 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82571()
1107 /* Set the transmit descriptor write-back policy */ in e1000_init_hw_82571()
1108 reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0)); in e1000_init_hw_82571()
1111 E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data); in e1000_init_hw_82571()
1114 switch (mac->type) { in e1000_init_hw_82571()
1116 e1000_enable_tx_pkt_filtering_generic(hw); in e1000_init_hw_82571()
1120 reg_data = E1000_READ_REG(hw, E1000_GCR); in e1000_init_hw_82571()
1122 E1000_WRITE_REG(hw, E1000_GCR, reg_data); in e1000_init_hw_82571()
1125 reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); in e1000_init_hw_82571()
1129 E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); in e1000_init_hw_82571()
1138 e1000_clear_hw_cntrs_82571(hw); in e1000_init_hw_82571()
1144 * e1000_initialize_hw_bits_82571 - Initialize hardware-dependent bits
1145 * @hw: pointer to the HW structure
1147 * Initializes required hardware-dependent bits needed for normal operation.
1149 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) in e1000_initialize_hw_bits_82571() argument
1156 reg = E1000_READ_REG(hw, E1000_TXDCTL(0)); in e1000_initialize_hw_bits_82571()
1158 E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg); in e1000_initialize_hw_bits_82571()
1161 reg = E1000_READ_REG(hw, E1000_TXDCTL(1)); in e1000_initialize_hw_bits_82571()
1163 E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg); in e1000_initialize_hw_bits_82571()
1166 reg = E1000_READ_REG(hw, E1000_TARC(0)); in e1000_initialize_hw_bits_82571()
1168 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1180 E1000_WRITE_REG(hw, E1000_TARC(0), reg); in e1000_initialize_hw_bits_82571()
1183 reg = E1000_READ_REG(hw, E1000_TARC(1)); in e1000_initialize_hw_bits_82571()
1184 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1189 if (E1000_READ_REG(hw, E1000_TCTL) & E1000_TCTL_MULR) in e1000_initialize_hw_bits_82571()
1193 E1000_WRITE_REG(hw, E1000_TARC(1), reg); in e1000_initialize_hw_bits_82571()
1199 /* Device Control */ in e1000_initialize_hw_bits_82571()
1200 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1204 reg = E1000_READ_REG(hw, E1000_CTRL); in e1000_initialize_hw_bits_82571()
1206 E1000_WRITE_REG(hw, E1000_CTRL, reg); in e1000_initialize_hw_bits_82571()
1212 /* Extended Device Control */ in e1000_initialize_hw_bits_82571()
1213 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1217 reg = E1000_READ_REG(hw, E1000_CTRL_EXT); in e1000_initialize_hw_bits_82571()
1220 E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); in e1000_initialize_hw_bits_82571()
1226 if (hw->mac.type == e1000_82571) { in e1000_initialize_hw_bits_82571()
1227 reg = E1000_READ_REG(hw, E1000_PBA_ECC); in e1000_initialize_hw_bits_82571()
1229 E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); in e1000_initialize_hw_bits_82571()
1235 if ((hw->mac.type == e1000_82571) || in e1000_initialize_hw_bits_82571()
1236 (hw->mac.type == e1000_82572)) { in e1000_initialize_hw_bits_82571()
1237 reg = E1000_READ_REG(hw, E1000_CTRL_EXT); in e1000_initialize_hw_bits_82571()
1239 E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); in e1000_initialize_hw_bits_82571()
1245 if (hw->mac.type <= e1000_82573) { in e1000_initialize_hw_bits_82571()
1246 reg = E1000_READ_REG(hw, E1000_RFCTL); in e1000_initialize_hw_bits_82571()
1248 E1000_WRITE_REG(hw, E1000_RFCTL, reg); in e1000_initialize_hw_bits_82571()
1251 /* PCI-Ex Control Registers */ in e1000_initialize_hw_bits_82571()
1252 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1255 reg = E1000_READ_REG(hw, E1000_GCR); in e1000_initialize_hw_bits_82571()
1257 E1000_WRITE_REG(hw, E1000_GCR, reg); in e1000_initialize_hw_bits_82571()
1265 reg = E1000_READ_REG(hw, E1000_GCR2); in e1000_initialize_hw_bits_82571()
1267 E1000_WRITE_REG(hw, E1000_GCR2, reg); in e1000_initialize_hw_bits_82571()
1277 * e1000_clear_vfta_82571 - Clear VLAN filter table
1278 * @hw: pointer to the HW structure
1283 static void e1000_clear_vfta_82571(struct e1000_hw *hw) in e1000_clear_vfta_82571() argument
1292 switch (hw->mac.type) { in e1000_clear_vfta_82571()
1296 if (hw->mng_cookie.vlan_id != 0) { in e1000_clear_vfta_82571()
1297 /* The VFTA is a 4096b bit-field, each identifying in e1000_clear_vfta_82571()
1303 vfta_offset = (hw->mng_cookie.vlan_id >> in e1000_clear_vfta_82571()
1307 1 << (hw->mng_cookie.vlan_id & in e1000_clear_vfta_82571()
1320 E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value); in e1000_clear_vfta_82571()
1321 E1000_WRITE_FLUSH(hw); in e1000_clear_vfta_82571()
1326 * e1000_check_mng_mode_82574 - Check manageability is enabled
1327 * @hw: pointer to the HW structure
1332 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) in e1000_check_mng_mode_82574() argument
1339 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data); in e1000_check_mng_mode_82574()
1347 * e1000_led_on_82574 - Turn LED on
1348 * @hw: pointer to the HW structure
1352 static s32 e1000_led_on_82574(struct e1000_hw *hw) in e1000_led_on_82574() argument
1359 ctrl = hw->mac.ledctl_mode2; in e1000_led_on_82574()
1360 if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { in e1000_led_on_82574()
1365 if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == in e1000_led_on_82574()
1369 E1000_WRITE_REG(hw, E1000_LEDCTL, ctrl); in e1000_led_on_82574()
1375 * e1000_check_phy_82574 - check 82574 phy hung state
1376 * @hw: pointer to the HW structure
1380 bool e1000_check_phy_82574(struct e1000_hw *hw) in e1000_check_phy_82574() argument
1388 /* Read PHY Receive Error counter first, if its is max - all F's then in e1000_check_phy_82574()
1391 ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, in e1000_check_phy_82574()
1396 ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, in e1000_check_phy_82574()
1410 * e1000_setup_link_82571 - Setup flow control and link settings
1411 * @hw: pointer to the HW structure
1414 * control. Calls the appropriate media-specific link configuration
1419 static s32 e1000_setup_link_82571(struct e1000_hw *hw) in e1000_setup_link_82571() argument
1427 switch (hw->mac.type) { in e1000_setup_link_82571()
1431 if (hw->fc.requested_mode == e1000_fc_default) in e1000_setup_link_82571()
1432 hw->fc.requested_mode = e1000_fc_full; in e1000_setup_link_82571()
1438 return e1000_setup_link_generic(hw); in e1000_setup_link_82571()
1442 * e1000_setup_copper_link_82571 - Configure copper link settings
1443 * @hw: pointer to the HW structure
1445 * Configures the link for auto-neg or forced speed and duplex. Then we check
1449 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) in e1000_setup_copper_link_82571() argument
1456 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_setup_copper_link_82571()
1459 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_copper_link_82571()
1461 switch (hw->phy.type) { in e1000_setup_copper_link_82571()
1464 ret_val = e1000_copper_link_setup_m88(hw); in e1000_setup_copper_link_82571()
1467 ret_val = e1000_copper_link_setup_igp(hw); in e1000_setup_copper_link_82571()
1470 return -E1000_ERR_PHY; in e1000_setup_copper_link_82571()
1477 return e1000_setup_copper_link_generic(hw); in e1000_setup_copper_link_82571()
1481 * e1000_setup_fiber_serdes_link_82571 - Setup link for fiber/serdes
1482 * @hw: pointer to the HW structure
1487 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw) in e1000_setup_fiber_serdes_link_82571() argument
1491 switch (hw->mac.type) { in e1000_setup_fiber_serdes_link_82571()
1500 E1000_WRITE_REG(hw, E1000_SCTL, in e1000_setup_fiber_serdes_link_82571()
1507 return e1000_setup_fiber_serdes_link_generic(hw); in e1000_setup_fiber_serdes_link_82571()
1511 * e1000_check_for_serdes_link_82571 - Check for link (Serdes)
1512 * @hw: pointer to the HW structure
1529 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) in e1000_check_for_serdes_link_82571() argument
1531 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_serdes_link_82571()
1541 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_check_for_serdes_link_82571()
1542 status = E1000_READ_REG(hw, E1000_STATUS); in e1000_check_for_serdes_link_82571()
1543 E1000_READ_REG(hw, E1000_RXCW); in e1000_check_for_serdes_link_82571()
1546 rxcw = E1000_READ_REG(hw, E1000_RXCW); in e1000_check_for_serdes_link_82571()
1550 switch (mac->serdes_link_state) { in e1000_check_for_serdes_link_82571()
1556 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1558 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1559 DEBUGOUT("AN_UP -> AN_PROG\n"); in e1000_check_for_serdes_link_82571()
1561 mac->serdes_has_link = true; in e1000_check_for_serdes_link_82571()
1566 /* If we are receiving /C/ ordered sets, re-enable in e1000_check_for_serdes_link_82571()
1567 * auto-negotiation in the TXCW register and disable in e1000_check_for_serdes_link_82571()
1568 * forced link in the Device Control register in an in e1000_check_for_serdes_link_82571()
1569 * attempt to auto-negotiate with our link partner. in e1000_check_for_serdes_link_82571()
1573 E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); in e1000_check_for_serdes_link_82571()
1574 E1000_WRITE_REG(hw, E1000_CTRL, in e1000_check_for_serdes_link_82571()
1576 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1578 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1579 DEBUGOUT("FORCED_UP -> AN_PROG\n"); in e1000_check_for_serdes_link_82571()
1581 mac->serdes_has_link = true; in e1000_check_for_serdes_link_82571()
1592 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1594 DEBUGOUT("AN_PROG -> AN_UP\n"); in e1000_check_for_serdes_link_82571()
1595 mac->serdes_has_link = true; in e1000_check_for_serdes_link_82571()
1598 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1600 DEBUGOUT("AN_PROG -> DOWN\n"); in e1000_check_for_serdes_link_82571()
1607 E1000_WRITE_REG(hw, E1000_TXCW, in e1000_check_for_serdes_link_82571()
1608 (mac->txcw & ~E1000_TXCW_ANE)); in e1000_check_for_serdes_link_82571()
1610 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_check_for_serdes_link_82571()
1614 e1000_config_fc_after_link_up_generic(hw); in e1000_check_for_serdes_link_82571()
1619 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1621 mac->serdes_has_link = true; in e1000_check_for_serdes_link_82571()
1622 DEBUGOUT("AN_PROG -> FORCED_UP\n"); in e1000_check_for_serdes_link_82571()
1632 E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); in e1000_check_for_serdes_link_82571()
1633 E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & in e1000_check_for_serdes_link_82571()
1635 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1637 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1638 DEBUGOUT("DOWN -> AN_PROG\n"); in e1000_check_for_serdes_link_82571()
1643 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1644 mac->serdes_link_state = e1000_serdes_link_down; in e1000_check_for_serdes_link_82571()
1645 DEBUGOUT("ANYSTATE -> DOWN\n"); in e1000_check_for_serdes_link_82571()
1653 rxcw = E1000_READ_REG(hw, E1000_RXCW); in e1000_check_for_serdes_link_82571()
1659 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1660 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1662 DEBUGOUT("ANYSTATE -> DOWN\n"); in e1000_check_for_serdes_link_82571()
1668 txcw = E1000_READ_REG(hw, E1000_TXCW); in e1000_check_for_serdes_link_82571()
1670 E1000_WRITE_REG(hw, E1000_TXCW, txcw); in e1000_check_for_serdes_link_82571()
1671 mac->serdes_link_state = in e1000_check_for_serdes_link_82571()
1673 mac->serdes_has_link = false; in e1000_check_for_serdes_link_82571()
1674 DEBUGOUT("ANYSTATE -> AN_PROG\n"); in e1000_check_for_serdes_link_82571()
1683 * e1000_valid_led_default_82571 - Verify a valid default LED config
1684 * @hw: pointer to the HW structure
1690 static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) in e1000_valid_led_default_82571() argument
1696 ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); in e1000_valid_led_default_82571()
1702 switch (hw->mac.type) { in e1000_valid_led_default_82571()
1720 * e1000_get_laa_state_82571 - Get locally administered address state
1721 * @hw: pointer to the HW structure
1723 * Retrieve and return the current locally administered address state.
1725 bool e1000_get_laa_state_82571(struct e1000_hw *hw) in e1000_get_laa_state_82571() argument
1729 if (hw->mac.type != e1000_82571) in e1000_get_laa_state_82571()
1732 return hw->dev_spec._82571.laa_is_present; in e1000_get_laa_state_82571()
1736 * e1000_set_laa_state_82571 - Set locally administered address state
1737 * @hw: pointer to the HW structure
1738 * @state: enable/disable locally administered address
1740 * Enable/Disable the current locally administered address state.
1742 void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state) in e1000_set_laa_state_82571() argument
1746 if (hw->mac.type != e1000_82571) in e1000_set_laa_state_82571()
1749 hw->dev_spec._82571.laa_is_present = state; in e1000_set_laa_state_82571()
1759 hw->mac.ops.rar_set(hw, hw->mac.addr, in e1000_set_laa_state_82571()
1760 hw->mac.rar_entry_count - 1); in e1000_set_laa_state_82571()
1765 * e1000_fix_nvm_checksum_82571 - Fix EEPROM checksum
1766 * @hw: pointer to the HW structure
1774 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) in e1000_fix_nvm_checksum_82571() argument
1776 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_fix_nvm_checksum_82571()
1782 if (nvm->type != e1000_nvm_flash_hw) in e1000_fix_nvm_checksum_82571()
1786 * 10h-12h. Checksum may need to be fixed. in e1000_fix_nvm_checksum_82571()
1788 ret_val = nvm->ops.read(hw, 0x10, 1, &data); in e1000_fix_nvm_checksum_82571()
1800 ret_val = nvm->ops.read(hw, 0x23, 1, &data); in e1000_fix_nvm_checksum_82571()
1806 ret_val = nvm->ops.write(hw, 0x23, 1, &data); in e1000_fix_nvm_checksum_82571()
1809 ret_val = nvm->ops.update(hw); in e1000_fix_nvm_checksum_82571()
1820 * e1000_read_mac_addr_82571 - Read device MAC address
1821 * @hw: pointer to the HW structure
1823 static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) in e1000_read_mac_addr_82571() argument
1827 if (hw->mac.type == e1000_82571) { in e1000_read_mac_addr_82571()
1830 /* If there's an alternate MAC address place it in RAR0 in e1000_read_mac_addr_82571()
1832 * address. in e1000_read_mac_addr_82571()
1834 ret_val = e1000_check_alt_mac_addr_generic(hw); in e1000_read_mac_addr_82571()
1839 return e1000_read_mac_addr_generic(hw); in e1000_read_mac_addr_82571()
1843 * e1000_power_down_phy_copper_82571 - Remove link during PHY power down
1844 * @hw: pointer to the HW structure
1849 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw) in e1000_power_down_phy_copper_82571() argument
1851 struct e1000_phy_info *phy = &hw->phy; in e1000_power_down_phy_copper_82571()
1852 struct e1000_mac_info *mac = &hw->mac; in e1000_power_down_phy_copper_82571()
1854 if (!phy->ops.check_reset_block) in e1000_power_down_phy_copper_82571()
1858 if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw))) in e1000_power_down_phy_copper_82571()
1859 e1000_power_down_phy_copper(hw); in e1000_power_down_phy_copper_82571()
1865 * e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters
1866 * @hw: pointer to the HW structure
1870 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) in e1000_clear_hw_cntrs_82571() argument
1874 e1000_clear_hw_cntrs_base_generic(hw); in e1000_clear_hw_cntrs_82571()
1876 E1000_READ_REG(hw, E1000_PRC64); in e1000_clear_hw_cntrs_82571()
1877 E1000_READ_REG(hw, E1000_PRC127); in e1000_clear_hw_cntrs_82571()
1878 E1000_READ_REG(hw, E1000_PRC255); in e1000_clear_hw_cntrs_82571()
1879 E1000_READ_REG(hw, E1000_PRC511); in e1000_clear_hw_cntrs_82571()
1880 E1000_READ_REG(hw, E1000_PRC1023); in e1000_clear_hw_cntrs_82571()
1881 E1000_READ_REG(hw, E1000_PRC1522); in e1000_clear_hw_cntrs_82571()
1882 E1000_READ_REG(hw, E1000_PTC64); in e1000_clear_hw_cntrs_82571()
1883 E1000_READ_REG(hw, E1000_PTC127); in e1000_clear_hw_cntrs_82571()
1884 E1000_READ_REG(hw, E1000_PTC255); in e1000_clear_hw_cntrs_82571()
1885 E1000_READ_REG(hw, E1000_PTC511); in e1000_clear_hw_cntrs_82571()
1886 E1000_READ_REG(hw, E1000_PTC1023); in e1000_clear_hw_cntrs_82571()
1887 E1000_READ_REG(hw, E1000_PTC1522); in e1000_clear_hw_cntrs_82571()
1889 E1000_READ_REG(hw, E1000_ALGNERRC); in e1000_clear_hw_cntrs_82571()
1890 E1000_READ_REG(hw, E1000_RXERRC); in e1000_clear_hw_cntrs_82571()
1891 E1000_READ_REG(hw, E1000_TNCRS); in e1000_clear_hw_cntrs_82571()
1892 E1000_READ_REG(hw, E1000_CEXTERR); in e1000_clear_hw_cntrs_82571()
1893 E1000_READ_REG(hw, E1000_TSCTC); in e1000_clear_hw_cntrs_82571()
1894 E1000_READ_REG(hw, E1000_TSCTFC); in e1000_clear_hw_cntrs_82571()
1896 E1000_READ_REG(hw, E1000_MGTPRC); in e1000_clear_hw_cntrs_82571()
1897 E1000_READ_REG(hw, E1000_MGTPDC); in e1000_clear_hw_cntrs_82571()
1898 E1000_READ_REG(hw, E1000_MGTPTC); in e1000_clear_hw_cntrs_82571()
1900 E1000_READ_REG(hw, E1000_IAC); in e1000_clear_hw_cntrs_82571()
1901 E1000_READ_REG(hw, E1000_ICRXOC); in e1000_clear_hw_cntrs_82571()
1903 E1000_READ_REG(hw, E1000_ICRXPTC); in e1000_clear_hw_cntrs_82571()
1904 E1000_READ_REG(hw, E1000_ICRXATC); in e1000_clear_hw_cntrs_82571()
1905 E1000_READ_REG(hw, E1000_ICTXPTC); in e1000_clear_hw_cntrs_82571()
1906 E1000_READ_REG(hw, E1000_ICTXATC); in e1000_clear_hw_cntrs_82571()
1907 E1000_READ_REG(hw, E1000_ICTXQEC); in e1000_clear_hw_cntrs_82571()
1908 E1000_READ_REG(hw, E1000_ICTXQMTC); in e1000_clear_hw_cntrs_82571()
1909 E1000_READ_REG(hw, E1000_ICRXDMTC); in e1000_clear_hw_cntrs_82571()