Lines Matching +full:disable +full:- +full:port +full:- +full:power +full:- +full:control
2 SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
38 * 82571EB Dual Port Gigabit Mezzanine Adapter
39 * 82571EB Quad Port Gigabit Mezzanine Adapter
40 * 82571PT Gigabit PT Quad Port Server ExpressModule
88 * e1000_init_phy_params_82571 - Init PHY func ptrs.
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()
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.
203 struct e1000_nvm_info *nvm = &hw->nvm; 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()
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.
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()
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()
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()
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()
433 hw->dev_spec._82571.smb_counter = 0; in e1000_init_mac_params_82571()
439 * e1000_init_function_pointers_82571 - Init func ptrs.
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
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()
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
537 return -E1000_ERR_PHY; in e1000_get_hw_semaphore_82574()
544 * e1000_put_hw_semaphore_82574 - Release hardware semaphore
563 * e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state
565 * @active: true to enable LPLU, false to disable
590 * e1000_set_d3_lplu_state_82574 - Sets low power link up state for D3
592 * @active: boolean used to enable/disable lplu
594 * The low power link up (lplu) state is set to the power management level D3
596 * is used during Dx states where the power conservation is most important.
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()
619 * e1000_acquire_nvm_82571 - Request for access to the EEPROM
623 * Then for non-82573 hardware, set the EEPROM access request bit and wait
637 switch (hw->mac.type) { in e1000_acquire_nvm_82571()
652 * e1000_release_nvm_82571 - Release exclusive access to EEPROM
666 * e1000_write_nvm_82571 - Write to EEPROM using appropriate interface
672 * For non-82573 silicon, write data to EEPROM at offset using SPI interface.
684 switch (hw->mac.type) { 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
725 if (hw->nvm.type != e1000_nvm_flash_hw) in e1000_update_nvm_checksum_82571()
736 return -E1000_ERR_NVM; 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
775 if (hw->nvm.type == e1000_nvm_flash_hw) in e1000_validate_nvm_checksum_82571()
782 * e1000_write_nvm_eewr_82571 - Write to EEPROM for 82573 silicon
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()
833 * e1000_get_cfg_done_82571 - Poll for configuration done
836 * Reads the management control register for the config done bit to be set.
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
862 * @active: true to enable LPLU, false to disable
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()
892 /* When LPLU is enabled, we should disable SmartSpeed */ 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()
907 * during Dx states where the power conservation is most 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
956 /* Prevent the PCI-E bus from sticking if there is no TLP connection in e1000_reset_hw_82571()
961 DEBUGOUT("PCI-E Master disable polling has failed.\n"); in e1000_reset_hw_82571()
977 switch (hw->mac.type) { in e1000_reset_hw_82571()
993 switch (hw->mac.type) { in e1000_reset_hw_82571()
1006 if (hw->nvm.type == e1000_nvm_flash_hw) { in e1000_reset_hw_82571()
1024 switch (hw->mac.type) { in e1000_reset_hw_82571()
1047 if (hw->mac.type == e1000_82571) { 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
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()
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()
1093 * resetting one port will reload the MAC on the other port. in e1000_init_hw_82571()
1096 rar_count--; in e1000_init_hw_82571()
1101 for (i = 0; i < mac->mta_reg_count; i++) in e1000_init_hw_82571()
1104 /* Setup link and flow control */ 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()
1114 switch (mac->type) { in e1000_init_hw_82571()
1144 * e1000_initialize_hw_bits_82571 - Initialize hardware-dependent bits
1147 * Initializes required hardware-dependent bits needed for normal operation.
1155 /* Transmit Descriptor Control 0 */ in e1000_initialize_hw_bits_82571()
1160 /* Transmit Descriptor Control 1 */ in e1000_initialize_hw_bits_82571()
1165 /* Transmit Arbitration Control 0 */ in e1000_initialize_hw_bits_82571()
1168 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1182 /* Transmit Arbitration Control 1 */ in e1000_initialize_hw_bits_82571()
1184 switch (hw->mac.type) { 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()
1212 /* Extended Device Control */ in e1000_initialize_hw_bits_82571()
1213 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1226 if (hw->mac.type == e1000_82571) { 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()
1242 /* Disable IPv6 extension header parsing because some malformed in e1000_initialize_hw_bits_82571()
1245 if (hw->mac.type <= e1000_82573) { 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()
1277 * e1000_clear_vfta_82571 - Clear VLAN filter table
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()
1326 * e1000_check_mng_mode_82574 - Check manageability is enabled
1329 * Reads the NVM Initialization Control Word 2 and returns true
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
1359 ctrl = hw->mac.ledctl_mode2; in e1000_led_on_82574()
1365 if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == in e1000_led_on_82574()
1375 * e1000_check_phy_82574 - check 82574 phy hung state
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
1413 * Determines which flow control settings to use, then configures flow
1414 * control. Calls the appropriate media-specific link configuration
1424 * the default flow control setting, so we explicitly in e1000_setup_link_82571()
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()
1442 * e1000_setup_copper_link_82571 - Configure copper link settings
1445 * Configures the link for auto-neg or forced speed and duplex. Then we check
1447 * and flow control are called.
1461 switch (hw->phy.type) { in e1000_setup_copper_link_82571()
1470 return -E1000_ERR_PHY; in e1000_setup_copper_link_82571()
1481 * e1000_setup_fiber_serdes_link_82571 - Setup link for fiber/serdes
1484 * Configures collision distance and flow control for fiber and serdes links.
1491 switch (hw->mac.type) { in e1000_setup_fiber_serdes_link_82571()
1511 * e1000_check_for_serdes_link_82571 - Check for link (Serdes)
1531 struct e1000_mac_info *mac = &hw->mac; 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()
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()
1608 (mac->txcw & ~E1000_TXCW_ANE)); in e1000_check_for_serdes_link_82571()
1612 /* Configure Flow Control after link up. */ in e1000_check_for_serdes_link_82571()
1616 DEBUGOUT("Error config flow control\n"); 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()
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()
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()
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
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
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
1738 * @state: enable/disable locally administered address
1740 * Enable/Disable the current locally administered address state.
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()
1756 * incoming packets directed to this port are dropped. 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
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
1827 if (hw->mac.type == e1000_82571) { in e1000_read_mac_addr_82571()
1843 * e1000_power_down_phy_copper_82571 - Remove link during PHY power down
1846 * In the case of a PHY power down to save power, or to turn off link during a
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()
1857 /* If the management interface is not enabled, then power down */ 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()
1865 * e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters