Lines Matching +full:hw +full:- +full:flow +full:- +full:ctrl
2 SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
46 static s32 e1000_init_phy_params_82543(struct e1000_hw *hw);
47 static s32 e1000_init_nvm_params_82543(struct e1000_hw *hw);
48 static s32 e1000_init_mac_params_82543(struct e1000_hw *hw);
49 static s32 e1000_read_phy_reg_82543(struct e1000_hw *hw, u32 offset,
51 static s32 e1000_write_phy_reg_82543(struct e1000_hw *hw, u32 offset,
53 static s32 e1000_phy_force_speed_duplex_82543(struct e1000_hw *hw);
54 static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw);
55 static s32 e1000_reset_hw_82543(struct e1000_hw *hw);
56 static s32 e1000_init_hw_82543(struct e1000_hw *hw);
57 static s32 e1000_setup_link_82543(struct e1000_hw *hw);
58 static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw);
59 static s32 e1000_setup_fiber_link_82543(struct e1000_hw *hw);
60 static s32 e1000_check_for_copper_link_82543(struct e1000_hw *hw);
61 static s32 e1000_check_for_fiber_link_82543(struct e1000_hw *hw);
62 static s32 e1000_led_on_82543(struct e1000_hw *hw);
63 static s32 e1000_led_off_82543(struct e1000_hw *hw);
64 static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset,
66 static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw);
67 static s32 e1000_config_mac_to_phy_82543(struct e1000_hw *hw);
68 static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw);
69 static void e1000_lower_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl);
70 static s32 e1000_polarity_reversal_workaround_82543(struct e1000_hw *hw);
71 static void e1000_raise_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl);
72 static u16 e1000_shift_in_mdi_bits_82543(struct e1000_hw *hw);
73 static void e1000_shift_out_mdi_bits_82543(struct e1000_hw *hw, u32 data,
75 static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw);
76 static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state);
77 static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw);
81 * e1000_init_phy_params_82543 - Init PHY func ptrs.
82 * @hw: pointer to the HW structure
84 static s32 e1000_init_phy_params_82543(struct e1000_hw *hw) in e1000_init_phy_params_82543() argument
86 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82543()
91 if (hw->phy.media_type != e1000_media_type_copper) { in e1000_init_phy_params_82543()
92 phy->type = e1000_phy_none; in e1000_init_phy_params_82543()
95 phy->ops.power_up = e1000_power_up_phy_copper; in e1000_init_phy_params_82543()
96 phy->ops.power_down = e1000_power_down_phy_copper; in e1000_init_phy_params_82543()
99 phy->addr = 1; in e1000_init_phy_params_82543()
100 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; in e1000_init_phy_params_82543()
101 phy->reset_delay_us = 10000; in e1000_init_phy_params_82543()
102 phy->type = e1000_phy_m88; in e1000_init_phy_params_82543()
105 phy->ops.check_polarity = e1000_check_polarity_m88; in e1000_init_phy_params_82543()
106 phy->ops.commit = e1000_phy_sw_reset_generic; in e1000_init_phy_params_82543()
107 phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82543; in e1000_init_phy_params_82543()
108 phy->ops.get_cable_length = e1000_get_cable_length_m88; in e1000_init_phy_params_82543()
109 phy->ops.get_cfg_done = e1000_get_cfg_done_generic; in e1000_init_phy_params_82543()
110 phy->ops.read_reg = (hw->mac.type == e1000_82543) in e1000_init_phy_params_82543()
113 phy->ops.reset = (hw->mac.type == e1000_82543) in e1000_init_phy_params_82543()
116 phy->ops.write_reg = (hw->mac.type == e1000_82543) in e1000_init_phy_params_82543()
119 phy->ops.get_info = e1000_get_phy_info_m88; in e1000_init_phy_params_82543()
126 if (!e1000_init_phy_disabled_82543(hw)) { in e1000_init_phy_params_82543()
127 ret_val = phy->ops.reset(hw); in e1000_init_phy_params_82543()
135 ret_val = e1000_get_phy_id(hw); in e1000_init_phy_params_82543()
140 switch (hw->mac.type) { in e1000_init_phy_params_82543()
142 if (phy->id != M88E1000_E_PHY_ID) { in e1000_init_phy_params_82543()
143 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82543()
148 if (phy->id != M88E1000_I_PHY_ID) { in e1000_init_phy_params_82543()
149 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82543()
154 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82543()
164 * e1000_init_nvm_params_82543 - Init NVM func ptrs.
165 * @hw: pointer to the HW structure
167 static s32 e1000_init_nvm_params_82543(struct e1000_hw *hw) in e1000_init_nvm_params_82543() argument
169 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82543()
173 nvm->type = e1000_nvm_eeprom_microwire; in e1000_init_nvm_params_82543()
174 nvm->word_size = 64; in e1000_init_nvm_params_82543()
175 nvm->delay_usec = 50; in e1000_init_nvm_params_82543()
176 nvm->address_bits = 6; in e1000_init_nvm_params_82543()
177 nvm->opcode_bits = 3; in e1000_init_nvm_params_82543()
180 nvm->ops.read = e1000_read_nvm_microwire; in e1000_init_nvm_params_82543()
181 nvm->ops.update = e1000_update_nvm_checksum_generic; in e1000_init_nvm_params_82543()
182 nvm->ops.valid_led_default = e1000_valid_led_default_generic; in e1000_init_nvm_params_82543()
183 nvm->ops.validate = e1000_validate_nvm_checksum_generic; in e1000_init_nvm_params_82543()
184 nvm->ops.write = e1000_write_nvm_microwire; in e1000_init_nvm_params_82543()
190 * e1000_init_mac_params_82543 - Init MAC func ptrs.
191 * @hw: pointer to the HW structure
193 static s32 e1000_init_mac_params_82543(struct e1000_hw *hw) in e1000_init_mac_params_82543() argument
195 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82543()
200 switch (hw->device_id) { in e1000_init_mac_params_82543()
203 hw->phy.media_type = e1000_media_type_fiber; in e1000_init_mac_params_82543()
206 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82543()
211 mac->mta_reg_count = 128; in e1000_init_mac_params_82543()
213 mac->rar_entry_count = E1000_RAR_ENTRIES; in e1000_init_mac_params_82543()
218 mac->ops.get_bus_info = e1000_get_bus_info_pci_generic; in e1000_init_mac_params_82543()
220 mac->ops.set_lan_id = e1000_set_lan_id_multi_port_pci; in e1000_init_mac_params_82543()
222 mac->ops.reset_hw = e1000_reset_hw_82543; in e1000_init_mac_params_82543()
223 /* hw initialization */ in e1000_init_mac_params_82543()
224 mac->ops.init_hw = e1000_init_hw_82543; in e1000_init_mac_params_82543()
226 mac->ops.setup_link = e1000_setup_link_82543; in e1000_init_mac_params_82543()
228 mac->ops.setup_physical_interface = in e1000_init_mac_params_82543()
229 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82543()
232 mac->ops.check_for_link = in e1000_init_mac_params_82543()
233 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82543()
237 mac->ops.get_link_up_info = in e1000_init_mac_params_82543()
238 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82543()
242 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; in e1000_init_mac_params_82543()
244 mac->ops.write_vfta = e1000_write_vfta_82543; in e1000_init_mac_params_82543()
246 mac->ops.clear_vfta = e1000_clear_vfta_generic; in e1000_init_mac_params_82543()
248 mac->ops.read_mac_addr = e1000_read_mac_addr_82543; in e1000_init_mac_params_82543()
250 mac->ops.led_on = e1000_led_on_82543; in e1000_init_mac_params_82543()
251 mac->ops.led_off = e1000_led_off_82543; in e1000_init_mac_params_82543()
253 mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82543; in e1000_init_mac_params_82543()
256 if ((hw->mac.type != e1000_82543) || in e1000_init_mac_params_82543()
257 (hw->phy.media_type == e1000_media_type_fiber)) in e1000_init_mac_params_82543()
258 e1000_set_tbi_compatibility_82543(hw, false); in e1000_init_mac_params_82543()
264 * e1000_init_function_pointers_82543 - Init func ptrs.
265 * @hw: pointer to the HW structure
269 void e1000_init_function_pointers_82543(struct e1000_hw *hw) in e1000_init_function_pointers_82543() argument
273 hw->mac.ops.init_params = e1000_init_mac_params_82543; in e1000_init_function_pointers_82543()
274 hw->nvm.ops.init_params = e1000_init_nvm_params_82543; in e1000_init_function_pointers_82543()
275 hw->phy.ops.init_params = e1000_init_phy_params_82543; in e1000_init_function_pointers_82543()
279 * e1000_tbi_compatibility_enabled_82543 - Returns TBI compat status
280 * @hw: pointer to the HW structure
282 * Returns the current status of 10-bit Interface (TBI) compatibility
285 static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw) in e1000_tbi_compatibility_enabled_82543() argument
287 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_tbi_compatibility_enabled_82543()
292 if (hw->mac.type != e1000_82543) { in e1000_tbi_compatibility_enabled_82543()
297 state = !!(dev_spec->tbi_compatibility & TBI_COMPAT_ENABLED); in e1000_tbi_compatibility_enabled_82543()
304 * e1000_set_tbi_compatibility_82543 - Set TBI compatibility
305 * @hw: pointer to the HW structure
308 * Enables or disabled 10-bit Interface (TBI) compatibility.
310 void e1000_set_tbi_compatibility_82543(struct e1000_hw *hw, bool state) in e1000_set_tbi_compatibility_82543() argument
312 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_set_tbi_compatibility_82543()
316 if (hw->mac.type != e1000_82543) { in e1000_set_tbi_compatibility_82543()
322 dev_spec->tbi_compatibility |= TBI_COMPAT_ENABLED; in e1000_set_tbi_compatibility_82543()
324 dev_spec->tbi_compatibility &= ~TBI_COMPAT_ENABLED; in e1000_set_tbi_compatibility_82543()
331 * e1000_tbi_sbp_enabled_82543 - Returns TBI SBP status
332 * @hw: pointer to the HW structure
334 * Returns the current status of 10-bit Interface (TBI) store bad packet (SBP)
337 bool e1000_tbi_sbp_enabled_82543(struct e1000_hw *hw) in e1000_tbi_sbp_enabled_82543() argument
339 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_tbi_sbp_enabled_82543()
344 if (hw->mac.type != e1000_82543) { in e1000_tbi_sbp_enabled_82543()
349 state = !!(dev_spec->tbi_compatibility & TBI_SBP_ENABLED); in e1000_tbi_sbp_enabled_82543()
356 * e1000_set_tbi_sbp_82543 - Set TBI SBP
357 * @hw: pointer to the HW structure
360 * Enables or disabled 10-bit Interface (TBI) store bad packet (SBP).
362 static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state) in e1000_set_tbi_sbp_82543() argument
364 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_set_tbi_sbp_82543()
368 if (state && e1000_tbi_compatibility_enabled_82543(hw)) in e1000_set_tbi_sbp_82543()
369 dev_spec->tbi_compatibility |= TBI_SBP_ENABLED; in e1000_set_tbi_sbp_82543()
371 dev_spec->tbi_compatibility &= ~TBI_SBP_ENABLED; in e1000_set_tbi_sbp_82543()
377 * e1000_init_phy_disabled_82543 - Returns init PHY status
378 * @hw: pointer to the HW structure
383 static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw) in e1000_init_phy_disabled_82543() argument
385 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_init_phy_disabled_82543()
390 if (hw->mac.type != e1000_82543) { in e1000_init_phy_disabled_82543()
395 ret_val = dev_spec->init_phy_disabled; in e1000_init_phy_disabled_82543()
402 * e1000_tbi_adjust_stats_82543 - Adjust stats when TBI enabled
403 * @hw: pointer to the HW structure
411 void e1000_tbi_adjust_stats_82543(struct e1000_hw *hw, in e1000_tbi_adjust_stats_82543() argument
415 if (!(e1000_tbi_sbp_enabled_82543(hw))) in e1000_tbi_adjust_stats_82543()
419 frame_len--; in e1000_tbi_adjust_stats_82543()
426 stats->crcerrs--; in e1000_tbi_adjust_stats_82543()
428 stats->gprc++; in e1000_tbi_adjust_stats_82543()
431 stats->gorc += frame_len; in e1000_tbi_adjust_stats_82543()
440 stats->bprc++; in e1000_tbi_adjust_stats_82543()
443 stats->mprc++; in e1000_tbi_adjust_stats_82543()
449 if ((frame_len == max_frame_size) && (stats->roc > 0)) in e1000_tbi_adjust_stats_82543()
450 stats->roc--; in e1000_tbi_adjust_stats_82543()
457 stats->prc64++; in e1000_tbi_adjust_stats_82543()
458 stats->prc127--; in e1000_tbi_adjust_stats_82543()
460 stats->prc127++; in e1000_tbi_adjust_stats_82543()
461 stats->prc255--; in e1000_tbi_adjust_stats_82543()
463 stats->prc255++; in e1000_tbi_adjust_stats_82543()
464 stats->prc511--; in e1000_tbi_adjust_stats_82543()
466 stats->prc511++; in e1000_tbi_adjust_stats_82543()
467 stats->prc1023--; in e1000_tbi_adjust_stats_82543()
469 stats->prc1023++; in e1000_tbi_adjust_stats_82543()
470 stats->prc1522--; in e1000_tbi_adjust_stats_82543()
472 stats->prc1522++; in e1000_tbi_adjust_stats_82543()
480 * e1000_read_phy_reg_82543 - Read PHY register
481 * @hw: pointer to the HW structure
487 static s32 e1000_read_phy_reg_82543(struct e1000_hw *hw, u32 offset, u16 *data) in e1000_read_phy_reg_82543() argument
496 ret_val = -E1000_ERR_PARAM; in e1000_read_phy_reg_82543()
505 e1000_shift_out_mdi_bits_82543(hw, PHY_PREAMBLE, PHY_PREAMBLE_SIZE); in e1000_read_phy_reg_82543()
519 mdic = (offset | (hw->phy.addr << 5) | in e1000_read_phy_reg_82543()
522 e1000_shift_out_mdi_bits_82543(hw, mdic, 14); in e1000_read_phy_reg_82543()
526 * "shift in" the 16-bit value (18 total bits) of the requested PHY in e1000_read_phy_reg_82543()
529 *data = e1000_shift_in_mdi_bits_82543(hw); in e1000_read_phy_reg_82543()
536 * e1000_write_phy_reg_82543 - Write PHY register
537 * @hw: pointer to the HW structure
543 static s32 e1000_write_phy_reg_82543(struct e1000_hw *hw, u32 offset, u16 data) in e1000_write_phy_reg_82543() argument
552 ret_val = -E1000_ERR_PARAM; in e1000_write_phy_reg_82543()
562 e1000_shift_out_mdi_bits_82543(hw, PHY_PREAMBLE, PHY_PREAMBLE_SIZE); in e1000_write_phy_reg_82543()
571 mdic = ((PHY_TURNAROUND) | (offset << 2) | (hw->phy.addr << 7) | in e1000_write_phy_reg_82543()
576 e1000_shift_out_mdi_bits_82543(hw, mdic, 32); in e1000_write_phy_reg_82543()
583 * e1000_raise_mdi_clk_82543 - Raise Management Data Input clock
584 * @hw: pointer to the HW structure
585 * @ctrl: pointer to the control register
590 static void e1000_raise_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl) in e1000_raise_mdi_clk_82543() argument
596 E1000_WRITE_REG(hw, E1000_CTRL, (*ctrl | E1000_CTRL_MDC)); in e1000_raise_mdi_clk_82543()
597 E1000_WRITE_FLUSH(hw); in e1000_raise_mdi_clk_82543()
602 * e1000_lower_mdi_clk_82543 - Lower Management Data Input clock
603 * @hw: pointer to the HW structure
604 * @ctrl: pointer to the control register
609 static void e1000_lower_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl) in e1000_lower_mdi_clk_82543() argument
615 E1000_WRITE_REG(hw, E1000_CTRL, (*ctrl & ~E1000_CTRL_MDC)); in e1000_lower_mdi_clk_82543()
616 E1000_WRITE_FLUSH(hw); in e1000_lower_mdi_clk_82543()
621 * e1000_shift_out_mdi_bits_82543 - Shift data bits our to the PHY
622 * @hw: pointer to the HW structure
630 static void e1000_shift_out_mdi_bits_82543(struct e1000_hw *hw, u32 data, in e1000_shift_out_mdi_bits_82543() argument
633 u32 ctrl, mask; in e1000_shift_out_mdi_bits_82543() local
642 mask <<= (count - 1); in e1000_shift_out_mdi_bits_82543()
644 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_shift_out_mdi_bits_82543()
647 ctrl |= (E1000_CTRL_MDIO_DIR | E1000_CTRL_MDC_DIR); in e1000_shift_out_mdi_bits_82543()
657 ctrl |= E1000_CTRL_MDIO; in e1000_shift_out_mdi_bits_82543()
659 ctrl &= ~E1000_CTRL_MDIO; in e1000_shift_out_mdi_bits_82543()
661 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_shift_out_mdi_bits_82543()
662 E1000_WRITE_FLUSH(hw); in e1000_shift_out_mdi_bits_82543()
666 e1000_raise_mdi_clk_82543(hw, &ctrl); in e1000_shift_out_mdi_bits_82543()
667 e1000_lower_mdi_clk_82543(hw, &ctrl); in e1000_shift_out_mdi_bits_82543()
674 * e1000_shift_in_mdi_bits_82543 - Shift data bits in from the PHY
675 * @hw: pointer to the HW structure
682 static u16 e1000_shift_in_mdi_bits_82543(struct e1000_hw *hw) in e1000_shift_in_mdi_bits_82543() argument
684 u32 ctrl; in e1000_shift_in_mdi_bits_82543() local
697 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_shift_in_mdi_bits_82543()
703 ctrl &= ~E1000_CTRL_MDIO_DIR; in e1000_shift_in_mdi_bits_82543()
704 ctrl &= ~E1000_CTRL_MDIO; in e1000_shift_in_mdi_bits_82543()
706 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_shift_in_mdi_bits_82543()
707 E1000_WRITE_FLUSH(hw); in e1000_shift_in_mdi_bits_82543()
714 e1000_raise_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
715 e1000_lower_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
719 e1000_raise_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
720 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_shift_in_mdi_bits_82543()
722 if (ctrl & E1000_CTRL_MDIO) in e1000_shift_in_mdi_bits_82543()
724 e1000_lower_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
727 e1000_raise_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
728 e1000_lower_mdi_clk_82543(hw, &ctrl); in e1000_shift_in_mdi_bits_82543()
734 * e1000_phy_force_speed_duplex_82543 - Force speed/duplex for PHY
735 * @hw: pointer to the HW structure
738 * if the PHY is not auto-negotiating and the speed is forced to 10Mbit,
741 static s32 e1000_phy_force_speed_duplex_82543(struct e1000_hw *hw) in e1000_phy_force_speed_duplex_82543() argument
747 ret_val = e1000_phy_force_speed_duplex_m88(hw); in e1000_phy_force_speed_duplex_82543()
751 if (!hw->mac.autoneg && (hw->mac.forced_speed_duplex & in e1000_phy_force_speed_duplex_82543()
753 ret_val = e1000_polarity_reversal_workaround_82543(hw); in e1000_phy_force_speed_duplex_82543()
760 * e1000_polarity_reversal_workaround_82543 - Workaround polarity reversal
761 * @hw: pointer to the HW structure
767 static s32 e1000_polarity_reversal_workaround_82543(struct e1000_hw *hw) in e1000_polarity_reversal_workaround_82543() argument
774 if (!(hw->phy.ops.write_reg)) in e1000_polarity_reversal_workaround_82543()
781 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019); in e1000_polarity_reversal_workaround_82543()
784 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFFF); in e1000_polarity_reversal_workaround_82543()
788 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000); in e1000_polarity_reversal_workaround_82543()
793 * This loop will early-out if the NO link condition has been met. in e1000_polarity_reversal_workaround_82543()
796 for (i = PHY_FORCE_TIME; i > 0; i--) { in e1000_polarity_reversal_workaround_82543()
802 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround_82543()
806 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround_82543()
818 /* Now we will re-enable the transmitter on the PHY */ in e1000_polarity_reversal_workaround_82543()
820 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019); in e1000_polarity_reversal_workaround_82543()
824 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFF0); in e1000_polarity_reversal_workaround_82543()
828 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFF00); in e1000_polarity_reversal_workaround_82543()
832 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0x0000); in e1000_polarity_reversal_workaround_82543()
836 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000); in e1000_polarity_reversal_workaround_82543()
844 ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_TIME, 100000, &link); in e1000_polarity_reversal_workaround_82543()
853 * e1000_phy_hw_reset_82543 - PHY hardware reset
854 * @hw: pointer to the HW structure
861 static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw) in e1000_phy_hw_reset_82543() argument
872 ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); in e1000_phy_hw_reset_82543()
875 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); in e1000_phy_hw_reset_82543()
876 E1000_WRITE_FLUSH(hw); in e1000_phy_hw_reset_82543()
882 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); in e1000_phy_hw_reset_82543()
883 E1000_WRITE_FLUSH(hw); in e1000_phy_hw_reset_82543()
887 if (!(hw->phy.ops.get_cfg_done)) in e1000_phy_hw_reset_82543()
890 ret_val = hw->phy.ops.get_cfg_done(hw); in e1000_phy_hw_reset_82543()
896 * e1000_reset_hw_82543 - Reset hardware
897 * @hw: pointer to the HW structure
901 static s32 e1000_reset_hw_82543(struct e1000_hw *hw) in e1000_reset_hw_82543() argument
903 u32 ctrl; in e1000_reset_hw_82543() local
909 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); in e1000_reset_hw_82543()
911 E1000_WRITE_REG(hw, E1000_RCTL, 0); in e1000_reset_hw_82543()
912 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); in e1000_reset_hw_82543()
913 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82543()
915 e1000_set_tbi_sbp_82543(hw, false); in e1000_reset_hw_82543()
923 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_reset_hw_82543()
926 if (hw->mac.type == e1000_82543) { in e1000_reset_hw_82543()
927 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82543()
930 * The 82544 can't ACK the 64-bit write when issuing the in e1000_reset_hw_82543()
931 * reset, so use IO-mapping as a workaround. in e1000_reset_hw_82543()
933 E1000_WRITE_REG_IO(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82543()
937 * After MAC reset, force reload of NVM to restore power-on in e1000_reset_hw_82543()
940 hw->nvm.ops.reload(hw); in e1000_reset_hw_82543()
944 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); in e1000_reset_hw_82543()
945 E1000_READ_REG(hw, E1000_ICR); in e1000_reset_hw_82543()
951 * e1000_init_hw_82543 - Initialize hardware
952 * @hw: pointer to the HW structure
956 static s32 e1000_init_hw_82543(struct e1000_hw *hw) in e1000_init_hw_82543() argument
958 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82543()
959 struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; in e1000_init_hw_82543()
960 u32 ctrl; in e1000_init_hw_82543() local
967 E1000_WRITE_REG(hw, E1000_VET, 0); in e1000_init_hw_82543()
968 mac->ops.clear_vfta(hw); in e1000_init_hw_82543()
971 e1000_init_rx_addrs_generic(hw, mac->rar_entry_count); in e1000_init_hw_82543()
975 for (i = 0; i < mac->mta_reg_count; i++) { in e1000_init_hw_82543()
976 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); in e1000_init_hw_82543()
977 E1000_WRITE_FLUSH(hw); in e1000_init_hw_82543()
981 * Set the PCI priority bit correctly in the CTRL register. This in e1000_init_hw_82543()
985 if (hw->mac.type == e1000_82543 && dev_spec->dma_fairness) { in e1000_init_hw_82543()
986 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_init_hw_82543()
987 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_PRIOR); in e1000_init_hw_82543()
990 e1000_pcix_mmrbc_workaround_generic(hw); in e1000_init_hw_82543()
992 /* Setup link and flow control */ in e1000_init_hw_82543()
993 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82543()
1001 e1000_clear_hw_cntrs_82543(hw); in e1000_init_hw_82543()
1007 * e1000_setup_link_82543 - Setup flow control and link settings
1008 * @hw: pointer to the HW structure
1013 * Determines which flow control settings to use, then configures flow
1014 * control. Calls the appropriate media-specific link configuration
1019 static s32 e1000_setup_link_82543(struct e1000_hw *hw) in e1000_setup_link_82543() argument
1034 if (hw->mac.type == e1000_82543) { in e1000_setup_link_82543()
1035 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data); in e1000_setup_link_82543()
1038 ret_val = -E1000_ERR_NVM; in e1000_setup_link_82543()
1043 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); in e1000_setup_link_82543()
1046 ret_val = e1000_setup_link_generic(hw); in e1000_setup_link_82543()
1053 * e1000_setup_copper_link_82543 - Configure copper link settings
1054 * @hw: pointer to the HW structure
1056 * Configures the link for auto-neg or forced speed and duplex. Then we check
1058 * and flow control are called.
1060 static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw) in e1000_setup_copper_link_82543() argument
1062 u32 ctrl; in e1000_setup_copper_link_82543() local
1068 ctrl = E1000_READ_REG(hw, E1000_CTRL) | E1000_CTRL_SLU; in e1000_setup_copper_link_82543()
1075 if (hw->mac.type == e1000_82543) { in e1000_setup_copper_link_82543()
1076 ctrl |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); in e1000_setup_copper_link_82543()
1077 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_copper_link_82543()
1078 ret_val = hw->phy.ops.reset(hw); in e1000_setup_copper_link_82543()
1082 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); in e1000_setup_copper_link_82543()
1083 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_copper_link_82543()
1086 /* Set MDI/MDI-X, Polarity Reversal, and downshift settings */ in e1000_setup_copper_link_82543()
1087 ret_val = e1000_copper_link_setup_m88(hw); in e1000_setup_copper_link_82543()
1091 if (hw->mac.autoneg) { in e1000_setup_copper_link_82543()
1093 * Setup autoneg and flow control advertisement and perform in e1000_setup_copper_link_82543()
1096 ret_val = e1000_copper_link_autoneg(hw); in e1000_setup_copper_link_82543()
1105 ret_val = e1000_phy_force_speed_duplex_82543(hw); in e1000_setup_copper_link_82543()
1116 ret_val = e1000_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10, in e1000_setup_copper_link_82543()
1125 if (hw->mac.type == e1000_82544) { in e1000_setup_copper_link_82543()
1126 hw->mac.ops.config_collision_dist(hw); in e1000_setup_copper_link_82543()
1128 ret_val = e1000_config_mac_to_phy_82543(hw); in e1000_setup_copper_link_82543()
1132 ret_val = e1000_config_fc_after_link_up_generic(hw); in e1000_setup_copper_link_82543()
1142 * e1000_setup_fiber_link_82543 - Setup link for fiber
1143 * @hw: pointer to the HW structure
1145 * Configures collision distance and flow control for fiber links. Upon
1148 static s32 e1000_setup_fiber_link_82543(struct e1000_hw *hw) in e1000_setup_fiber_link_82543() argument
1150 u32 ctrl; in e1000_setup_fiber_link_82543() local
1155 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_setup_fiber_link_82543()
1158 ctrl &= ~E1000_CTRL_LRST; in e1000_setup_fiber_link_82543()
1160 hw->mac.ops.config_collision_dist(hw); in e1000_setup_fiber_link_82543()
1162 ret_val = e1000_commit_fc_settings_generic(hw); in e1000_setup_fiber_link_82543()
1166 DEBUGOUT("Auto-negotiation enabled\n"); in e1000_setup_fiber_link_82543()
1168 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_fiber_link_82543()
1169 E1000_WRITE_FLUSH(hw); in e1000_setup_fiber_link_82543()
1175 * "Link-Up" indication. in e1000_setup_fiber_link_82543()
1177 if (!(E1000_READ_REG(hw, E1000_CTRL) & E1000_CTRL_SWDPIN1)) in e1000_setup_fiber_link_82543()
1178 ret_val = e1000_poll_fiber_serdes_link_generic(hw); in e1000_setup_fiber_link_82543()
1187 * e1000_check_for_copper_link_82543 - Check for link (Copper)
1188 * @hw: pointer to the HW structure
1191 * - check for downshift
1192 * - do polarity workaround (if necessary)
1193 * - configure collision distance
1194 * - configure flow control after link up
1195 * - configure tbi compatibility
1197 static s32 e1000_check_for_copper_link_82543(struct e1000_hw *hw) in e1000_check_for_copper_link_82543() argument
1199 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_copper_link_82543()
1207 if (!mac->get_link_status) { in e1000_check_for_copper_link_82543()
1212 ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link); in e1000_check_for_copper_link_82543()
1219 mac->get_link_status = false; in e1000_check_for_copper_link_82543()
1221 e1000_check_downshift_generic(hw); in e1000_check_for_copper_link_82543()
1227 if (!mac->autoneg) { in e1000_check_for_copper_link_82543()
1236 if (mac->forced_speed_duplex & E1000_ALL_10_SPEED) { in e1000_check_for_copper_link_82543()
1237 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); in e1000_check_for_copper_link_82543()
1238 ret_val = e1000_polarity_reversal_workaround_82543(hw); in e1000_check_for_copper_link_82543()
1239 icr = E1000_READ_REG(hw, E1000_ICR); in e1000_check_for_copper_link_82543()
1240 E1000_WRITE_REG(hw, E1000_ICS, (icr & ~E1000_ICS_LSC)); in e1000_check_for_copper_link_82543()
1241 E1000_WRITE_REG(hw, E1000_IMS, IMS_ENABLE_MASK); in e1000_check_for_copper_link_82543()
1244 ret_val = -E1000_ERR_CONFIG; in e1000_check_for_copper_link_82543()
1249 * We have a M88E1000 PHY and Auto-Neg is enabled. If we in e1000_check_for_copper_link_82543()
1257 if (mac->type == e1000_82544) in e1000_check_for_copper_link_82543()
1258 hw->mac.ops.config_collision_dist(hw); in e1000_check_for_copper_link_82543()
1260 ret_val = e1000_config_mac_to_phy_82543(hw); in e1000_check_for_copper_link_82543()
1268 * Configure Flow Control now that Auto-Neg has completed. in e1000_check_for_copper_link_82543()
1269 * First, we need to restore the desired flow control in e1000_check_for_copper_link_82543()
1270 * settings because we may have had to re-autoneg with a in e1000_check_for_copper_link_82543()
1273 ret_val = e1000_config_fc_after_link_up_generic(hw); in e1000_check_for_copper_link_82543()
1275 DEBUGOUT("Error configuring flow control\n"); in e1000_check_for_copper_link_82543()
1279 * auto-negotiated link. These are conditions for checking the link in e1000_check_for_copper_link_82543()
1285 if (e1000_tbi_compatibility_enabled_82543(hw)) { in e1000_check_for_copper_link_82543()
1286 ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex); in e1000_check_for_copper_link_82543()
1296 if (e1000_tbi_sbp_enabled_82543(hw)) { in e1000_check_for_copper_link_82543()
1301 e1000_set_tbi_sbp_82543(hw, false); in e1000_check_for_copper_link_82543()
1302 rctl = E1000_READ_REG(hw, E1000_RCTL); in e1000_check_for_copper_link_82543()
1304 E1000_WRITE_REG(hw, E1000_RCTL, rctl); in e1000_check_for_copper_link_82543()
1314 if (!e1000_tbi_sbp_enabled_82543(hw)) { in e1000_check_for_copper_link_82543()
1315 e1000_set_tbi_sbp_82543(hw, true); in e1000_check_for_copper_link_82543()
1316 rctl = E1000_READ_REG(hw, E1000_RCTL); in e1000_check_for_copper_link_82543()
1318 E1000_WRITE_REG(hw, E1000_RCTL, rctl); in e1000_check_for_copper_link_82543()
1327 * e1000_check_for_fiber_link_82543 - Check for link (Fiber)
1328 * @hw: pointer to the HW structure
1333 static s32 e1000_check_for_fiber_link_82543(struct e1000_hw *hw) in e1000_check_for_fiber_link_82543() argument
1335 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_fiber_link_82543()
1336 u32 rxcw, ctrl, status; in e1000_check_for_fiber_link_82543() local
1341 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_check_for_fiber_link_82543()
1342 status = E1000_READ_REG(hw, E1000_STATUS); in e1000_check_for_fiber_link_82543()
1343 rxcw = E1000_READ_REG(hw, E1000_RXCW); in e1000_check_for_fiber_link_82543()
1346 * If we don't have link (auto-negotiation failed or link partner in e1000_check_for_fiber_link_82543()
1347 * cannot auto-negotiate), the cable is plugged in (we have signal), in e1000_check_for_fiber_link_82543()
1348 * and our link partner is not trying to auto-negotiate with us (we in e1000_check_for_fiber_link_82543()
1350 * need to give auto-negotiation time to complete, in case the cable in e1000_check_for_fiber_link_82543()
1353 /* (ctrl & E1000_CTRL_SWDPIN1) == 0 == have signal */ in e1000_check_for_fiber_link_82543()
1354 if ((!(ctrl & E1000_CTRL_SWDPIN1)) && in e1000_check_for_fiber_link_82543()
1357 if (!mac->autoneg_failed) { in e1000_check_for_fiber_link_82543()
1358 mac->autoneg_failed = true; in e1000_check_for_fiber_link_82543()
1364 /* Disable auto-negotiation in the TXCW register */ in e1000_check_for_fiber_link_82543()
1365 E1000_WRITE_REG(hw, E1000_TXCW, (mac->txcw & ~E1000_TXCW_ANE)); in e1000_check_for_fiber_link_82543()
1367 /* Force link-up and also force full-duplex. */ in e1000_check_for_fiber_link_82543()
1368 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_check_for_fiber_link_82543()
1369 ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD); in e1000_check_for_fiber_link_82543()
1370 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_check_for_fiber_link_82543()
1372 /* Configure Flow Control after forcing link up. */ in e1000_check_for_fiber_link_82543()
1373 ret_val = e1000_config_fc_after_link_up_generic(hw); in e1000_check_for_fiber_link_82543()
1375 DEBUGOUT("Error configuring flow control\n"); in e1000_check_for_fiber_link_82543()
1378 } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { in e1000_check_for_fiber_link_82543()
1381 * sets, re-enable auto-negotiation in the TXCW register in e1000_check_for_fiber_link_82543()
1383 * in an attempt to auto-negotiate with our link partner. in e1000_check_for_fiber_link_82543()
1386 E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); in e1000_check_for_fiber_link_82543()
1387 E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & ~E1000_CTRL_SLU)); in e1000_check_for_fiber_link_82543()
1389 mac->serdes_has_link = true; in e1000_check_for_fiber_link_82543()
1397 * e1000_config_mac_to_phy_82543 - Configure MAC to PHY settings
1398 * @hw: pointer to the HW structure
1401 * of the PHY, even if the PHY is auto-negotiating.
1403 static s32 e1000_config_mac_to_phy_82543(struct e1000_hw *hw) in e1000_config_mac_to_phy_82543() argument
1405 u32 ctrl; in e1000_config_mac_to_phy_82543() local
1411 if (!(hw->phy.ops.read_reg)) in e1000_config_mac_to_phy_82543()
1415 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_config_mac_to_phy_82543()
1416 ctrl |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); in e1000_config_mac_to_phy_82543()
1417 ctrl &= ~(E1000_CTRL_SPD_SEL | E1000_CTRL_ILOS); in e1000_config_mac_to_phy_82543()
1423 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000_config_mac_to_phy_82543()
1427 ctrl &= ~E1000_CTRL_FD; in e1000_config_mac_to_phy_82543()
1429 ctrl |= E1000_CTRL_FD; in e1000_config_mac_to_phy_82543()
1431 hw->mac.ops.config_collision_dist(hw); in e1000_config_mac_to_phy_82543()
1438 ctrl |= E1000_CTRL_SPD_1000; in e1000_config_mac_to_phy_82543()
1440 ctrl |= E1000_CTRL_SPD_100; in e1000_config_mac_to_phy_82543()
1442 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_config_mac_to_phy_82543()
1449 * e1000_write_vfta_82543 - Write value to VLAN filter table
1450 * @hw: pointer to the HW structure
1451 * @offset: the 32-bit offset in which to write the value to.
1452 * @value: the 32-bit value to write at location offset.
1454 * This writes a 32-bit value to a 32-bit offset in the VLAN filter
1457 static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset, u32 value) in e1000_write_vfta_82543() argument
1463 if ((hw->mac.type == e1000_82544) && (offset & 1)) { in e1000_write_vfta_82543()
1464 temp = E1000_READ_REG_ARRAY(hw, E1000_VFTA, offset - 1); in e1000_write_vfta_82543()
1465 E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value); in e1000_write_vfta_82543()
1466 E1000_WRITE_FLUSH(hw); in e1000_write_vfta_82543()
1467 E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset - 1, temp); in e1000_write_vfta_82543()
1468 E1000_WRITE_FLUSH(hw); in e1000_write_vfta_82543()
1470 e1000_write_vfta_generic(hw, offset, value); in e1000_write_vfta_82543()
1475 * e1000_led_on_82543 - Turn on SW controllable LED
1476 * @hw: pointer to the HW structure
1480 static s32 e1000_led_on_82543(struct e1000_hw *hw) in e1000_led_on_82543() argument
1482 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_led_on_82543() local
1486 if (hw->mac.type == e1000_82544 && in e1000_led_on_82543()
1487 hw->phy.media_type == e1000_media_type_copper) { in e1000_led_on_82543()
1488 /* Clear SW-definable Pin 0 to turn on the LED */ in e1000_led_on_82543()
1489 ctrl &= ~E1000_CTRL_SWDPIN0; in e1000_led_on_82543()
1490 ctrl |= E1000_CTRL_SWDPIO0; in e1000_led_on_82543()
1493 ctrl |= E1000_CTRL_SWDPIN0; in e1000_led_on_82543()
1494 ctrl |= E1000_CTRL_SWDPIO0; in e1000_led_on_82543()
1496 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_led_on_82543()
1502 * e1000_led_off_82543 - Turn off SW controllable LED
1503 * @hw: pointer to the HW structure
1507 static s32 e1000_led_off_82543(struct e1000_hw *hw) in e1000_led_off_82543() argument
1509 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_led_off_82543() local
1513 if (hw->mac.type == e1000_82544 && in e1000_led_off_82543()
1514 hw->phy.media_type == e1000_media_type_copper) { in e1000_led_off_82543()
1515 /* Set SW-definable Pin 0 to turn off the LED */ in e1000_led_off_82543()
1516 ctrl |= E1000_CTRL_SWDPIN0; in e1000_led_off_82543()
1517 ctrl |= E1000_CTRL_SWDPIO0; in e1000_led_off_82543()
1519 ctrl &= ~E1000_CTRL_SWDPIN0; in e1000_led_off_82543()
1520 ctrl |= E1000_CTRL_SWDPIO0; in e1000_led_off_82543()
1522 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_led_off_82543()
1528 * e1000_clear_hw_cntrs_82543 - Clear device specific hardware counters
1529 * @hw: pointer to the HW structure
1533 static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw) in e1000_clear_hw_cntrs_82543() argument
1537 e1000_clear_hw_cntrs_base_generic(hw); in e1000_clear_hw_cntrs_82543()
1539 E1000_READ_REG(hw, E1000_PRC64); in e1000_clear_hw_cntrs_82543()
1540 E1000_READ_REG(hw, E1000_PRC127); in e1000_clear_hw_cntrs_82543()
1541 E1000_READ_REG(hw, E1000_PRC255); in e1000_clear_hw_cntrs_82543()
1542 E1000_READ_REG(hw, E1000_PRC511); in e1000_clear_hw_cntrs_82543()
1543 E1000_READ_REG(hw, E1000_PRC1023); in e1000_clear_hw_cntrs_82543()
1544 E1000_READ_REG(hw, E1000_PRC1522); in e1000_clear_hw_cntrs_82543()
1545 E1000_READ_REG(hw, E1000_PTC64); in e1000_clear_hw_cntrs_82543()
1546 E1000_READ_REG(hw, E1000_PTC127); in e1000_clear_hw_cntrs_82543()
1547 E1000_READ_REG(hw, E1000_PTC255); in e1000_clear_hw_cntrs_82543()
1548 E1000_READ_REG(hw, E1000_PTC511); in e1000_clear_hw_cntrs_82543()
1549 E1000_READ_REG(hw, E1000_PTC1023); in e1000_clear_hw_cntrs_82543()
1550 E1000_READ_REG(hw, E1000_PTC1522); in e1000_clear_hw_cntrs_82543()
1552 E1000_READ_REG(hw, E1000_ALGNERRC); in e1000_clear_hw_cntrs_82543()
1553 E1000_READ_REG(hw, E1000_RXERRC); in e1000_clear_hw_cntrs_82543()
1554 E1000_READ_REG(hw, E1000_TNCRS); in e1000_clear_hw_cntrs_82543()
1555 E1000_READ_REG(hw, E1000_CEXTERR); in e1000_clear_hw_cntrs_82543()
1556 E1000_READ_REG(hw, E1000_TSCTC); in e1000_clear_hw_cntrs_82543()
1557 E1000_READ_REG(hw, E1000_TSCTFC); in e1000_clear_hw_cntrs_82543()
1561 * e1000_read_mac_addr_82543 - Read device MAC address
1562 * @hw: pointer to the HW structure
1569 s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) in e1000_read_mac_addr_82543() argument
1578 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); in e1000_read_mac_addr_82543()
1583 hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); in e1000_read_mac_addr_82543()
1584 hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); in e1000_read_mac_addr_82543()
1588 if (hw->bus.func == E1000_FUNC_1) in e1000_read_mac_addr_82543()
1589 hw->mac.perm_addr[5] ^= 1; in e1000_read_mac_addr_82543()
1592 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_82543()