Lines Matching refs:hw

63 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
64 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
65 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
66 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw);
67 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
69 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
70 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
71 static s32 e1000_setup_link_82571(struct e1000_hw *hw);
72 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
73 static void e1000_clear_vfta_82571(struct e1000_hw *hw);
74 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
75 static s32 e1000_led_on_82574(struct e1000_hw *hw);
76 static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
77 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
78 static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
79 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
80 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
81 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active);
82 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active);
86 * @hw: pointer to the HW structure
88 static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
90 struct e1000_phy_info *phy = &hw->phy;
93 if (hw->phy.media_type != e1000_media_type_copper) {
105 switch (hw->mac.type) {
127 ret_val = e1000_get_phy_id_82571(hw);
134 switch (hw->mac.type) {
162 * @hw: pointer to the HW structure
164 static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
166 struct e1000_nvm_info *nvm = &hw->nvm;
187 switch (hw->mac.type) {
221 switch (hw->mac.type) {
236 * @hw: pointer to the HW structure
238 static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
240 struct e1000_mac_info *mac = &hw->mac;
246 switch (hw->adapter->pdev->device) {
250 hw->phy.media_type = e1000_media_type_fiber;
261 hw->phy.media_type = e1000_media_type_internal_serdes;
269 hw->phy.media_type = e1000_media_type_copper;
285 switch (hw->mac.type) {
325 switch (hw->mac.type) {
360 hw->dev_spec.e82571.smb_counter = 0;
367 struct e1000_hw *hw = &adapter->hw;
373 rc = e1000_init_mac_params_82571(hw);
377 rc = e1000_init_nvm_params_82571(hw);
381 rc = e1000_init_phy_params_82571(hw);
404 switch (adapter->hw.mac.type) {
435 * @hw: pointer to the HW structure
440 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
442 struct e1000_phy_info *phy = &hw->phy;
446 switch (hw->mac.type) {
458 return e1000e_get_phy_id(hw);
462 ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
468 ret_val = e1e_rphy(hw, PHY_ID2, &phy_id);
485 * @hw: pointer to the HW structure
489 static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
492 s32 sw_timeout = hw->nvm.word_size + 1;
493 s32 fw_timeout = hw->nvm.word_size + 1;
504 if (hw->dev_spec.e82571.smb_counter > 2)
519 hw->dev_spec.e82571.smb_counter++;
535 e1000_put_hw_semaphore_82571(hw);
545 * @hw: pointer to the HW structure
549 static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw)
559 * @hw: pointer to the HW structure
564 static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
586 e1000_put_hw_semaphore_82573(hw);
596 * @hw: pointer to the HW structure
601 static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw)
614 * @hw: pointer to the HW structure
619 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw)
624 ret_val = e1000_get_hw_semaphore_82573(hw);
632 * @hw: pointer to the HW structure
637 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw)
639 e1000_put_hw_semaphore_82573(hw);
645 * @hw: pointer to the HW structure
655 static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active)
670 * @hw: pointer to the HW structure
679 static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active)
685 } else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
686 (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) ||
687 (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) {
697 * @hw: pointer to the HW structure
704 static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
708 ret_val = e1000_get_hw_semaphore_82571(hw);
712 switch (hw->mac.type) {
716 ret_val = e1000e_acquire_nvm(hw);
721 e1000_put_hw_semaphore_82571(hw);
728 * @hw: pointer to the HW structure
732 static void e1000_release_nvm_82571(struct e1000_hw *hw)
734 e1000e_release_nvm(hw);
735 e1000_put_hw_semaphore_82571(hw);
740 * @hw: pointer to the HW structure
750 static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
755 switch (hw->mac.type) {
759 ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
763 ret_val = e1000e_write_nvm_spi(hw, offset, words, data);
775 * @hw: pointer to the HW structure
781 static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
787 ret_val = e1000e_update_nvm_checksum_generic(hw);
795 if (hw->nvm.type != e1000_nvm_flash_hw)
837 * @hw: pointer to the HW structure
842 static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
844 if (hw->nvm.type == e1000_nvm_flash_hw)
845 e1000_fix_nvm_checksum_82571(hw);
847 return e1000e_validate_nvm_checksum_generic(hw);
852 * @hw: pointer to the HW structure
864 static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
867 struct e1000_nvm_info *nvm = &hw->nvm;
886 ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
892 ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
902 * @hw: pointer to the HW structure
906 static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
927 * @hw: pointer to the HW structure
936 static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
938 struct e1000_phy_info *phy = &hw->phy;
942 ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
948 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
953 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
955 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
960 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
968 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
974 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
979 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
985 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
997 * @hw: pointer to the HW structure
1001 static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
1010 ret_val = e1000e_disable_pcie_master(hw);
1027 switch (hw->mac.type) {
1029 ret_val = e1000_get_hw_semaphore_82573(hw);
1033 ret_val = e1000_get_hw_semaphore_82574(hw);
1047 switch (hw->mac.type) {
1050 e1000_put_hw_semaphore_82574(hw);
1056 if (hw->nvm.type == e1000_nvm_flash_hw) {
1064 ret_val = e1000e_get_auto_rd_done(hw);
1075 switch (hw->mac.type) {
1089 if (hw->mac.type == e1000_82571) {
1091 ret_val = e1000_check_alt_mac_addr_generic(hw);
1095 e1000e_set_laa_state_82571(hw, true);
1099 if (hw->phy.media_type == e1000_media_type_internal_serdes)
1100 hw->mac.serdes_link_state = e1000_serdes_link_down;
1107 * @hw: pointer to the HW structure
1111 static s32 e1000_init_hw_82571(struct e1000_hw *hw)
1113 struct e1000_mac_info *mac = &hw->mac;
1118 e1000_initialize_hw_bits_82571(hw);
1121 ret_val = mac->ops.id_led_init(hw);
1128 mac->ops.clear_vfta(hw);
1136 if (e1000e_get_laa_state_82571(hw))
1138 e1000e_init_rx_addrs(hw, rar_count);
1143 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
1146 ret_val = mac->ops.setup_link(hw);
1158 e1000e_enable_tx_pkt_filtering(hw);
1181 e1000_clear_hw_cntrs_82571(hw);
1188 * @hw: pointer to the HW structure
1192 static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
1209 switch (hw->mac.type) {
1225 switch (hw->mac.type) {
1241 switch (hw->mac.type) {
1254 switch (hw->mac.type) {
1267 if (hw->mac.type == e1000_82571) {
1277 if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) {
1284 switch (hw->mac.type) {
1309 * @hw: pointer to the HW structure
1314 static void e1000_clear_vfta_82571(struct e1000_hw *hw)
1321 switch (hw->mac.type) {
1325 if (hw->mng_cookie.vlan_id != 0) {
1333 vfta_offset = (hw->mng_cookie.vlan_id >>
1336 vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
1350 E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value);
1357 * @hw: pointer to the HW structure
1362 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw)
1366 e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
1372 * @hw: pointer to the HW structure
1376 static s32 e1000_led_on_82574(struct e1000_hw *hw)
1381 ctrl = hw->mac.ledctl_mode2;
1388 if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
1399 * @hw: pointer to the HW structure
1403 bool e1000_check_phy_82574(struct e1000_hw *hw)
1413 ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);
1417 ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt);
1430 * @hw: pointer to the HW structure
1438 static s32 e1000_setup_link_82571(struct e1000_hw *hw)
1445 switch (hw->mac.type) {
1449 if (hw->fc.requested_mode == e1000_fc_default)
1450 hw->fc.requested_mode = e1000_fc_full;
1456 return e1000e_setup_link_generic(hw);
1461 * @hw: pointer to the HW structure
1467 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
1477 switch (hw->phy.type) {
1480 ret_val = e1000e_copper_link_setup_m88(hw);
1483 ret_val = e1000e_copper_link_setup_igp(hw);
1493 return e1000e_setup_copper_link(hw);
1498 * @hw: pointer to the HW structure
1503 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
1505 switch (hw->mac.type) {
1521 return e1000e_setup_fiber_serdes_link(hw);
1526 * @hw: pointer to the HW structure
1543 static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
1545 struct e1000_mac_info *mac = &hw->mac;
1627 ret_val = e1000e_config_fc_after_link_up(hw);
1696 * @hw: pointer to the HW structure
1702 static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
1706 ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
1712 switch (hw->mac.type) {
1731 * @hw: pointer to the HW structure
1735 bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
1737 if (hw->mac.type != e1000_82571)
1740 return hw->dev_spec.e82571.laa_is_present;
1745 * @hw: pointer to the HW structure
1750 void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state)
1752 if (hw->mac.type != e1000_82571)
1755 hw->dev_spec.e82571.laa_is_present = state;
1766 e1000e_rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1);
1771 * @hw: pointer to the HW structure
1779 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
1781 struct e1000_nvm_info *nvm = &hw->nvm;
1792 ret_val = e1000_read_nvm(hw, 0x10, 1, &data);
1805 ret_val = e1000_read_nvm(hw, 0x23, 1, &data);
1811 ret_val = e1000_write_nvm(hw, 0x23, 1, &data);
1814 ret_val = e1000e_update_nvm_checksum(hw);
1823 * @hw: pointer to the HW structure
1825 static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
1827 if (hw->mac.type == e1000_82571) {
1835 ret_val = e1000_check_alt_mac_addr_generic(hw);
1840 return e1000_read_mac_addr_generic(hw);
1845 * @hw: pointer to the HW structure
1850 static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw)
1852 struct e1000_phy_info *phy = &hw->phy;
1853 struct e1000_mac_info *mac = &hw->mac;
1859 if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw)))
1860 e1000_power_down_phy_copper(hw);
1865 * @hw: pointer to the HW structure
1869 static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
1871 e1000e_clear_hw_cntrs_base(hw);