Lines Matching refs:ret_val
382 s32 ret_val; in e1000_reset_hw() local
476 ret_val = e1000_get_auto_rd_done(hw); in e1000_reset_hw()
477 if (ret_val) in e1000_reset_hw()
478 return ret_val; in e1000_reset_hw()
529 s32 ret_val; in e1000_init_hw() local
534 ret_val = e1000_id_led_init(hw); in e1000_init_hw()
535 if (ret_val) { in e1000_init_hw()
537 return ret_val; in e1000_init_hw()
608 ret_val = e1000_setup_link(hw); in e1000_init_hw()
636 return ret_val; in e1000_init_hw()
646 s32 ret_val; in e1000_adjust_serdes_amplitude() local
659 ret_val = e1000_read_eeprom(hw, EEPROM_SERDES_AMPLITUDE, 1, in e1000_adjust_serdes_amplitude()
661 if (ret_val) in e1000_adjust_serdes_amplitude()
662 return ret_val; in e1000_adjust_serdes_amplitude()
667 ret_val = in e1000_adjust_serdes_amplitude()
669 if (ret_val) in e1000_adjust_serdes_amplitude()
670 return ret_val; in e1000_adjust_serdes_amplitude()
689 s32 ret_val; in e1000_setup_link() local
701 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, in e1000_setup_link()
703 if (ret_val) { in e1000_setup_link()
738 ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, in e1000_setup_link()
740 if (ret_val) { in e1000_setup_link()
750 ret_val = (hw->media_type == e1000_media_type_copper) ? in e1000_setup_link()
788 return ret_val; in e1000_setup_link()
806 s32 ret_val; in e1000_setup_fiber_serdes_link() local
818 ret_val = e1000_adjust_serdes_amplitude(hw); in e1000_setup_fiber_serdes_link()
819 if (ret_val) in e1000_setup_fiber_serdes_link()
820 return ret_val; in e1000_setup_fiber_serdes_link()
826 ret_val = e1000_set_vco_speed(hw); in e1000_setup_fiber_serdes_link()
827 if (ret_val) in e1000_setup_fiber_serdes_link()
828 return ret_val; in e1000_setup_fiber_serdes_link()
919 ret_val = e1000_check_for_link(hw); in e1000_setup_fiber_serdes_link()
920 if (ret_val) { in e1000_setup_fiber_serdes_link()
922 return ret_val; in e1000_setup_fiber_serdes_link()
943 s32 ret_val; in e1000_copper_link_rtl_setup() local
946 ret_val = e1000_phy_reset(hw); in e1000_copper_link_rtl_setup()
947 if (ret_val) { in e1000_copper_link_rtl_setup()
949 return ret_val; in e1000_copper_link_rtl_setup()
957 s32 ret_val; in gbe_dhg_phy_setup() local
962 ret_val = e1000_copper_link_rtl_setup(hw); in gbe_dhg_phy_setup()
963 if (ret_val) { in gbe_dhg_phy_setup()
965 return ret_val; in gbe_dhg_phy_setup()
981 ret_val = e1000_copper_link_rtl_setup(hw); in gbe_dhg_phy_setup()
983 if (ret_val) { in gbe_dhg_phy_setup()
985 return ret_val; in gbe_dhg_phy_setup()
1005 s32 ret_val; in e1000_copper_link_preconfig() local
1021 ret_val = e1000_phy_hw_reset(hw); in e1000_copper_link_preconfig()
1022 if (ret_val) in e1000_copper_link_preconfig()
1023 return ret_val; in e1000_copper_link_preconfig()
1027 ret_val = e1000_detect_gig_phy(hw); in e1000_copper_link_preconfig()
1028 if (ret_val) { in e1000_copper_link_preconfig()
1030 return ret_val; in e1000_copper_link_preconfig()
1035 ret_val = e1000_set_phy_mode(hw); in e1000_copper_link_preconfig()
1036 if (ret_val) in e1000_copper_link_preconfig()
1037 return ret_val; in e1000_copper_link_preconfig()
1041 ret_val = in e1000_copper_link_preconfig()
1044 ret_val = in e1000_copper_link_preconfig()
1064 s32 ret_val; in e1000_copper_link_igp_setup() local
1070 ret_val = e1000_phy_reset(hw); in e1000_copper_link_igp_setup()
1071 if (ret_val) { in e1000_copper_link_igp_setup()
1073 return ret_val; in e1000_copper_link_igp_setup()
1087 ret_val = e1000_set_d3_lplu_state(hw, false); in e1000_copper_link_igp_setup()
1088 if (ret_val) { in e1000_copper_link_igp_setup()
1090 return ret_val; in e1000_copper_link_igp_setup()
1095 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data); in e1000_copper_link_igp_setup()
1096 if (ret_val) in e1000_copper_link_igp_setup()
1097 return ret_val; in e1000_copper_link_igp_setup()
1124 ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data); in e1000_copper_link_igp_setup()
1125 if (ret_val) in e1000_copper_link_igp_setup()
1126 return ret_val; in e1000_copper_link_igp_setup()
1144 ret_val = in e1000_copper_link_igp_setup()
1147 if (ret_val) in e1000_copper_link_igp_setup()
1148 return ret_val; in e1000_copper_link_igp_setup()
1150 ret_val = in e1000_copper_link_igp_setup()
1153 if (ret_val) in e1000_copper_link_igp_setup()
1154 return ret_val; in e1000_copper_link_igp_setup()
1156 ret_val = in e1000_copper_link_igp_setup()
1158 if (ret_val) in e1000_copper_link_igp_setup()
1159 return ret_val; in e1000_copper_link_igp_setup()
1161 ret_val = in e1000_copper_link_igp_setup()
1163 if (ret_val) in e1000_copper_link_igp_setup()
1164 return ret_val; in e1000_copper_link_igp_setup()
1167 ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &phy_data); in e1000_copper_link_igp_setup()
1168 if (ret_val) in e1000_copper_link_igp_setup()
1169 return ret_val; in e1000_copper_link_igp_setup()
1191 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, phy_data); in e1000_copper_link_igp_setup()
1192 if (ret_val) in e1000_copper_link_igp_setup()
1193 return ret_val; in e1000_copper_link_igp_setup()
1205 s32 ret_val; in e1000_copper_link_mgp_setup() local
1212 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000_copper_link_mgp_setup()
1213 if (ret_val) in e1000_copper_link_mgp_setup()
1214 return ret_val; in e1000_copper_link_mgp_setup()
1252 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000_copper_link_mgp_setup()
1253 if (ret_val) in e1000_copper_link_mgp_setup()
1254 return ret_val; in e1000_copper_link_mgp_setup()
1260 ret_val = in e1000_copper_link_mgp_setup()
1263 if (ret_val) in e1000_copper_link_mgp_setup()
1264 return ret_val; in e1000_copper_link_mgp_setup()
1273 ret_val = e1000_write_phy_reg(hw, in e1000_copper_link_mgp_setup()
1276 if (ret_val) in e1000_copper_link_mgp_setup()
1277 return ret_val; in e1000_copper_link_mgp_setup()
1284 ret_val = e1000_write_phy_reg(hw, in e1000_copper_link_mgp_setup()
1287 if (ret_val) in e1000_copper_link_mgp_setup()
1288 return ret_val; in e1000_copper_link_mgp_setup()
1293 ret_val = e1000_phy_reset(hw); in e1000_copper_link_mgp_setup()
1294 if (ret_val) { in e1000_copper_link_mgp_setup()
1296 return ret_val; in e1000_copper_link_mgp_setup()
1311 s32 ret_val; in e1000_copper_link_autoneg() local
1330 ret_val = e1000_phy_setup_autoneg(hw); in e1000_copper_link_autoneg()
1331 if (ret_val) { in e1000_copper_link_autoneg()
1333 return ret_val; in e1000_copper_link_autoneg()
1340 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); in e1000_copper_link_autoneg()
1341 if (ret_val) in e1000_copper_link_autoneg()
1342 return ret_val; in e1000_copper_link_autoneg()
1345 ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data); in e1000_copper_link_autoneg()
1346 if (ret_val) in e1000_copper_link_autoneg()
1347 return ret_val; in e1000_copper_link_autoneg()
1353 ret_val = e1000_wait_autoneg(hw); in e1000_copper_link_autoneg()
1354 if (ret_val) { in e1000_copper_link_autoneg()
1357 return ret_val; in e1000_copper_link_autoneg()
1381 s32 ret_val; in e1000_copper_link_postconfig() local
1386 ret_val = e1000_config_mac_to_phy(hw); in e1000_copper_link_postconfig()
1387 if (ret_val) { in e1000_copper_link_postconfig()
1389 return ret_val; in e1000_copper_link_postconfig()
1392 ret_val = e1000_config_fc_after_link_up(hw); in e1000_copper_link_postconfig()
1393 if (ret_val) { in e1000_copper_link_postconfig()
1395 return ret_val; in e1000_copper_link_postconfig()
1400 ret_val = e1000_config_dsp_after_link_change(hw, true); in e1000_copper_link_postconfig()
1401 if (ret_val) { in e1000_copper_link_postconfig()
1403 return ret_val; in e1000_copper_link_postconfig()
1418 s32 ret_val; in e1000_setup_copper_link() local
1423 ret_val = e1000_copper_link_preconfig(hw); in e1000_setup_copper_link()
1424 if (ret_val) in e1000_setup_copper_link()
1425 return ret_val; in e1000_setup_copper_link()
1428 ret_val = e1000_copper_link_igp_setup(hw); in e1000_setup_copper_link()
1429 if (ret_val) in e1000_setup_copper_link()
1430 return ret_val; in e1000_setup_copper_link()
1432 ret_val = e1000_copper_link_mgp_setup(hw); in e1000_setup_copper_link()
1433 if (ret_val) in e1000_setup_copper_link()
1434 return ret_val; in e1000_setup_copper_link()
1436 ret_val = gbe_dhg_phy_setup(hw); in e1000_setup_copper_link()
1437 if (ret_val) { in e1000_setup_copper_link()
1439 return ret_val; in e1000_setup_copper_link()
1447 ret_val = e1000_copper_link_autoneg(hw); in e1000_setup_copper_link()
1448 if (ret_val) in e1000_setup_copper_link()
1449 return ret_val; in e1000_setup_copper_link()
1455 ret_val = e1000_phy_force_speed_duplex(hw); in e1000_setup_copper_link()
1456 if (ret_val) { in e1000_setup_copper_link()
1458 return ret_val; in e1000_setup_copper_link()
1466 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_setup_copper_link()
1467 if (ret_val) in e1000_setup_copper_link()
1468 return ret_val; in e1000_setup_copper_link()
1469 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_setup_copper_link()
1470 if (ret_val) in e1000_setup_copper_link()
1471 return ret_val; in e1000_setup_copper_link()
1475 ret_val = e1000_copper_link_postconfig(hw); in e1000_setup_copper_link()
1476 if (ret_val) in e1000_setup_copper_link()
1477 return ret_val; in e1000_setup_copper_link()
1497 s32 ret_val; in e1000_phy_setup_autoneg() local
1502 ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
1503 if (ret_val) in e1000_phy_setup_autoneg()
1504 return ret_val; in e1000_phy_setup_autoneg()
1507 ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg); in e1000_phy_setup_autoneg()
1508 if (ret_val) in e1000_phy_setup_autoneg()
1509 return ret_val; in e1000_phy_setup_autoneg()
1619 ret_val = e1000_write_phy_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
1620 if (ret_val) in e1000_phy_setup_autoneg()
1621 return ret_val; in e1000_phy_setup_autoneg()
1628 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, in e1000_phy_setup_autoneg()
1630 if (ret_val) in e1000_phy_setup_autoneg()
1631 return ret_val; in e1000_phy_setup_autoneg()
1646 s32 ret_val; in e1000_phy_force_speed_duplex() local
1668 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &mii_ctrl_reg); in e1000_phy_force_speed_duplex()
1669 if (ret_val) in e1000_phy_force_speed_duplex()
1670 return ret_val; in e1000_phy_force_speed_duplex()
1716 ret_val = in e1000_phy_force_speed_duplex()
1718 if (ret_val) in e1000_phy_force_speed_duplex()
1719 return ret_val; in e1000_phy_force_speed_duplex()
1725 ret_val = in e1000_phy_force_speed_duplex()
1727 if (ret_val) in e1000_phy_force_speed_duplex()
1728 return ret_val; in e1000_phy_force_speed_duplex()
1740 ret_val = in e1000_phy_force_speed_duplex()
1742 if (ret_val) in e1000_phy_force_speed_duplex()
1743 return ret_val; in e1000_phy_force_speed_duplex()
1748 ret_val = in e1000_phy_force_speed_duplex()
1750 if (ret_val) in e1000_phy_force_speed_duplex()
1751 return ret_val; in e1000_phy_force_speed_duplex()
1755 ret_val = e1000_write_phy_reg(hw, PHY_CTRL, mii_ctrl_reg); in e1000_phy_force_speed_duplex()
1756 if (ret_val) in e1000_phy_force_speed_duplex()
1757 return ret_val; in e1000_phy_force_speed_duplex()
1778 ret_val = in e1000_phy_force_speed_duplex()
1780 if (ret_val) in e1000_phy_force_speed_duplex()
1781 return ret_val; in e1000_phy_force_speed_duplex()
1783 ret_val = in e1000_phy_force_speed_duplex()
1785 if (ret_val) in e1000_phy_force_speed_duplex()
1786 return ret_val; in e1000_phy_force_speed_duplex()
1796 ret_val = e1000_phy_reset_dsp(hw); in e1000_phy_force_speed_duplex()
1797 if (ret_val) { in e1000_phy_force_speed_duplex()
1799 return ret_val; in e1000_phy_force_speed_duplex()
1812 ret_val = in e1000_phy_force_speed_duplex()
1814 if (ret_val) in e1000_phy_force_speed_duplex()
1815 return ret_val; in e1000_phy_force_speed_duplex()
1817 ret_val = in e1000_phy_force_speed_duplex()
1819 if (ret_val) in e1000_phy_force_speed_duplex()
1820 return ret_val; in e1000_phy_force_speed_duplex()
1830 ret_val = in e1000_phy_force_speed_duplex()
1833 if (ret_val) in e1000_phy_force_speed_duplex()
1834 return ret_val; in e1000_phy_force_speed_duplex()
1837 ret_val = in e1000_phy_force_speed_duplex()
1840 if (ret_val) in e1000_phy_force_speed_duplex()
1841 return ret_val; in e1000_phy_force_speed_duplex()
1847 ret_val = in e1000_phy_force_speed_duplex()
1849 if (ret_val) in e1000_phy_force_speed_duplex()
1850 return ret_val; in e1000_phy_force_speed_duplex()
1853 ret_val = in e1000_phy_force_speed_duplex()
1855 if (ret_val) in e1000_phy_force_speed_duplex()
1856 return ret_val; in e1000_phy_force_speed_duplex()
1863 ret_val = e1000_polarity_reversal_workaround(hw); in e1000_phy_force_speed_duplex()
1864 if (ret_val) in e1000_phy_force_speed_duplex()
1865 return ret_val; in e1000_phy_force_speed_duplex()
1908 s32 ret_val; in e1000_config_mac_to_phy() local
1926 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); in e1000_config_mac_to_phy()
1927 if (ret_val) in e1000_config_mac_to_phy()
1928 return ret_val; in e1000_config_mac_to_phy()
1946 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, in e1000_config_mac_to_phy()
1948 if (ret_val) in e1000_config_mac_to_phy()
1949 return ret_val; in e1000_config_mac_to_phy()
2050 s32 ret_val; in e1000_config_fc_after_link_up() local
2067 ret_val = e1000_force_mac_fc(hw); in e1000_config_fc_after_link_up()
2068 if (ret_val) { in e1000_config_fc_after_link_up()
2070 return ret_val; in e1000_config_fc_after_link_up()
2084 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_config_fc_after_link_up()
2085 if (ret_val) in e1000_config_fc_after_link_up()
2086 return ret_val; in e1000_config_fc_after_link_up()
2087 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_config_fc_after_link_up()
2088 if (ret_val) in e1000_config_fc_after_link_up()
2089 return ret_val; in e1000_config_fc_after_link_up()
2098 ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, in e1000_config_fc_after_link_up()
2100 if (ret_val) in e1000_config_fc_after_link_up()
2101 return ret_val; in e1000_config_fc_after_link_up()
2102 ret_val = e1000_read_phy_reg(hw, PHY_LP_ABILITY, in e1000_config_fc_after_link_up()
2104 if (ret_val) in e1000_config_fc_after_link_up()
2105 return ret_val; in e1000_config_fc_after_link_up()
2229 ret_val = in e1000_config_fc_after_link_up()
2231 if (ret_val) { in e1000_config_fc_after_link_up()
2234 return ret_val; in e1000_config_fc_after_link_up()
2243 ret_val = e1000_force_mac_fc(hw); in e1000_config_fc_after_link_up()
2244 if (ret_val) { in e1000_config_fc_after_link_up()
2247 return ret_val; in e1000_config_fc_after_link_up()
2269 s32 ret_val = E1000_SUCCESS; in e1000_check_for_serdes_link_generic() local
2298 ret_val = e1000_config_fc_after_link_up(hw); in e1000_check_for_serdes_link_generic()
2299 if (ret_val) { in e1000_check_for_serdes_link_generic()
2360 return ret_val; in e1000_check_for_serdes_link_generic()
2375 s32 ret_val; in e1000_check_for_link() local
2407 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_check_for_link()
2408 if (ret_val) in e1000_check_for_link()
2409 return ret_val; in e1000_check_for_link()
2410 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_check_for_link()
2411 if (ret_val) in e1000_check_for_link()
2412 return ret_val; in e1000_check_for_link()
2436 ret_val = in e1000_check_for_link()
2470 ret_val = e1000_config_mac_to_phy(hw); in e1000_check_for_link()
2471 if (ret_val) { in e1000_check_for_link()
2474 return ret_val; in e1000_check_for_link()
2483 ret_val = e1000_config_fc_after_link_up(hw); in e1000_check_for_link()
2484 if (ret_val) { in e1000_check_for_link()
2486 return ret_val; in e1000_check_for_link()
2500 ret_val = in e1000_check_for_link()
2503 if (ret_val) { in e1000_check_for_link()
2506 return ret_val; in e1000_check_for_link()
2556 s32 ret_val; in e1000_get_speed_and_duplex() local
2590 ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_EXP, &phy_data); in e1000_get_speed_and_duplex()
2591 if (ret_val) in e1000_get_speed_and_duplex()
2592 return ret_val; in e1000_get_speed_and_duplex()
2597 ret_val = in e1000_get_speed_and_duplex()
2599 if (ret_val) in e1000_get_speed_and_duplex()
2600 return ret_val; in e1000_get_speed_and_duplex()
2620 s32 ret_val; in e1000_wait_autoneg() local
2631 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_wait_autoneg()
2632 if (ret_val) in e1000_wait_autoneg()
2633 return ret_val; in e1000_wait_autoneg()
2634 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_wait_autoneg()
2635 if (ret_val) in e1000_wait_autoneg()
2636 return ret_val; in e1000_wait_autoneg()
2787 u32 ret_val; in e1000_read_phy_reg() local
2794 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, in e1000_read_phy_reg()
2796 if (ret_val) in e1000_read_phy_reg()
2800 ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, in e1000_read_phy_reg()
2805 return ret_val; in e1000_read_phy_reg()
2924 u32 ret_val; in e1000_write_phy_reg() local
2931 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, in e1000_write_phy_reg()
2933 if (ret_val) { in e1000_write_phy_reg()
2935 return ret_val; in e1000_write_phy_reg()
2939 ret_val = e1000_write_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, in e1000_write_phy_reg()
2943 return ret_val; in e1000_write_phy_reg()
3099 s32 ret_val; in e1000_phy_reset() local
3104 ret_val = e1000_phy_hw_reset(hw); in e1000_phy_reset()
3105 if (ret_val) in e1000_phy_reset()
3106 return ret_val; in e1000_phy_reset()
3109 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); in e1000_phy_reset()
3110 if (ret_val) in e1000_phy_reset()
3111 return ret_val; in e1000_phy_reset()
3114 ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data); in e1000_phy_reset()
3115 if (ret_val) in e1000_phy_reset()
3116 return ret_val; in e1000_phy_reset()
3136 s32 phy_init_status, ret_val; in e1000_detect_gig_phy() local
3144 ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high); in e1000_detect_gig_phy()
3145 if (ret_val) in e1000_detect_gig_phy()
3146 return ret_val; in e1000_detect_gig_phy()
3150 ret_val = e1000_read_phy_reg(hw, PHY_ID2, &phy_id_low); in e1000_detect_gig_phy()
3151 if (ret_val) in e1000_detect_gig_phy()
3152 return ret_val; in e1000_detect_gig_phy()
3209 s32 ret_val; in e1000_phy_reset_dsp() local
3212 ret_val = e1000_write_phy_reg(hw, 29, 0x001d); in e1000_phy_reset_dsp()
3213 if (ret_val) in e1000_phy_reset_dsp()
3215 ret_val = e1000_write_phy_reg(hw, 30, 0x00c1); in e1000_phy_reset_dsp()
3216 if (ret_val) in e1000_phy_reset_dsp()
3218 ret_val = e1000_write_phy_reg(hw, 30, 0x0000); in e1000_phy_reset_dsp()
3219 if (ret_val) in e1000_phy_reset_dsp()
3221 ret_val = E1000_SUCCESS; in e1000_phy_reset_dsp()
3224 return ret_val; in e1000_phy_reset_dsp()
3237 s32 ret_val; in e1000_phy_igp_get_info() local
3253 ret_val = e1000_check_polarity(hw, &polarity); in e1000_phy_igp_get_info()
3254 if (ret_val) in e1000_phy_igp_get_info()
3255 return ret_val; in e1000_phy_igp_get_info()
3259 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, &phy_data); in e1000_phy_igp_get_info()
3260 if (ret_val) in e1000_phy_igp_get_info()
3261 return ret_val; in e1000_phy_igp_get_info()
3271 ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data); in e1000_phy_igp_get_info()
3272 if (ret_val) in e1000_phy_igp_get_info()
3273 return ret_val; in e1000_phy_igp_get_info()
3283 ret_val = e1000_get_cable_length(hw, &min_length, &max_length); in e1000_phy_igp_get_info()
3284 if (ret_val) in e1000_phy_igp_get_info()
3285 return ret_val; in e1000_phy_igp_get_info()
3315 s32 ret_val; in e1000_phy_m88_get_info() local
3324 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000_phy_m88_get_info()
3325 if (ret_val) in e1000_phy_m88_get_info()
3326 return ret_val; in e1000_phy_m88_get_info()
3338 ret_val = e1000_check_polarity(hw, &polarity); in e1000_phy_m88_get_info()
3339 if (ret_val) in e1000_phy_m88_get_info()
3340 return ret_val; in e1000_phy_m88_get_info()
3343 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000_phy_m88_get_info()
3344 if (ret_val) in e1000_phy_m88_get_info()
3345 return ret_val; in e1000_phy_m88_get_info()
3358 ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data); in e1000_phy_m88_get_info()
3359 if (ret_val) in e1000_phy_m88_get_info()
3360 return ret_val; in e1000_phy_m88_get_info()
3382 s32 ret_val; in e1000_phy_get_info() local
3399 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_phy_get_info()
3400 if (ret_val) in e1000_phy_get_info()
3401 return ret_val; in e1000_phy_get_info()
3403 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data); in e1000_phy_get_info()
3404 if (ret_val) in e1000_phy_get_info()
3405 return ret_val; in e1000_phy_get_info()
3442 s32 ret_val = E1000_SUCCESS; in e1000_init_eeprom_params() local
3510 ret_val = e1000_read_eeprom(hw, EEPROM_CFG, 1, &eeprom_size); in e1000_init_eeprom_params()
3511 if (ret_val) in e1000_init_eeprom_params()
3512 return ret_val; in e1000_init_eeprom_params()
3524 return ret_val; in e1000_init_eeprom_params()
4486 s32 ret_val = E1000_SUCCESS; in e1000_setup_led() local
4500 ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, in e1000_setup_led()
4502 if (ret_val) in e1000_setup_led()
4503 return ret_val; in e1000_setup_led()
4504 ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, in e1000_setup_led()
4507 if (ret_val) in e1000_setup_led()
4508 return ret_val; in e1000_setup_led()
4536 s32 ret_val = E1000_SUCCESS; in e1000_cleanup_led() local
4550 ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, in e1000_cleanup_led()
4552 if (ret_val) in e1000_cleanup_led()
4553 return ret_val; in e1000_cleanup_led()
4877 s32 ret_val; in e1000_get_cable_length() local
4886 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, in e1000_get_cable_length()
4888 if (ret_val) in e1000_get_cable_length()
4889 return ret_val; in e1000_get_cable_length()
4928 ret_val = in e1000_get_cable_length()
4930 if (ret_val) in e1000_get_cable_length()
4931 return ret_val; in e1000_get_cable_length()
4990 s32 ret_val; in e1000_check_polarity() local
4995 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, in e1000_check_polarity()
4997 if (ret_val) in e1000_check_polarity()
4998 return ret_val; in e1000_check_polarity()
5004 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, in e1000_check_polarity()
5006 if (ret_val) in e1000_check_polarity()
5007 return ret_val; in e1000_check_polarity()
5015 ret_val = in e1000_check_polarity()
5018 if (ret_val) in e1000_check_polarity()
5019 return ret_val; in e1000_check_polarity()
5052 s32 ret_val; in e1000_check_downshift() local
5056 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, in e1000_check_downshift()
5058 if (ret_val) in e1000_check_downshift()
5059 return ret_val; in e1000_check_downshift()
5064 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, in e1000_check_downshift()
5066 if (ret_val) in e1000_check_downshift()
5067 return ret_val; in e1000_check_downshift()
5087 s32 ret_val; in e1000_1000Mb_check_cable_length() local
5089 ret_val = e1000_get_cable_length(hw, &min_length, &max_length); in e1000_1000Mb_check_cable_length()
5090 if (ret_val) in e1000_1000Mb_check_cable_length()
5091 return ret_val; in e1000_1000Mb_check_cable_length()
5098 ret_val = e1000_read_phy_reg(hw, dsp_reg_array[i], in e1000_1000Mb_check_cable_length()
5100 if (ret_val) in e1000_1000Mb_check_cable_length()
5101 return ret_val; in e1000_1000Mb_check_cable_length()
5105 ret_val = e1000_write_phy_reg(hw, dsp_reg_array[i], in e1000_1000Mb_check_cable_length()
5107 if (ret_val) in e1000_1000Mb_check_cable_length()
5108 return ret_val; in e1000_1000Mb_check_cable_length()
5116 ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data); in e1000_1000Mb_check_cable_length()
5117 if (ret_val) in e1000_1000Mb_check_cable_length()
5118 return ret_val; in e1000_1000Mb_check_cable_length()
5122 ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, in e1000_1000Mb_check_cable_length()
5124 if (ret_val) in e1000_1000Mb_check_cable_length()
5125 return ret_val; in e1000_1000Mb_check_cable_length()
5131 ret_val = e1000_write_phy_reg(hw, in e1000_1000Mb_check_cable_length()
5134 if (ret_val) in e1000_1000Mb_check_cable_length()
5135 return ret_val; in e1000_1000Mb_check_cable_length()
5162 s32 ret_val; in e1000_config_dsp_after_link_change() local
5169 ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex); in e1000_config_dsp_after_link_change()
5170 if (ret_val) { in e1000_config_dsp_after_link_change()
5172 return ret_val; in e1000_config_dsp_after_link_change()
5176 ret_val = e1000_1000Mb_check_cable_length(hw); in e1000_config_dsp_after_link_change()
5177 if (ret_val) in e1000_config_dsp_after_link_change()
5178 return ret_val; in e1000_config_dsp_after_link_change()
5185 ret_val = in e1000_config_dsp_after_link_change()
5188 if (ret_val) in e1000_config_dsp_after_link_change()
5189 return ret_val; in e1000_config_dsp_after_link_change()
5192 ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); in e1000_config_dsp_after_link_change()
5194 if (ret_val) in e1000_config_dsp_after_link_change()
5195 return ret_val; in e1000_config_dsp_after_link_change()
5199 ret_val = e1000_write_phy_reg(hw, 0x0000, in e1000_config_dsp_after_link_change()
5201 if (ret_val) in e1000_config_dsp_after_link_change()
5202 return ret_val; in e1000_config_dsp_after_link_change()
5204 ret_val = in e1000_config_dsp_after_link_change()
5207 if (ret_val) in e1000_config_dsp_after_link_change()
5208 return ret_val; in e1000_config_dsp_after_link_change()
5213 ret_val = in e1000_config_dsp_after_link_change()
5216 if (ret_val) in e1000_config_dsp_after_link_change()
5217 return ret_val; in e1000_config_dsp_after_link_change()
5220 ret_val = e1000_write_phy_reg(hw, 0x0000, in e1000_config_dsp_after_link_change()
5222 if (ret_val) in e1000_config_dsp_after_link_change()
5223 return ret_val; in e1000_config_dsp_after_link_change()
5228 ret_val = in e1000_config_dsp_after_link_change()
5231 if (ret_val) in e1000_config_dsp_after_link_change()
5232 return ret_val; in e1000_config_dsp_after_link_change()
5241 ret_val = in e1000_config_dsp_after_link_change()
5244 if (ret_val) in e1000_config_dsp_after_link_change()
5245 return ret_val; in e1000_config_dsp_after_link_change()
5248 ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); in e1000_config_dsp_after_link_change()
5250 if (ret_val) in e1000_config_dsp_after_link_change()
5251 return ret_val; in e1000_config_dsp_after_link_change()
5255 ret_val = e1000_write_phy_reg(hw, 0x0000, in e1000_config_dsp_after_link_change()
5257 if (ret_val) in e1000_config_dsp_after_link_change()
5258 return ret_val; in e1000_config_dsp_after_link_change()
5259 ret_val = in e1000_config_dsp_after_link_change()
5262 if (ret_val) in e1000_config_dsp_after_link_change()
5263 return ret_val; in e1000_config_dsp_after_link_change()
5265 ret_val = e1000_write_phy_reg(hw, 0x0000, in e1000_config_dsp_after_link_change()
5267 if (ret_val) in e1000_config_dsp_after_link_change()
5268 return ret_val; in e1000_config_dsp_after_link_change()
5273 ret_val = in e1000_config_dsp_after_link_change()
5276 if (ret_val) in e1000_config_dsp_after_link_change()
5277 return ret_val; in e1000_config_dsp_after_link_change()
5295 s32 ret_val; in e1000_set_phy_mode() local
5300 ret_val = in e1000_set_phy_mode()
5303 if (ret_val) in e1000_set_phy_mode()
5304 return ret_val; in e1000_set_phy_mode()
5308 ret_val = in e1000_set_phy_mode()
5311 if (ret_val) in e1000_set_phy_mode()
5312 return ret_val; in e1000_set_phy_mode()
5313 ret_val = in e1000_set_phy_mode()
5316 if (ret_val) in e1000_set_phy_mode()
5317 return ret_val; in e1000_set_phy_mode()
5341 s32 ret_val; in e1000_set_d3_lplu_state() local
5353 ret_val = in e1000_set_d3_lplu_state()
5355 if (ret_val) in e1000_set_d3_lplu_state()
5356 return ret_val; in e1000_set_d3_lplu_state()
5363 ret_val = in e1000_set_d3_lplu_state()
5366 if (ret_val) in e1000_set_d3_lplu_state()
5367 return ret_val; in e1000_set_d3_lplu_state()
5376 ret_val = in e1000_set_d3_lplu_state()
5379 if (ret_val) in e1000_set_d3_lplu_state()
5380 return ret_val; in e1000_set_d3_lplu_state()
5383 ret_val = in e1000_set_d3_lplu_state()
5386 if (ret_val) in e1000_set_d3_lplu_state()
5387 return ret_val; in e1000_set_d3_lplu_state()
5389 ret_val = in e1000_set_d3_lplu_state()
5392 if (ret_val) in e1000_set_d3_lplu_state()
5393 return ret_val; in e1000_set_d3_lplu_state()
5396 ret_val = in e1000_set_d3_lplu_state()
5399 if (ret_val) in e1000_set_d3_lplu_state()
5400 return ret_val; in e1000_set_d3_lplu_state()
5408 ret_val = in e1000_set_d3_lplu_state()
5411 if (ret_val) in e1000_set_d3_lplu_state()
5412 return ret_val; in e1000_set_d3_lplu_state()
5416 ret_val = in e1000_set_d3_lplu_state()
5419 if (ret_val) in e1000_set_d3_lplu_state()
5420 return ret_val; in e1000_set_d3_lplu_state()
5423 ret_val = in e1000_set_d3_lplu_state()
5426 if (ret_val) in e1000_set_d3_lplu_state()
5427 return ret_val; in e1000_set_d3_lplu_state()
5440 s32 ret_val; in e1000_set_vco_speed() local
5454 ret_val = in e1000_set_vco_speed()
5456 if (ret_val) in e1000_set_vco_speed()
5457 return ret_val; in e1000_set_vco_speed()
5459 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0005); in e1000_set_vco_speed()
5460 if (ret_val) in e1000_set_vco_speed()
5461 return ret_val; in e1000_set_vco_speed()
5463 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed()
5464 if (ret_val) in e1000_set_vco_speed()
5465 return ret_val; in e1000_set_vco_speed()
5468 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed()
5469 if (ret_val) in e1000_set_vco_speed()
5470 return ret_val; in e1000_set_vco_speed()
5474 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0004); in e1000_set_vco_speed()
5475 if (ret_val) in e1000_set_vco_speed()
5476 return ret_val; in e1000_set_vco_speed()
5478 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed()
5479 if (ret_val) in e1000_set_vco_speed()
5480 return ret_val; in e1000_set_vco_speed()
5483 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed()
5484 if (ret_val) in e1000_set_vco_speed()
5485 return ret_val; in e1000_set_vco_speed()
5487 ret_val = in e1000_set_vco_speed()
5489 if (ret_val) in e1000_set_vco_speed()
5490 return ret_val; in e1000_set_vco_speed()
5520 s32 ret_val; in e1000_polarity_reversal_workaround() local
5528 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019); in e1000_polarity_reversal_workaround()
5529 if (ret_val) in e1000_polarity_reversal_workaround()
5530 return ret_val; in e1000_polarity_reversal_workaround()
5531 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFFF); in e1000_polarity_reversal_workaround()
5532 if (ret_val) in e1000_polarity_reversal_workaround()
5533 return ret_val; in e1000_polarity_reversal_workaround()
5535 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000); in e1000_polarity_reversal_workaround()
5536 if (ret_val) in e1000_polarity_reversal_workaround()
5537 return ret_val; in e1000_polarity_reversal_workaround()
5545 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround()
5546 if (ret_val) in e1000_polarity_reversal_workaround()
5547 return ret_val; in e1000_polarity_reversal_workaround()
5549 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround()
5550 if (ret_val) in e1000_polarity_reversal_workaround()
5551 return ret_val; in e1000_polarity_reversal_workaround()
5563 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019); in e1000_polarity_reversal_workaround()
5564 if (ret_val) in e1000_polarity_reversal_workaround()
5565 return ret_val; in e1000_polarity_reversal_workaround()
5567 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFF0); in e1000_polarity_reversal_workaround()
5568 if (ret_val) in e1000_polarity_reversal_workaround()
5569 return ret_val; in e1000_polarity_reversal_workaround()
5571 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFF00); in e1000_polarity_reversal_workaround()
5572 if (ret_val) in e1000_polarity_reversal_workaround()
5573 return ret_val; in e1000_polarity_reversal_workaround()
5575 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0x0000); in e1000_polarity_reversal_workaround()
5576 if (ret_val) in e1000_polarity_reversal_workaround()
5577 return ret_val; in e1000_polarity_reversal_workaround()
5579 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000); in e1000_polarity_reversal_workaround()
5580 if (ret_val) in e1000_polarity_reversal_workaround()
5581 return ret_val; in e1000_polarity_reversal_workaround()
5589 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround()
5590 if (ret_val) in e1000_polarity_reversal_workaround()
5591 return ret_val; in e1000_polarity_reversal_workaround()
5593 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg); in e1000_polarity_reversal_workaround()
5594 if (ret_val) in e1000_polarity_reversal_workaround()
5595 return ret_val; in e1000_polarity_reversal_workaround()