Lines Matching refs:hw
40 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
41 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
42 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
43 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw);
44 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
46 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
47 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
48 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
49 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
50 static s32 e1000_led_on_82574(struct e1000_hw *hw);
51 static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
52 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
53 static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
54 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
55 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
56 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active);
57 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active);
63 static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) in e1000_init_phy_params_82571() argument
65 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82571()
68 if (hw->phy.media_type != e1000_media_type_copper) { in e1000_init_phy_params_82571()
80 switch (hw->mac.type) { in e1000_init_phy_params_82571()
101 ret_val = e1000_get_phy_id_82571(hw); in e1000_init_phy_params_82571()
108 switch (hw->mac.type) { in e1000_init_phy_params_82571()
138 static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) in e1000_init_nvm_params_82571() argument
140 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82571()
161 switch (hw->mac.type) { in e1000_init_nvm_params_82571()
193 switch (hw->mac.type) { in e1000_init_nvm_params_82571()
210 static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) in e1000_init_mac_params_82571() argument
212 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82571()
218 switch (hw->adapter->pdev->device) { in e1000_init_mac_params_82571()
222 hw->phy.media_type = e1000_media_type_fiber; in e1000_init_mac_params_82571()
233 hw->phy.media_type = e1000_media_type_internal_serdes; in e1000_init_mac_params_82571()
241 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82571()
257 switch (hw->mac.type) { in e1000_init_mac_params_82571()
294 switch (hw->mac.type) { in e1000_init_mac_params_82571()
326 hw->dev_spec.e82571.smb_counter = 0; in e1000_init_mac_params_82571()
333 struct e1000_hw *hw = &adapter->hw; in e1000_get_variants_82571() local
339 rc = e1000_init_mac_params_82571(hw); in e1000_get_variants_82571()
343 rc = e1000_init_nvm_params_82571(hw); in e1000_get_variants_82571()
347 rc = e1000_init_phy_params_82571(hw); in e1000_get_variants_82571()
370 switch (adapter->hw.mac.type) { in e1000_get_variants_82571()
406 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) in e1000_get_phy_id_82571() argument
408 struct e1000_phy_info *phy = &hw->phy; in e1000_get_phy_id_82571()
412 switch (hw->mac.type) { in e1000_get_phy_id_82571()
423 return e1000e_get_phy_id(hw); in e1000_get_phy_id_82571()
426 ret_val = e1e_rphy(hw, MII_PHYSID1, &phy_id); in e1000_get_phy_id_82571()
432 ret_val = e1e_rphy(hw, MII_PHYSID2, &phy_id); in e1000_get_phy_id_82571()
452 static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) in e1000_get_hw_semaphore_82571() argument
455 s32 sw_timeout = hw->nvm.word_size + 1; in e1000_get_hw_semaphore_82571()
456 s32 fw_timeout = hw->nvm.word_size + 1; in e1000_get_hw_semaphore_82571()
466 if (hw->dev_spec.e82571.smb_counter > 2) in e1000_get_hw_semaphore_82571()
481 hw->dev_spec.e82571.smb_counter++; in e1000_get_hw_semaphore_82571()
497 e1000_put_hw_semaphore_82571(hw); in e1000_get_hw_semaphore_82571()
511 static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) in e1000_put_hw_semaphore_82571() argument
527 static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) in e1000_get_hw_semaphore_82573() argument
547 e1000_put_hw_semaphore_82573(hw); in e1000_get_hw_semaphore_82573()
562 static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw) in e1000_put_hw_semaphore_82573() argument
580 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw) in e1000_get_hw_semaphore_82574() argument
585 ret_val = e1000_get_hw_semaphore_82573(hw); in e1000_get_hw_semaphore_82574()
598 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw) in e1000_put_hw_semaphore_82574() argument
600 e1000_put_hw_semaphore_82573(hw); in e1000_put_hw_semaphore_82574()
616 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) in e1000_set_d0_lplu_state_82574() argument
640 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active) in e1000_set_d3_lplu_state_82574() argument
646 } else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || in e1000_set_d3_lplu_state_82574()
647 (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) || in e1000_set_d3_lplu_state_82574()
648 (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) { in e1000_set_d3_lplu_state_82574()
665 static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw) in e1000_acquire_nvm_82571() argument
669 ret_val = e1000_get_hw_semaphore_82571(hw); in e1000_acquire_nvm_82571()
673 switch (hw->mac.type) { in e1000_acquire_nvm_82571()
677 ret_val = e1000e_acquire_nvm(hw); in e1000_acquire_nvm_82571()
682 e1000_put_hw_semaphore_82571(hw); in e1000_acquire_nvm_82571()
693 static void e1000_release_nvm_82571(struct e1000_hw *hw) in e1000_release_nvm_82571() argument
695 e1000e_release_nvm(hw); in e1000_release_nvm_82571()
696 e1000_put_hw_semaphore_82571(hw); in e1000_release_nvm_82571()
711 static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, in e1000_write_nvm_82571() argument
716 switch (hw->mac.type) { in e1000_write_nvm_82571()
720 ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data); in e1000_write_nvm_82571()
724 ret_val = e1000e_write_nvm_spi(hw, offset, words, data); in e1000_write_nvm_82571()
742 static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) in e1000_update_nvm_checksum_82571() argument
748 ret_val = e1000e_update_nvm_checksum_generic(hw); in e1000_update_nvm_checksum_82571()
755 if (hw->nvm.type != e1000_nvm_flash_hw) in e1000_update_nvm_checksum_82571()
801 static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw) in e1000_validate_nvm_checksum_82571() argument
803 if (hw->nvm.type == e1000_nvm_flash_hw) in e1000_validate_nvm_checksum_82571()
804 e1000_fix_nvm_checksum_82571(hw); in e1000_validate_nvm_checksum_82571()
806 return e1000e_validate_nvm_checksum_generic(hw); in e1000_validate_nvm_checksum_82571()
823 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, in e1000_write_nvm_eewr_82571() argument
826 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_write_nvm_eewr_82571()
844 ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE); in e1000_write_nvm_eewr_82571()
850 ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE); in e1000_write_nvm_eewr_82571()
864 static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) in e1000_get_cfg_done_82571() argument
893 static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) in e1000_set_d0_lplu_state_82571() argument
895 struct e1000_phy_info *phy = &hw->phy; in e1000_set_d0_lplu_state_82571()
899 ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data); in e1000_set_d0_lplu_state_82571()
905 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000_set_d0_lplu_state_82571()
910 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data); in e1000_set_d0_lplu_state_82571()
914 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data); in e1000_set_d0_lplu_state_82571()
919 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000_set_d0_lplu_state_82571()
926 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
932 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
937 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
943 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d0_lplu_state_82571()
959 static s32 e1000_reset_hw_82571(struct e1000_hw *hw) in e1000_reset_hw_82571() argument
967 ret_val = e1000e_disable_pcie_master(hw); in e1000_reset_hw_82571()
985 switch (hw->mac.type) { in e1000_reset_hw_82571()
987 ret_val = e1000_get_hw_semaphore_82573(hw); in e1000_reset_hw_82571()
991 ret_val = e1000_get_hw_semaphore_82574(hw); in e1000_reset_hw_82571()
1003 switch (hw->mac.type) { in e1000_reset_hw_82571()
1007 e1000_put_hw_semaphore_82573(hw); in e1000_reset_hw_82571()
1013 e1000_put_hw_semaphore_82574(hw); in e1000_reset_hw_82571()
1019 if (hw->nvm.type == e1000_nvm_flash_hw) { in e1000_reset_hw_82571()
1027 ret_val = e1000e_get_auto_rd_done(hw); in e1000_reset_hw_82571()
1037 switch (hw->mac.type) { in e1000_reset_hw_82571()
1060 if (hw->mac.type == e1000_82571) { in e1000_reset_hw_82571()
1062 ret_val = e1000_check_alt_mac_addr_generic(hw); in e1000_reset_hw_82571()
1066 e1000e_set_laa_state_82571(hw, true); in e1000_reset_hw_82571()
1070 if (hw->phy.media_type == e1000_media_type_internal_serdes) in e1000_reset_hw_82571()
1071 hw->mac.serdes_link_state = e1000_serdes_link_down; in e1000_reset_hw_82571()
1082 static s32 e1000_init_hw_82571(struct e1000_hw *hw) in e1000_init_hw_82571() argument
1084 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82571()
1089 e1000_initialize_hw_bits_82571(hw); in e1000_init_hw_82571()
1092 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_82571()
1099 mac->ops.clear_vfta(hw); in e1000_init_hw_82571()
1106 if (e1000e_get_laa_state_82571(hw)) in e1000_init_hw_82571()
1108 e1000e_init_rx_addrs(hw, rar_count); in e1000_init_hw_82571()
1113 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); in e1000_init_hw_82571()
1116 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82571()
1127 e1000e_enable_tx_pkt_filtering(hw); in e1000_init_hw_82571()
1149 e1000_clear_hw_cntrs_82571(hw); in e1000_init_hw_82571()
1160 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) in e1000_initialize_hw_bits_82571() argument
1177 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1193 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1209 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1222 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1235 if (hw->mac.type == e1000_82571) { in e1000_initialize_hw_bits_82571()
1244 if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) { in e1000_initialize_hw_bits_82571()
1253 if (hw->mac.type <= e1000_82573) { in e1000_initialize_hw_bits_82571()
1260 switch (hw->mac.type) { in e1000_initialize_hw_bits_82571()
1289 static void e1000_clear_vfta_82571(struct e1000_hw *hw) in e1000_clear_vfta_82571() argument
1296 switch (hw->mac.type) { in e1000_clear_vfta_82571()
1300 if (hw->mng_cookie.vlan_id != 0) { in e1000_clear_vfta_82571()
1307 vfta_offset = (hw->mng_cookie.vlan_id >> in e1000_clear_vfta_82571()
1311 1 << (hw->mng_cookie.vlan_id & in e1000_clear_vfta_82571()
1324 E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value); in e1000_clear_vfta_82571()
1336 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) in e1000_check_mng_mode_82574() argument
1340 e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data); in e1000_check_mng_mode_82574()
1350 static s32 e1000_led_on_82574(struct e1000_hw *hw) in e1000_led_on_82574() argument
1355 ctrl = hw->mac.ledctl_mode2; in e1000_led_on_82574()
1361 if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == in e1000_led_on_82574()
1376 bool e1000_check_phy_82574(struct e1000_hw *hw) in e1000_check_phy_82574() argument
1385 ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); in e1000_check_phy_82574()
1389 ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt); in e1000_check_phy_82574()
1410 static s32 e1000_setup_link_82571(struct e1000_hw *hw) in e1000_setup_link_82571() argument
1416 switch (hw->mac.type) { in e1000_setup_link_82571()
1420 if (hw->fc.requested_mode == e1000_fc_default) in e1000_setup_link_82571()
1421 hw->fc.requested_mode = e1000_fc_full; in e1000_setup_link_82571()
1427 return e1000e_setup_link_generic(hw); in e1000_setup_link_82571()
1438 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) in e1000_setup_copper_link_82571() argument
1448 switch (hw->phy.type) { in e1000_setup_copper_link_82571()
1451 ret_val = e1000e_copper_link_setup_m88(hw); in e1000_setup_copper_link_82571()
1454 ret_val = e1000e_copper_link_setup_igp(hw); in e1000_setup_copper_link_82571()
1463 return e1000e_setup_copper_link(hw); in e1000_setup_copper_link_82571()
1473 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw) in e1000_setup_fiber_serdes_link_82571() argument
1475 switch (hw->mac.type) { in e1000_setup_fiber_serdes_link_82571()
1490 return e1000e_setup_fiber_serdes_link(hw); in e1000_setup_fiber_serdes_link_82571()
1512 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) in e1000_check_for_serdes_link_82571() argument
1514 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_serdes_link_82571()
1592 ret_val = e1000e_config_fc_after_link_up(hw); in e1000_check_for_serdes_link_82571()
1667 static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) in e1000_valid_led_default_82571() argument
1671 ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); in e1000_valid_led_default_82571()
1677 switch (hw->mac.type) { in e1000_valid_led_default_82571()
1700 bool e1000e_get_laa_state_82571(struct e1000_hw *hw) in e1000e_get_laa_state_82571() argument
1702 if (hw->mac.type != e1000_82571) in e1000e_get_laa_state_82571()
1705 return hw->dev_spec.e82571.laa_is_present; in e1000e_get_laa_state_82571()
1715 void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state) in e1000e_set_laa_state_82571() argument
1717 if (hw->mac.type != e1000_82571) in e1000e_set_laa_state_82571()
1720 hw->dev_spec.e82571.laa_is_present = state; in e1000e_set_laa_state_82571()
1730 hw->mac.ops.rar_set(hw, hw->mac.addr, in e1000e_set_laa_state_82571()
1731 hw->mac.rar_entry_count - 1); in e1000e_set_laa_state_82571()
1744 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) in e1000_fix_nvm_checksum_82571() argument
1746 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_fix_nvm_checksum_82571()
1756 ret_val = e1000_read_nvm(hw, 0x10, 1, &data); in e1000_fix_nvm_checksum_82571()
1768 ret_val = e1000_read_nvm(hw, 0x23, 1, &data); in e1000_fix_nvm_checksum_82571()
1774 ret_val = e1000_write_nvm(hw, 0x23, 1, &data); in e1000_fix_nvm_checksum_82571()
1777 ret_val = e1000e_update_nvm_checksum(hw); in e1000_fix_nvm_checksum_82571()
1790 static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) in e1000_read_mac_addr_82571() argument
1792 if (hw->mac.type == e1000_82571) { in e1000_read_mac_addr_82571()
1799 ret_val = e1000_check_alt_mac_addr_generic(hw); in e1000_read_mac_addr_82571()
1804 return e1000_read_mac_addr_generic(hw); in e1000_read_mac_addr_82571()
1814 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw) in e1000_power_down_phy_copper_82571() argument
1816 struct e1000_phy_info *phy = &hw->phy; in e1000_power_down_phy_copper_82571()
1817 struct e1000_mac_info *mac = &hw->mac; in e1000_power_down_phy_copper_82571()
1823 if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw))) in e1000_power_down_phy_copper_82571()
1824 e1000_power_down_phy_copper(hw); in e1000_power_down_phy_copper_82571()
1833 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) in e1000_clear_hw_cntrs_82571() argument
1835 e1000e_clear_hw_cntrs_base(hw); in e1000_clear_hw_cntrs_82571()