Lines Matching refs:hw

67 static s32  igb_set_pcie_completion_timeout(struct e1000_hw *hw);
68 static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw);
69 static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw);
70 static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw);
71 static s32 igb_validate_nvm_checksum_i350(struct e1000_hw *hw);
72 static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw);
83 static bool igb_sgmii_uses_mdio_82575(struct e1000_hw *hw) in igb_sgmii_uses_mdio_82575() argument
88 switch (hw->mac.type) { in igb_sgmii_uses_mdio_82575()
114 static s32 igb_check_for_link_media_swap(struct e1000_hw *hw) in igb_check_for_link_media_swap() argument
116 struct e1000_phy_info *phy = &hw->phy; in igb_check_for_link_media_swap()
122 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
126 ret_val = phy->ops.read_reg(hw, E1000_M88E1112_STATUS, &data); in igb_check_for_link_media_swap()
134 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 1); in igb_check_for_link_media_swap()
138 ret_val = phy->ops.read_reg(hw, E1000_M88E1112_STATUS, &data); in igb_check_for_link_media_swap()
147 if (port && (hw->dev_spec._82575.media_port != port)) { in igb_check_for_link_media_swap()
148 hw->dev_spec._82575.media_port = port; in igb_check_for_link_media_swap()
149 hw->dev_spec._82575.media_changed = true; in igb_check_for_link_media_swap()
154 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
157 igb_check_for_link_82575(hw); in igb_check_for_link_media_swap()
159 igb_check_for_link_82575(hw); in igb_check_for_link_media_swap()
161 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
173 static s32 igb_init_phy_params_82575(struct e1000_hw *hw) in igb_init_phy_params_82575() argument
175 struct e1000_phy_info *phy = &hw->phy; in igb_init_phy_params_82575()
179 if (hw->phy.media_type != e1000_media_type_copper) { in igb_init_phy_params_82575()
189 if (igb_sgmii_active_82575(hw)) { in igb_init_phy_params_82575()
198 igb_reset_mdicnfg_82580(hw); in igb_init_phy_params_82575()
200 if (igb_sgmii_active_82575(hw) && !igb_sgmii_uses_mdio_82575(hw)) { in igb_init_phy_params_82575()
204 switch (hw->mac.type) { in igb_init_phy_params_82575()
223 hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> in igb_init_phy_params_82575()
227 ret_val = igb_get_phy_id_82575(hw); in igb_init_phy_params_82575()
251 ret_val = phy->ops.write_reg(hw, in igb_init_phy_params_82575()
257 ret_val = phy->ops.read_reg(hw, in igb_init_phy_params_82575()
267 hw->mac.ops.check_for_link = in igb_init_phy_params_82575()
271 ret_val = igb_initialize_M88E1512_phy(hw); in igb_init_phy_params_82575()
316 static s32 igb_init_nvm_params_82575(struct e1000_hw *hw) in igb_init_nvm_params_82575() argument
318 struct e1000_nvm_info *nvm = &hw->nvm; in igb_init_nvm_params_82575()
372 switch (hw->mac.type) { in igb_init_nvm_params_82575()
393 static s32 igb_init_mac_params_82575(struct e1000_hw *hw) in igb_init_mac_params_82575() argument
395 struct e1000_mac_info *mac = &hw->mac; in igb_init_mac_params_82575()
396 struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575; in igb_init_mac_params_82575()
447 (hw->phy.media_type == e1000_media_type_copper) in igb_init_mac_params_82575()
452 switch (hw->device_id) { in igb_init_mac_params_82575()
460 hw->dev_spec._82575.mas_capable = true; in igb_init_mac_params_82575()
474 static s32 igb_set_sfp_media_type_82575(struct e1000_hw *hw) in igb_set_sfp_media_type_82575() argument
478 struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575; in igb_set_sfp_media_type_82575()
492 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
503 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
514 hw->phy.media_type = e1000_media_type_internal_serdes; in igb_set_sfp_media_type_82575()
517 hw->phy.media_type = e1000_media_type_internal_serdes; in igb_set_sfp_media_type_82575()
520 hw->phy.media_type = e1000_media_type_copper; in igb_set_sfp_media_type_82575()
522 hw->phy.media_type = e1000_media_type_unknown; in igb_set_sfp_media_type_82575()
527 hw->phy.media_type = e1000_media_type_unknown; in igb_set_sfp_media_type_82575()
536 static s32 igb_get_invariants_82575(struct e1000_hw *hw) in igb_get_invariants_82575() argument
538 struct e1000_mac_info *mac = &hw->mac; in igb_get_invariants_82575()
539 struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575; in igb_get_invariants_82575()
544 switch (hw->device_id) { in igb_get_invariants_82575()
605 hw->phy.media_type = e1000_media_type_copper; in igb_get_invariants_82575()
614 hw->phy.media_type = e1000_media_type_internal_serdes; in igb_get_invariants_82575()
618 if (igb_sgmii_uses_mdio_82575(hw)) { in igb_get_invariants_82575()
619 hw->phy.media_type = e1000_media_type_copper; in igb_get_invariants_82575()
626 ret_val = igb_set_sfp_media_type_82575(hw); in igb_get_invariants_82575()
628 (hw->phy.media_type == e1000_media_type_unknown)) { in igb_get_invariants_82575()
632 hw->phy.media_type = e1000_media_type_internal_serdes; in igb_get_invariants_82575()
635 hw->phy.media_type = e1000_media_type_copper; in igb_get_invariants_82575()
649 if (hw->phy.media_type == e1000_media_type_copper) in igb_get_invariants_82575()
662 ret_val = igb_init_mac_params_82575(hw); in igb_get_invariants_82575()
667 ret_val = igb_init_nvm_params_82575(hw); in igb_get_invariants_82575()
668 switch (hw->mac.type) { in igb_get_invariants_82575()
671 ret_val = igb_init_nvm_params_i210(hw); in igb_get_invariants_82575()
684 igb_init_mbx_params_pf(hw); in igb_get_invariants_82575()
691 ret_val = igb_init_phy_params_82575(hw); in igb_get_invariants_82575()
704 static s32 igb_acquire_phy_82575(struct e1000_hw *hw) in igb_acquire_phy_82575() argument
708 if (hw->bus.func == E1000_FUNC_1) in igb_acquire_phy_82575()
710 else if (hw->bus.func == E1000_FUNC_2) in igb_acquire_phy_82575()
712 else if (hw->bus.func == E1000_FUNC_3) in igb_acquire_phy_82575()
715 return hw->mac.ops.acquire_swfw_sync(hw, mask); in igb_acquire_phy_82575()
725 static void igb_release_phy_82575(struct e1000_hw *hw) in igb_release_phy_82575() argument
729 if (hw->bus.func == E1000_FUNC_1) in igb_release_phy_82575()
731 else if (hw->bus.func == E1000_FUNC_2) in igb_release_phy_82575()
733 else if (hw->bus.func == E1000_FUNC_3) in igb_release_phy_82575()
736 hw->mac.ops.release_swfw_sync(hw, mask); in igb_release_phy_82575()
748 static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, in igb_read_phy_reg_sgmii_82575() argument
758 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_sgmii_82575()
762 ret_val = igb_read_phy_reg_i2c(hw, offset, data); in igb_read_phy_reg_sgmii_82575()
764 hw->phy.ops.release(hw); in igb_read_phy_reg_sgmii_82575()
779 static s32 igb_write_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, in igb_write_phy_reg_sgmii_82575() argument
790 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_sgmii_82575()
794 ret_val = igb_write_phy_reg_i2c(hw, offset, data); in igb_write_phy_reg_sgmii_82575()
796 hw->phy.ops.release(hw); in igb_write_phy_reg_sgmii_82575()
809 static s32 igb_get_phy_id_82575(struct e1000_hw *hw) in igb_get_phy_id_82575() argument
811 struct e1000_phy_info *phy = &hw->phy; in igb_get_phy_id_82575()
818 if (hw->mac.type == e1000_i354) in igb_get_phy_id_82575()
819 igb_get_phy_id(hw); in igb_get_phy_id_82575()
827 if (!(igb_sgmii_active_82575(hw))) { in igb_get_phy_id_82575()
829 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
833 if (igb_sgmii_uses_mdio_82575(hw)) { in igb_get_phy_id_82575()
834 switch (hw->mac.type) { in igb_get_phy_id_82575()
854 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
868 ret_val = igb_read_phy_reg_sgmii_82575(hw, PHY_ID1, &phy_id); in igb_get_phy_id_82575()
888 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
904 static s32 igb_phy_hw_reset_sgmii_82575(struct e1000_hw *hw) in igb_phy_hw_reset_sgmii_82575() argument
906 struct e1000_phy_info *phy = &hw->phy; in igb_phy_hw_reset_sgmii_82575()
918 ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084); in igb_phy_hw_reset_sgmii_82575()
922 ret_val = igb_phy_sw_reset(hw); in igb_phy_hw_reset_sgmii_82575()
927 ret_val = igb_initialize_M88E1512_phy(hw); in igb_phy_hw_reset_sgmii_82575()
945 static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active) in igb_set_d0_lplu_state_82575() argument
947 struct e1000_phy_info *phy = &hw->phy; in igb_set_d0_lplu_state_82575()
951 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); in igb_set_d0_lplu_state_82575()
957 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
963 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
966 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
972 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
980 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
986 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
991 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
997 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
1021 static s32 igb_set_d0_lplu_state_82580(struct e1000_hw *hw, bool active) in igb_set_d0_lplu_state_82580() argument
1023 struct e1000_phy_info *phy = &hw->phy; in igb_set_d0_lplu_state_82580()
1064 static s32 igb_set_d3_lplu_state_82580(struct e1000_hw *hw, bool active) in igb_set_d3_lplu_state_82580() argument
1066 struct e1000_phy_info *phy = &hw->phy; in igb_set_d3_lplu_state_82580()
1103 static s32 igb_acquire_nvm_82575(struct e1000_hw *hw) in igb_acquire_nvm_82575() argument
1107 ret_val = hw->mac.ops.acquire_swfw_sync(hw, E1000_SWFW_EEP_SM); in igb_acquire_nvm_82575()
1111 ret_val = igb_acquire_nvm(hw); in igb_acquire_nvm_82575()
1114 hw->mac.ops.release_swfw_sync(hw, E1000_SWFW_EEP_SM); in igb_acquire_nvm_82575()
1127 static void igb_release_nvm_82575(struct e1000_hw *hw) in igb_release_nvm_82575() argument
1129 igb_release_nvm(hw); in igb_release_nvm_82575()
1130 hw->mac.ops.release_swfw_sync(hw, E1000_SWFW_EEP_SM); in igb_release_nvm_82575()
1141 static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask) in igb_acquire_swfw_sync_82575() argument
1150 if (igb_get_hw_semaphore(hw)) { in igb_acquire_swfw_sync_82575()
1162 igb_put_hw_semaphore(hw); in igb_acquire_swfw_sync_82575()
1176 igb_put_hw_semaphore(hw); in igb_acquire_swfw_sync_82575()
1190 static void igb_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask) in igb_release_swfw_sync_82575() argument
1194 while (igb_get_hw_semaphore(hw) != 0) in igb_release_swfw_sync_82575()
1201 igb_put_hw_semaphore(hw); in igb_release_swfw_sync_82575()
1214 static s32 igb_get_cfg_done_82575(struct e1000_hw *hw) in igb_get_cfg_done_82575() argument
1219 if (hw->bus.func == 1) in igb_get_cfg_done_82575()
1221 else if (hw->bus.func == E1000_FUNC_2) in igb_get_cfg_done_82575()
1223 else if (hw->bus.func == E1000_FUNC_3) in igb_get_cfg_done_82575()
1237 (hw->phy.type == e1000_phy_igp_3)) in igb_get_cfg_done_82575()
1238 igb_phy_init_script_igp3(hw); in igb_get_cfg_done_82575()
1253 static s32 igb_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed, in igb_get_link_up_info_82575() argument
1258 if (hw->phy.media_type != e1000_media_type_copper) in igb_get_link_up_info_82575()
1259 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, speed, in igb_get_link_up_info_82575()
1262 ret_val = igb_get_speed_and_duplex_copper(hw, speed, in igb_get_link_up_info_82575()
1275 static s32 igb_check_for_link_82575(struct e1000_hw *hw) in igb_check_for_link_82575() argument
1280 if (hw->phy.media_type != e1000_media_type_copper) { in igb_check_for_link_82575()
1281 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, in igb_check_for_link_82575()
1287 hw->mac.get_link_status = !hw->mac.serdes_has_link; in igb_check_for_link_82575()
1294 ret_val = igb_config_fc_after_link_up(hw); in igb_check_for_link_82575()
1298 ret_val = igb_check_for_copper_link(hw); in igb_check_for_link_82575()
1308 void igb_power_up_serdes_link_82575(struct e1000_hw *hw) in igb_power_up_serdes_link_82575() argument
1313 if ((hw->phy.media_type != e1000_media_type_internal_serdes) && in igb_power_up_serdes_link_82575()
1314 !igb_sgmii_active_82575(hw)) in igb_power_up_serdes_link_82575()
1341 static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, in igb_get_pcs_speed_and_duplex_82575() argument
1344 struct e1000_mac_info *mac = &hw->mac; in igb_get_pcs_speed_and_duplex_82575()
1403 void igb_shutdown_serdes_link_82575(struct e1000_hw *hw) in igb_shutdown_serdes_link_82575() argument
1407 if (hw->phy.media_type != e1000_media_type_internal_serdes && in igb_shutdown_serdes_link_82575()
1408 igb_sgmii_active_82575(hw)) in igb_shutdown_serdes_link_82575()
1411 if (!igb_enable_mng_pass_thru(hw)) { in igb_shutdown_serdes_link_82575()
1435 static s32 igb_reset_hw_82575(struct e1000_hw *hw) in igb_reset_hw_82575() argument
1443 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82575()
1448 ret_val = igb_set_pcie_completion_timeout(hw); in igb_reset_hw_82575()
1466 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82575()
1477 igb_reset_init_script_82575(hw); in igb_reset_hw_82575()
1484 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82575()
1495 static s32 igb_init_hw_82575(struct e1000_hw *hw) in igb_init_hw_82575() argument
1497 struct e1000_mac_info *mac = &hw->mac; in igb_init_hw_82575()
1501 if ((hw->mac.type >= e1000_i210) && in igb_init_hw_82575()
1502 !(igb_get_flash_presence_i210(hw))) { in igb_init_hw_82575()
1503 ret_val = igb_pll_workaround_i210(hw); in igb_init_hw_82575()
1509 ret_val = igb_id_led_init(hw); in igb_init_hw_82575()
1517 if ((hw->mac.type == e1000_i350) || (hw->mac.type == e1000_i354)) in igb_init_hw_82575()
1518 igb_clear_vfta_i350(hw); in igb_init_hw_82575()
1520 igb_clear_vfta(hw); in igb_init_hw_82575()
1523 igb_init_rx_addrs(hw, rar_count); in igb_init_hw_82575()
1536 ret_val = igb_setup_link(hw); in igb_init_hw_82575()
1543 igb_clear_hw_cntrs_82575(hw); in igb_init_hw_82575()
1555 static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) in igb_setup_copper_link_82575() argument
1567 switch (hw->mac.type) { in igb_setup_copper_link_82575()
1580 ret_val = igb_setup_serdes_link_82575(hw); in igb_setup_copper_link_82575()
1584 if (igb_sgmii_active_82575(hw) && !hw->phy.reset_disable) { in igb_setup_copper_link_82575()
1588 ret_val = hw->phy.ops.reset(hw); in igb_setup_copper_link_82575()
1594 switch (hw->phy.type) { in igb_setup_copper_link_82575()
1597 switch (hw->phy.id) { in igb_setup_copper_link_82575()
1603 ret_val = igb_copper_link_setup_m88_gen2(hw); in igb_setup_copper_link_82575()
1606 ret_val = igb_copper_link_setup_m88(hw); in igb_setup_copper_link_82575()
1611 ret_val = igb_copper_link_setup_igp(hw); in igb_setup_copper_link_82575()
1614 ret_val = igb_copper_link_setup_82580(hw); in igb_setup_copper_link_82575()
1624 ret_val = igb_setup_copper_link(hw); in igb_setup_copper_link_82575()
1638 static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) in igb_setup_serdes_link_82575() argument
1645 if ((hw->phy.media_type != e1000_media_type_internal_serdes) && in igb_setup_serdes_link_82575()
1646 !igb_sgmii_active_82575(hw)) in igb_setup_serdes_link_82575()
1666 if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { in igb_setup_serdes_link_82575()
1679 pcs_autoneg = hw->mac.autoneg; in igb_setup_serdes_link_82575()
1692 if (hw->mac.type == e1000_82575 || in igb_setup_serdes_link_82575()
1693 hw->mac.type == e1000_82576) { in igb_setup_serdes_link_82575()
1694 ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data); in igb_setup_serdes_link_82575()
1737 switch (hw->fc.requested_mode) { in igb_setup_serdes_link_82575()
1764 if (!pcs_autoneg && !igb_sgmii_active_82575(hw)) in igb_setup_serdes_link_82575()
1765 igb_force_mac_fc(hw); in igb_setup_serdes_link_82575()
1778 static bool igb_sgmii_active_82575(struct e1000_hw *hw) in igb_sgmii_active_82575() argument
1780 struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575; in igb_sgmii_active_82575()
1791 static s32 igb_reset_init_script_82575(struct e1000_hw *hw) in igb_reset_init_script_82575() argument
1793 if (hw->mac.type == e1000_82575) { in igb_reset_init_script_82575()
1796 igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x00, 0x0C); in igb_reset_init_script_82575()
1797 igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x01, 0x78); in igb_reset_init_script_82575()
1798 igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x1B, 0x23); in igb_reset_init_script_82575()
1799 igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x23, 0x15); in igb_reset_init_script_82575()
1802 igb_write_8bit_ctrl_reg(hw, E1000_CCMCTL, 0x14, 0x00); in igb_reset_init_script_82575()
1803 igb_write_8bit_ctrl_reg(hw, E1000_CCMCTL, 0x10, 0x00); in igb_reset_init_script_82575()
1806 igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x00, 0xEC); in igb_reset_init_script_82575()
1807 igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x61, 0xDF); in igb_reset_init_script_82575()
1808 igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x34, 0x05); in igb_reset_init_script_82575()
1809 igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x2F, 0x81); in igb_reset_init_script_82575()
1812 igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x02, 0x47); in igb_reset_init_script_82575()
1813 igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x14, 0x00); in igb_reset_init_script_82575()
1814 igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x10, 0x00); in igb_reset_init_script_82575()
1824 static s32 igb_read_mac_addr_82575(struct e1000_hw *hw) in igb_read_mac_addr_82575() argument
1832 ret_val = igb_check_alt_mac_addr(hw); in igb_read_mac_addr_82575()
1836 ret_val = igb_read_mac_addr(hw); in igb_read_mac_addr_82575()
1849 void igb_power_down_phy_copper_82575(struct e1000_hw *hw) in igb_power_down_phy_copper_82575() argument
1852 if (!(igb_enable_mng_pass_thru(hw) || igb_check_reset_block(hw))) in igb_power_down_phy_copper_82575()
1853 igb_power_down_phy_copper(hw); in igb_power_down_phy_copper_82575()
1862 static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw) in igb_clear_hw_cntrs_82575() argument
1864 igb_clear_hw_cntrs_base(hw); in igb_clear_hw_cntrs_82575()
1914 if (hw->phy.media_type == e1000_media_type_internal_serdes || in igb_clear_hw_cntrs_82575()
1915 igb_sgmii_active_82575(hw)) in igb_clear_hw_cntrs_82575()
1928 void igb_rx_fifo_flush_82575(struct e1000_hw *hw) in igb_rx_fifo_flush_82575() argument
1938 if (hw->mac.type != e1000_82575 || in igb_rx_fifo_flush_82575()
2006 static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw) in igb_set_pcie_completion_timeout() argument
2028 ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2035 ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2053 void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf) in igb_vmdq_set_anti_spoofing_pf() argument
2057 switch (hw->mac.type) { in igb_vmdq_set_anti_spoofing_pf()
2091 void igb_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable) in igb_vmdq_set_loopback_pf() argument
2095 switch (hw->mac.type) { in igb_vmdq_set_loopback_pf()
2127 void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable) in igb_vmdq_set_replication_pf() argument
2148 static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data) in igb_read_phy_reg_82580() argument
2152 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_82580()
2156 ret_val = igb_read_phy_reg_mdic(hw, offset, data); in igb_read_phy_reg_82580()
2158 hw->phy.ops.release(hw); in igb_read_phy_reg_82580()
2172 static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data) in igb_write_phy_reg_82580() argument
2177 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_82580()
2181 ret_val = igb_write_phy_reg_mdic(hw, offset, data); in igb_write_phy_reg_82580()
2183 hw->phy.ops.release(hw); in igb_write_phy_reg_82580()
2197 static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw) in igb_reset_mdicnfg_82580() argument
2203 if (hw->mac.type != e1000_82580) in igb_reset_mdicnfg_82580()
2205 if (!igb_sgmii_active_82575(hw)) in igb_reset_mdicnfg_82580()
2208 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A + in igb_reset_mdicnfg_82580()
2209 NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1, in igb_reset_mdicnfg_82580()
2233 static s32 igb_reset_hw_82580(struct e1000_hw *hw) in igb_reset_hw_82580() argument
2239 bool global_device_reset = hw->dev_spec._82575.global_device_reset; in igb_reset_hw_82580()
2241 hw->dev_spec._82575.global_device_reset = false; in igb_reset_hw_82580()
2246 if (hw->mac.type == e1000_82580) in igb_reset_hw_82580()
2255 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82580()
2269 hw->mac.ops.acquire_swfw_sync(hw, swmbsw_mask)) in igb_reset_hw_82580()
2285 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82580()
2301 ret_val = igb_reset_mdicnfg_82580(hw); in igb_reset_hw_82580()
2306 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82580()
2310 hw->mac.ops.release_swfw_sync(hw, swmbsw_mask); in igb_reset_hw_82580()
2344 static s32 igb_validate_nvm_checksum_with_offset(struct e1000_hw *hw, in igb_validate_nvm_checksum_with_offset() argument
2352 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_validate_nvm_checksum_with_offset()
2380 static s32 igb_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset) in igb_update_nvm_checksum_with_offset() argument
2387 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_update_nvm_checksum_with_offset()
2395 ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1, in igb_update_nvm_checksum_with_offset()
2412 static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw) in igb_validate_nvm_checksum_82580() argument
2419 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_validate_nvm_checksum_82580()
2434 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_82580()
2452 static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw) in igb_update_nvm_checksum_82580() argument
2458 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_update_nvm_checksum_82580()
2467 ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, in igb_update_nvm_checksum_82580()
2477 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_82580()
2494 static s32 igb_validate_nvm_checksum_i350(struct e1000_hw *hw) in igb_validate_nvm_checksum_i350() argument
2502 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_i350()
2520 static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw) in igb_update_nvm_checksum_i350() argument
2528 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_i350()
2544 static s32 __igb_access_emi_reg(struct e1000_hw *hw, u16 address, in __igb_access_emi_reg() argument
2549 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIADD, address); in __igb_access_emi_reg()
2554 ret_val = hw->phy.ops.read_reg(hw, E1000_EMIDATA, data); in __igb_access_emi_reg()
2556 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIDATA, *data); in __igb_access_emi_reg()
2567 s32 igb_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data) in igb_read_emi_reg() argument
2569 return __igb_access_emi_reg(hw, addr, data, true); in igb_read_emi_reg()
2581 s32 igb_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M) in igb_set_eee_i350() argument
2585 if ((hw->mac.type < e1000_i350) || in igb_set_eee_i350()
2586 (hw->phy.media_type != e1000_media_type_copper)) in igb_set_eee_i350()
2592 if (!(hw->dev_spec._82575.eee_disable)) { in igb_set_eee_i350()
2637 s32 igb_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M) in igb_set_eee_i354() argument
2639 struct e1000_phy_info *phy = &hw->phy; in igb_set_eee_i354()
2643 if ((hw->phy.media_type != e1000_media_type_copper) || in igb_set_eee_i354()
2648 if (!hw->dev_spec._82575.eee_disable) { in igb_set_eee_i354()
2650 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 18); in igb_set_eee_i354()
2654 ret_val = phy->ops.read_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2660 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2666 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0); in igb_set_eee_i354()
2671 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2687 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2692 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2700 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2717 s32 igb_get_eee_status_i354(struct e1000_hw *hw, bool *status) in igb_get_eee_status_i354() argument
2719 struct e1000_phy_info *phy = &hw->phy; in igb_get_eee_status_i354()
2724 if ((hw->phy.media_type != e1000_media_type_copper) || in igb_get_eee_status_i354()
2729 ret_val = igb_read_xmdio_reg(hw, E1000_PCS_STATUS_ADDR_I354, in igb_get_eee_status_i354()
2762 static s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw) in igb_get_thermal_sensor_data_generic() argument
2771 struct e1000_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in igb_get_thermal_sensor_data_generic()
2773 if ((hw->mac.type != e1000_i350) || (hw->bus.func != 0)) in igb_get_thermal_sensor_data_generic()
2779 hw->nvm.ops.read(hw, NVM_ETS_CFG, 1, &ets_offset); in igb_get_thermal_sensor_data_generic()
2783 hw->nvm.ops.read(hw, ets_offset, 1, &ets_cfg); in igb_get_thermal_sensor_data_generic()
2793 hw->nvm.ops.read(hw, (ets_offset + i), 1, &ets_sensor); in igb_get_thermal_sensor_data_generic()
2800 hw->phy.ops.read_i2c_byte(hw, in igb_get_thermal_sensor_data_generic()
2815 static s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw) in igb_init_thermal_sensor_thresh_generic() argument
2826 struct e1000_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in igb_init_thermal_sensor_thresh_generic()
2828 if ((hw->mac.type != e1000_i350) || (hw->bus.func != 0)) in igb_init_thermal_sensor_thresh_generic()
2840 hw->nvm.ops.read(hw, NVM_ETS_CFG, 1, &ets_offset); in igb_init_thermal_sensor_thresh_generic()
2844 hw->nvm.ops.read(hw, ets_offset, 1, &ets_cfg); in igb_init_thermal_sensor_thresh_generic()
2854 hw->nvm.ops.read(hw, (ets_offset + i), 1, &ets_sensor); in igb_init_thermal_sensor_thresh_generic()
2861 hw->phy.ops.write_i2c_byte(hw, in igb_init_thermal_sensor_thresh_generic()