Lines Matching refs:ret_val

63 	s32 ret_val = 0;  in e1000e_get_phy_id()  local
71 ret_val = e1e_rphy(hw, MII_PHYSID1, &phy_id); in e1000e_get_phy_id()
72 if (ret_val) in e1000e_get_phy_id()
73 return ret_val; in e1000e_get_phy_id()
77 ret_val = e1e_rphy(hw, MII_PHYSID2, &phy_id); in e1000e_get_phy_id()
78 if (ret_val) in e1000e_get_phy_id()
79 return ret_val; in e1000e_get_phy_id()
101 s32 ret_val; in e1000e_phy_reset_dsp() local
103 ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0xC1); in e1000e_phy_reset_dsp()
104 if (ret_val) in e1000e_phy_reset_dsp()
105 return ret_val; in e1000e_phy_reset_dsp()
290 s32 ret_val; in e1000e_read_phy_reg_m88() local
292 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_m88()
293 if (ret_val) in e1000e_read_phy_reg_m88()
294 return ret_val; in e1000e_read_phy_reg_m88()
296 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_m88()
301 return ret_val; in e1000e_read_phy_reg_m88()
315 s32 ret_val; in e1000e_write_phy_reg_m88() local
317 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_m88()
318 if (ret_val) in e1000e_write_phy_reg_m88()
319 return ret_val; in e1000e_write_phy_reg_m88()
321 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_m88()
326 return ret_val; in e1000e_write_phy_reg_m88()
361 s32 ret_val = 0; in __e1000e_read_phy_reg_igp() local
367 ret_val = hw->phy.ops.acquire(hw); in __e1000e_read_phy_reg_igp()
368 if (ret_val) in __e1000e_read_phy_reg_igp()
369 return ret_val; in __e1000e_read_phy_reg_igp()
373 ret_val = e1000e_write_phy_reg_mdic(hw, in __e1000e_read_phy_reg_igp()
376 if (!ret_val) in __e1000e_read_phy_reg_igp()
377 ret_val = e1000e_read_phy_reg_mdic(hw, in __e1000e_read_phy_reg_igp()
383 return ret_val; in __e1000e_read_phy_reg_igp()
428 s32 ret_val = 0; in __e1000e_write_phy_reg_igp() local
434 ret_val = hw->phy.ops.acquire(hw); in __e1000e_write_phy_reg_igp()
435 if (ret_val) in __e1000e_write_phy_reg_igp()
436 return ret_val; in __e1000e_write_phy_reg_igp()
440 ret_val = e1000e_write_phy_reg_mdic(hw, in __e1000e_write_phy_reg_igp()
443 if (!ret_val) in __e1000e_write_phy_reg_igp()
444 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & in __e1000e_write_phy_reg_igp()
449 return ret_val; in __e1000e_write_phy_reg_igp()
497 s32 ret_val = 0; in __e1000_read_kmrn_reg() local
502 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_kmrn_reg()
503 if (ret_val) in __e1000_read_kmrn_reg()
504 return ret_val; in __e1000_read_kmrn_reg()
570 s32 ret_val = 0; in __e1000_write_kmrn_reg() local
575 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_kmrn_reg()
576 if (ret_val) in __e1000_write_kmrn_reg()
577 return ret_val; in __e1000_write_kmrn_reg()
628 s32 ret_val; in e1000_set_master_slave_mode() local
632 ret_val = e1e_rphy(hw, MII_CTRL1000, &phy_data); in e1000_set_master_slave_mode()
633 if (ret_val) in e1000_set_master_slave_mode()
634 return ret_val; in e1000_set_master_slave_mode()
667 s32 ret_val; in e1000_copper_link_setup_82577() local
671 ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data); in e1000_copper_link_setup_82577()
672 if (ret_val) in e1000_copper_link_setup_82577()
673 return ret_val; in e1000_copper_link_setup_82577()
680 ret_val = e1e_wphy(hw, I82577_CFG_REG, phy_data); in e1000_copper_link_setup_82577()
681 if (ret_val) in e1000_copper_link_setup_82577()
682 return ret_val; in e1000_copper_link_setup_82577()
685 ret_val = e1e_rphy(hw, I82577_PHY_CTRL_2, &phy_data); in e1000_copper_link_setup_82577()
686 if (ret_val) in e1000_copper_link_setup_82577()
687 return ret_val; in e1000_copper_link_setup_82577()
705 ret_val = e1e_wphy(hw, I82577_PHY_CTRL_2, phy_data); in e1000_copper_link_setup_82577()
706 if (ret_val) in e1000_copper_link_setup_82577()
707 return ret_val; in e1000_copper_link_setup_82577()
722 s32 ret_val; in e1000e_copper_link_setup_m88() local
726 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
727 if (ret_val) in e1000e_copper_link_setup_m88()
728 return ret_val; in e1000e_copper_link_setup_m88()
774 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, in e1000e_copper_link_setup_m88()
776 if (ret_val) in e1000e_copper_link_setup_m88()
777 return ret_val; in e1000e_copper_link_setup_m88()
779 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
780 if (ret_val) { in e1000e_copper_link_setup_m88()
782 return ret_val; in e1000e_copper_link_setup_m88()
789 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_copper_link_setup_m88()
790 if (ret_val) in e1000e_copper_link_setup_m88()
791 return ret_val; in e1000e_copper_link_setup_m88()
799 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
800 if (ret_val) in e1000e_copper_link_setup_m88()
801 return ret_val; in e1000e_copper_link_setup_m88()
816 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); in e1000e_copper_link_setup_m88()
817 if (ret_val) in e1000e_copper_link_setup_m88()
818 return ret_val; in e1000e_copper_link_setup_m88()
823 ret_val = e1e_wphy(hw, 29, 0x0003); in e1000e_copper_link_setup_m88()
824 if (ret_val) in e1000e_copper_link_setup_m88()
825 return ret_val; in e1000e_copper_link_setup_m88()
828 ret_val = e1e_wphy(hw, 30, 0x0000); in e1000e_copper_link_setup_m88()
829 if (ret_val) in e1000e_copper_link_setup_m88()
830 return ret_val; in e1000e_copper_link_setup_m88()
835 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
836 if (ret_val) { in e1000e_copper_link_setup_m88()
838 return ret_val; in e1000e_copper_link_setup_m88()
843 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
844 if (ret_val) in e1000e_copper_link_setup_m88()
845 return ret_val; in e1000e_copper_link_setup_m88()
850 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); in e1000e_copper_link_setup_m88()
851 if (ret_val) in e1000e_copper_link_setup_m88()
852 return ret_val; in e1000e_copper_link_setup_m88()
868 s32 ret_val; in e1000e_copper_link_setup_igp() local
871 ret_val = e1000_phy_hw_reset(hw); in e1000e_copper_link_setup_igp()
872 if (ret_val) { in e1000e_copper_link_setup_igp()
874 return ret_val; in e1000e_copper_link_setup_igp()
884 ret_val = hw->phy.ops.set_d0_lplu_state(hw, false); in e1000e_copper_link_setup_igp()
885 if (ret_val) { in e1000e_copper_link_setup_igp()
887 return ret_val; in e1000e_copper_link_setup_igp()
891 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &data); in e1000e_copper_link_setup_igp()
892 if (ret_val) in e1000e_copper_link_setup_igp()
893 return ret_val; in e1000e_copper_link_setup_igp()
909 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, data); in e1000e_copper_link_setup_igp()
910 if (ret_val) in e1000e_copper_link_setup_igp()
911 return ret_val; in e1000e_copper_link_setup_igp()
921 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_copper_link_setup_igp()
923 if (ret_val) in e1000e_copper_link_setup_igp()
924 return ret_val; in e1000e_copper_link_setup_igp()
927 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_copper_link_setup_igp()
929 if (ret_val) in e1000e_copper_link_setup_igp()
930 return ret_val; in e1000e_copper_link_setup_igp()
933 ret_val = e1e_rphy(hw, MII_CTRL1000, &data); in e1000e_copper_link_setup_igp()
934 if (ret_val) in e1000e_copper_link_setup_igp()
935 return ret_val; in e1000e_copper_link_setup_igp()
938 ret_val = e1e_wphy(hw, MII_CTRL1000, data); in e1000e_copper_link_setup_igp()
939 if (ret_val) in e1000e_copper_link_setup_igp()
940 return ret_val; in e1000e_copper_link_setup_igp()
943 ret_val = e1000_set_master_slave_mode(hw); in e1000e_copper_link_setup_igp()
946 return ret_val; in e1000e_copper_link_setup_igp()
961 s32 ret_val; in e1000_phy_setup_autoneg() local
968 ret_val = e1e_rphy(hw, MII_ADVERTISE, &mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
969 if (ret_val) in e1000_phy_setup_autoneg()
970 return ret_val; in e1000_phy_setup_autoneg()
974 ret_val = e1e_rphy(hw, MII_CTRL1000, &mii_1000t_ctrl_reg); in e1000_phy_setup_autoneg()
975 if (ret_val) in e1000_phy_setup_autoneg()
976 return ret_val; in e1000_phy_setup_autoneg()
1096 ret_val = e1e_wphy(hw, MII_ADVERTISE, mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
1097 if (ret_val) in e1000_phy_setup_autoneg()
1098 return ret_val; in e1000_phy_setup_autoneg()
1103 ret_val = e1e_wphy(hw, MII_CTRL1000, mii_1000t_ctrl_reg); in e1000_phy_setup_autoneg()
1105 return ret_val; in e1000_phy_setup_autoneg()
1120 s32 ret_val; in e1000_copper_link_autoneg() local
1135 ret_val = e1000_phy_setup_autoneg(hw); in e1000_copper_link_autoneg()
1136 if (ret_val) { in e1000_copper_link_autoneg()
1138 return ret_val; in e1000_copper_link_autoneg()
1145 ret_val = e1e_rphy(hw, MII_BMCR, &phy_ctrl); in e1000_copper_link_autoneg()
1146 if (ret_val) in e1000_copper_link_autoneg()
1147 return ret_val; in e1000_copper_link_autoneg()
1150 ret_val = e1e_wphy(hw, MII_BMCR, phy_ctrl); in e1000_copper_link_autoneg()
1151 if (ret_val) in e1000_copper_link_autoneg()
1152 return ret_val; in e1000_copper_link_autoneg()
1158 ret_val = e1000_wait_autoneg(hw); in e1000_copper_link_autoneg()
1159 if (ret_val) { in e1000_copper_link_autoneg()
1161 return ret_val; in e1000_copper_link_autoneg()
1167 return ret_val; in e1000_copper_link_autoneg()
1181 s32 ret_val; in e1000e_setup_copper_link() local
1188 ret_val = e1000_copper_link_autoneg(hw); in e1000e_setup_copper_link()
1189 if (ret_val) in e1000e_setup_copper_link()
1190 return ret_val; in e1000e_setup_copper_link()
1196 ret_val = hw->phy.ops.force_speed_duplex(hw); in e1000e_setup_copper_link()
1197 if (ret_val) { in e1000e_setup_copper_link()
1199 return ret_val; in e1000e_setup_copper_link()
1206 ret_val = e1000e_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10, in e1000e_setup_copper_link()
1208 if (ret_val) in e1000e_setup_copper_link()
1209 return ret_val; in e1000e_setup_copper_link()
1214 ret_val = e1000e_config_fc_after_link_up(hw); in e1000e_setup_copper_link()
1219 return ret_val; in e1000e_setup_copper_link()
1233 s32 ret_val; in e1000e_phy_force_speed_duplex_igp() local
1237 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000e_phy_force_speed_duplex_igp()
1238 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1239 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1243 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000e_phy_force_speed_duplex_igp()
1244 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1245 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1250 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_igp()
1251 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1252 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1257 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, phy_data); in e1000e_phy_force_speed_duplex_igp()
1258 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1259 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1268 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_igp()
1270 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1271 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1277 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_igp()
1281 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1297 s32 ret_val; in e1000e_phy_force_speed_duplex_m88() local
1304 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1305 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1306 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1309 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_phy_force_speed_duplex_m88()
1310 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1311 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1315 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1316 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1317 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1321 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000e_phy_force_speed_duplex_m88()
1322 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1323 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1327 ret_val = hw->phy.ops.commit(hw); in e1000e_phy_force_speed_duplex_m88()
1328 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1329 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1335 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_m88()
1337 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1338 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1347 ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, in e1000e_phy_force_speed_duplex_m88()
1349 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1350 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1351 ret_val = e1000e_phy_reset_dsp(hw); in e1000e_phy_force_speed_duplex_m88()
1352 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1353 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1358 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_m88()
1360 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1361 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1367 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1368 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1369 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1376 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); in e1000e_phy_force_speed_duplex_m88()
1377 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1378 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1383 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1384 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1385 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1388 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_phy_force_speed_duplex_m88()
1390 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1404 s32 ret_val; in e1000_phy_force_speed_duplex_ife() local
1408 ret_val = e1e_rphy(hw, MII_BMCR, &data); in e1000_phy_force_speed_duplex_ife()
1409 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1410 return ret_val; in e1000_phy_force_speed_duplex_ife()
1414 ret_val = e1e_wphy(hw, MII_BMCR, data); in e1000_phy_force_speed_duplex_ife()
1415 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1416 return ret_val; in e1000_phy_force_speed_duplex_ife()
1419 ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data); in e1000_phy_force_speed_duplex_ife()
1420 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1421 return ret_val; in e1000_phy_force_speed_duplex_ife()
1426 ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data); in e1000_phy_force_speed_duplex_ife()
1427 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1428 return ret_val; in e1000_phy_force_speed_duplex_ife()
1437 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_ife()
1439 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1440 return ret_val; in e1000_phy_force_speed_duplex_ife()
1446 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_ife()
1448 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1449 return ret_val; in e1000_phy_force_speed_duplex_ife()
1531 s32 ret_val; in e1000e_set_d3_lplu_state() local
1534 ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data); in e1000e_set_d3_lplu_state()
1535 if (ret_val) in e1000e_set_d3_lplu_state()
1536 return ret_val; in e1000e_set_d3_lplu_state()
1540 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000e_set_d3_lplu_state()
1541 if (ret_val) in e1000e_set_d3_lplu_state()
1542 return ret_val; in e1000e_set_d3_lplu_state()
1549 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1551 if (ret_val) in e1000e_set_d3_lplu_state()
1552 return ret_val; in e1000e_set_d3_lplu_state()
1555 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1557 if (ret_val) in e1000e_set_d3_lplu_state()
1558 return ret_val; in e1000e_set_d3_lplu_state()
1560 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1562 if (ret_val) in e1000e_set_d3_lplu_state()
1563 return ret_val; in e1000e_set_d3_lplu_state()
1566 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1568 if (ret_val) in e1000e_set_d3_lplu_state()
1569 return ret_val; in e1000e_set_d3_lplu_state()
1575 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000e_set_d3_lplu_state()
1576 if (ret_val) in e1000e_set_d3_lplu_state()
1577 return ret_val; in e1000e_set_d3_lplu_state()
1580 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data); in e1000e_set_d3_lplu_state()
1581 if (ret_val) in e1000e_set_d3_lplu_state()
1582 return ret_val; in e1000e_set_d3_lplu_state()
1585 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data); in e1000e_set_d3_lplu_state()
1588 return ret_val; in e1000e_set_d3_lplu_state()
1602 s32 ret_val; in e1000e_check_downshift() local
1624 ret_val = e1e_rphy(hw, offset, &phy_data); in e1000e_check_downshift()
1626 if (!ret_val) in e1000e_check_downshift()
1629 return ret_val; in e1000e_check_downshift()
1643 s32 ret_val; in e1000_check_polarity_m88() local
1646 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &data); in e1000_check_polarity_m88()
1648 if (!ret_val) in e1000_check_polarity_m88()
1653 return ret_val; in e1000_check_polarity_m88()
1668 s32 ret_val; in e1000_check_polarity_igp() local
1674 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data); in e1000_check_polarity_igp()
1675 if (ret_val) in e1000_check_polarity_igp()
1676 return ret_val; in e1000_check_polarity_igp()
1690 ret_val = e1e_rphy(hw, offset, &data); in e1000_check_polarity_igp()
1692 if (!ret_val) in e1000_check_polarity_igp()
1697 return ret_val; in e1000_check_polarity_igp()
1709 s32 ret_val; in e1000_check_polarity_ife() local
1722 ret_val = e1e_rphy(hw, offset, &phy_data); in e1000_check_polarity_ife()
1724 if (!ret_val) in e1000_check_polarity_ife()
1729 return ret_val; in e1000_check_polarity_ife()
1741 s32 ret_val = 0; in e1000_wait_autoneg() local
1746 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000_wait_autoneg()
1747 if (ret_val) in e1000_wait_autoneg()
1749 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000_wait_autoneg()
1750 if (ret_val) in e1000_wait_autoneg()
1760 return ret_val; in e1000_wait_autoneg()
1775 s32 ret_val = 0; in e1000e_phy_has_link_generic() local
1784 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000e_phy_has_link_generic()
1785 if (ret_val) { in e1000e_phy_has_link_generic()
1795 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000e_phy_has_link_generic()
1796 if (ret_val) in e1000e_phy_has_link_generic()
1808 return ret_val; in e1000e_phy_has_link_generic()
1829 s32 ret_val; in e1000e_get_cable_length_m88() local
1832 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000e_get_cable_length_m88()
1833 if (ret_val) in e1000e_get_cable_length_m88()
1834 return ret_val; in e1000e_get_cable_length_m88()
1863 s32 ret_val; in e1000e_get_cable_length_igp_2() local
1876 ret_val = e1e_rphy(hw, agc_reg_array[i], &phy_data); in e1000e_get_cable_length_igp_2()
1877 if (ret_val) in e1000e_get_cable_length_igp_2()
1878 return ret_val; in e1000e_get_cable_length_igp_2()
1931 s32 ret_val; in e1000e_get_phy_info_m88() local
1940 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000e_get_phy_info_m88()
1941 if (ret_val) in e1000e_get_phy_info_m88()
1942 return ret_val; in e1000e_get_phy_info_m88()
1949 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_get_phy_info_m88()
1950 if (ret_val) in e1000e_get_phy_info_m88()
1951 return ret_val; in e1000e_get_phy_info_m88()
1956 ret_val = e1000_check_polarity_m88(hw); in e1000e_get_phy_info_m88()
1957 if (ret_val) in e1000e_get_phy_info_m88()
1958 return ret_val; in e1000e_get_phy_info_m88()
1960 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000e_get_phy_info_m88()
1961 if (ret_val) in e1000e_get_phy_info_m88()
1962 return ret_val; in e1000e_get_phy_info_m88()
1967 ret_val = hw->phy.ops.get_cable_length(hw); in e1000e_get_phy_info_m88()
1968 if (ret_val) in e1000e_get_phy_info_m88()
1969 return ret_val; in e1000e_get_phy_info_m88()
1971 ret_val = e1e_rphy(hw, MII_STAT1000, &phy_data); in e1000e_get_phy_info_m88()
1972 if (ret_val) in e1000e_get_phy_info_m88()
1973 return ret_val; in e1000e_get_phy_info_m88()
1987 return ret_val; in e1000e_get_phy_info_m88()
2002 s32 ret_val; in e1000e_get_phy_info_igp() local
2006 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000e_get_phy_info_igp()
2007 if (ret_val) in e1000e_get_phy_info_igp()
2008 return ret_val; in e1000e_get_phy_info_igp()
2017 ret_val = e1000_check_polarity_igp(hw); in e1000e_get_phy_info_igp()
2018 if (ret_val) in e1000e_get_phy_info_igp()
2019 return ret_val; in e1000e_get_phy_info_igp()
2021 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data); in e1000e_get_phy_info_igp()
2022 if (ret_val) in e1000e_get_phy_info_igp()
2023 return ret_val; in e1000e_get_phy_info_igp()
2029 ret_val = phy->ops.get_cable_length(hw); in e1000e_get_phy_info_igp()
2030 if (ret_val) in e1000e_get_phy_info_igp()
2031 return ret_val; in e1000e_get_phy_info_igp()
2033 ret_val = e1e_rphy(hw, MII_STAT1000, &data); in e1000e_get_phy_info_igp()
2034 if (ret_val) in e1000e_get_phy_info_igp()
2035 return ret_val; in e1000e_get_phy_info_igp()
2048 return ret_val; in e1000e_get_phy_info_igp()
2060 s32 ret_val; in e1000_get_phy_info_ife() local
2064 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000_get_phy_info_ife()
2065 if (ret_val) in e1000_get_phy_info_ife()
2066 return ret_val; in e1000_get_phy_info_ife()
2073 ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data); in e1000_get_phy_info_ife()
2074 if (ret_val) in e1000_get_phy_info_ife()
2075 return ret_val; in e1000_get_phy_info_ife()
2079 ret_val = e1000_check_polarity_ife(hw); in e1000_get_phy_info_ife()
2080 if (ret_val) in e1000_get_phy_info_ife()
2081 return ret_val; in e1000_get_phy_info_ife()
2089 ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data); in e1000_get_phy_info_ife()
2090 if (ret_val) in e1000_get_phy_info_ife()
2091 return ret_val; in e1000_get_phy_info_ife()
2112 s32 ret_val; in e1000e_phy_sw_reset() local
2115 ret_val = e1e_rphy(hw, MII_BMCR, &phy_ctrl); in e1000e_phy_sw_reset()
2116 if (ret_val) in e1000e_phy_sw_reset()
2117 return ret_val; in e1000e_phy_sw_reset()
2120 ret_val = e1e_wphy(hw, MII_BMCR, phy_ctrl); in e1000e_phy_sw_reset()
2121 if (ret_val) in e1000e_phy_sw_reset()
2122 return ret_val; in e1000e_phy_sw_reset()
2126 return ret_val; in e1000e_phy_sw_reset()
2141 s32 ret_val; in e1000e_phy_hw_reset_generic() local
2145 ret_val = phy->ops.check_reset_block(hw); in e1000e_phy_hw_reset_generic()
2146 if (ret_val) in e1000e_phy_hw_reset_generic()
2150 ret_val = phy->ops.acquire(hw); in e1000e_phy_hw_reset_generic()
2151 if (ret_val) in e1000e_phy_hw_reset_generic()
2152 return ret_val; in e1000e_phy_hw_reset_generic()
2387 s32 ret_val; in e1000e_write_phy_reg_bm() local
2390 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm()
2391 if (ret_val) in e1000e_write_phy_reg_bm()
2392 return ret_val; in e1000e_write_phy_reg_bm()
2396 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in e1000e_write_phy_reg_bm()
2419 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, in e1000e_write_phy_reg_bm()
2421 if (ret_val) in e1000e_write_phy_reg_bm()
2425 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_bm()
2430 return ret_val; in e1000e_write_phy_reg_bm()
2445 s32 ret_val; in e1000e_read_phy_reg_bm() local
2448 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm()
2449 if (ret_val) in e1000e_read_phy_reg_bm()
2450 return ret_val; in e1000e_read_phy_reg_bm()
2454 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in e1000e_read_phy_reg_bm()
2477 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, in e1000e_read_phy_reg_bm()
2479 if (ret_val) in e1000e_read_phy_reg_bm()
2483 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_bm()
2487 return ret_val; in e1000e_read_phy_reg_bm()
2502 s32 ret_val; in e1000e_read_phy_reg_bm2() local
2505 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm2()
2506 if (ret_val) in e1000e_read_phy_reg_bm2()
2507 return ret_val; in e1000e_read_phy_reg_bm2()
2511 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in e1000e_read_phy_reg_bm2()
2520 ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, in e1000e_read_phy_reg_bm2()
2523 if (ret_val) in e1000e_read_phy_reg_bm2()
2527 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_bm2()
2531 return ret_val; in e1000e_read_phy_reg_bm2()
2545 s32 ret_val; in e1000e_write_phy_reg_bm2() local
2548 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm2()
2549 if (ret_val) in e1000e_write_phy_reg_bm2()
2550 return ret_val; in e1000e_write_phy_reg_bm2()
2554 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in e1000e_write_phy_reg_bm2()
2563 ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, in e1000e_write_phy_reg_bm2()
2566 if (ret_val) in e1000e_write_phy_reg_bm2()
2570 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_bm2()
2575 return ret_val; in e1000e_write_phy_reg_bm2()
2588 s32 ret_val; in e1000_enable_phy_wakeup_reg_access_bm() local
2595 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); in e1000_enable_phy_wakeup_reg_access_bm()
2596 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2598 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2601 ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, phy_reg); in e1000_enable_phy_wakeup_reg_access_bm()
2602 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2605 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2615 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, temp); in e1000_enable_phy_wakeup_reg_access_bm()
2616 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2619 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2641 s32 ret_val; in e1000_disable_phy_wakeup_reg_access_bm() local
2644 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); in e1000_disable_phy_wakeup_reg_access_bm()
2645 if (ret_val) { in e1000_disable_phy_wakeup_reg_access_bm()
2647 return ret_val; in e1000_disable_phy_wakeup_reg_access_bm()
2651 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, *phy_reg); in e1000_disable_phy_wakeup_reg_access_bm()
2652 if (ret_val) in e1000_disable_phy_wakeup_reg_access_bm()
2656 return ret_val; in e1000_disable_phy_wakeup_reg_access_bm()
2687 s32 ret_val; in e1000_access_phy_wakeup_reg_bm() local
2700 ret_val = e1000_enable_phy_wakeup_reg_access_bm(hw, &phy_reg); in e1000_access_phy_wakeup_reg_bm()
2701 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2703 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2710 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ADDRESS_OPCODE, reg); in e1000_access_phy_wakeup_reg_bm()
2711 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2713 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2718 ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE, in e1000_access_phy_wakeup_reg_bm()
2722 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE, in e1000_access_phy_wakeup_reg_bm()
2726 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2728 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2732 ret_val = e1000_disable_phy_wakeup_reg_access_bm(hw, &phy_reg); in e1000_access_phy_wakeup_reg_bm()
2734 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2799 s32 ret_val; in __e1000_read_phy_reg_hv() local
2805 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_phy_reg_hv()
2806 if (ret_val) in __e1000_read_phy_reg_hv()
2807 return ret_val; in __e1000_read_phy_reg_hv()
2812 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in __e1000_read_phy_reg_hv()
2818 ret_val = e1000_access_phy_debug_regs_hv(hw, offset, in __e1000_read_phy_reg_hv()
2829 ret_val = e1000_set_page_igp(hw, in __e1000_read_phy_reg_hv()
2834 if (ret_val) in __e1000_read_phy_reg_hv()
2842 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, data); in __e1000_read_phy_reg_hv()
2847 return ret_val; in __e1000_read_phy_reg_hv()
2907 s32 ret_val; in __e1000_write_phy_reg_hv() local
2913 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_phy_reg_hv()
2914 if (ret_val) in __e1000_write_phy_reg_hv()
2915 return ret_val; in __e1000_write_phy_reg_hv()
2920 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in __e1000_write_phy_reg_hv()
2926 ret_val = e1000_access_phy_debug_regs_hv(hw, offset, in __e1000_write_phy_reg_hv()
2944 ret_val = e1000_access_phy_debug_regs_hv(hw, in __e1000_write_phy_reg_hv()
2947 if (ret_val) in __e1000_write_phy_reg_hv()
2953 ret_val = e1000_set_page_igp(hw, in __e1000_write_phy_reg_hv()
2958 if (ret_val) in __e1000_write_phy_reg_hv()
2966 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, in __e1000_write_phy_reg_hv()
2973 return ret_val; in __e1000_write_phy_reg_hv()
3047 s32 ret_val; in e1000_access_phy_debug_regs_hv() local
3060 ret_val = e1000e_write_phy_reg_mdic(hw, addr_reg, (u16)offset & 0x3F); in e1000_access_phy_debug_regs_hv()
3061 if (ret_val) { in e1000_access_phy_debug_regs_hv()
3063 return ret_val; in e1000_access_phy_debug_regs_hv()
3068 ret_val = e1000e_read_phy_reg_mdic(hw, data_reg, data); in e1000_access_phy_debug_regs_hv()
3070 ret_val = e1000e_write_phy_reg_mdic(hw, data_reg, *data); in e1000_access_phy_debug_regs_hv()
3072 if (ret_val) in e1000_access_phy_debug_regs_hv()
3075 return ret_val; in e1000_access_phy_debug_regs_hv()
3091 s32 ret_val = 0; in e1000_link_stall_workaround_hv() local
3098 ret_val = e1e_rphy(hw, MII_BMCR, &data); in e1000_link_stall_workaround_hv()
3099 if (ret_val) { in e1000_link_stall_workaround_hv()
3101 return ret_val; in e1000_link_stall_workaround_hv()
3107 ret_val = e1e_rphy(hw, BM_CS_STATUS, &data); in e1000_link_stall_workaround_hv()
3108 if (ret_val) in e1000_link_stall_workaround_hv()
3109 return ret_val; in e1000_link_stall_workaround_hv()
3121 ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, in e1000_link_stall_workaround_hv()
3124 if (ret_val) in e1000_link_stall_workaround_hv()
3125 return ret_val; in e1000_link_stall_workaround_hv()
3141 s32 ret_val; in e1000_check_polarity_82577() local
3144 ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data); in e1000_check_polarity_82577()
3146 if (!ret_val) in e1000_check_polarity_82577()
3151 return ret_val; in e1000_check_polarity_82577()
3163 s32 ret_val; in e1000_phy_force_speed_duplex_82577() local
3167 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000_phy_force_speed_duplex_82577()
3168 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3169 return ret_val; in e1000_phy_force_speed_duplex_82577()
3173 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000_phy_force_speed_duplex_82577()
3174 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3175 return ret_val; in e1000_phy_force_speed_duplex_82577()
3182 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_82577()
3184 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3185 return ret_val; in e1000_phy_force_speed_duplex_82577()
3191 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_82577()
3195 return ret_val; in e1000_phy_force_speed_duplex_82577()
3210 s32 ret_val; in e1000_get_phy_info_82577() local
3214 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000_get_phy_info_82577()
3215 if (ret_val) in e1000_get_phy_info_82577()
3216 return ret_val; in e1000_get_phy_info_82577()
3225 ret_val = e1000_check_polarity_82577(hw); in e1000_get_phy_info_82577()
3226 if (ret_val) in e1000_get_phy_info_82577()
3227 return ret_val; in e1000_get_phy_info_82577()
3229 ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data); in e1000_get_phy_info_82577()
3230 if (ret_val) in e1000_get_phy_info_82577()
3231 return ret_val; in e1000_get_phy_info_82577()
3237 ret_val = hw->phy.ops.get_cable_length(hw); in e1000_get_phy_info_82577()
3238 if (ret_val) in e1000_get_phy_info_82577()
3239 return ret_val; in e1000_get_phy_info_82577()
3241 ret_val = e1e_rphy(hw, MII_STAT1000, &data); in e1000_get_phy_info_82577()
3242 if (ret_val) in e1000_get_phy_info_82577()
3243 return ret_val; in e1000_get_phy_info_82577()
3269 s32 ret_val; in e1000_get_cable_length_82577() local
3272 ret_val = e1e_rphy(hw, I82577_PHY_DIAG_STATUS, &phy_data); in e1000_get_cable_length_82577()
3273 if (ret_val) in e1000_get_cable_length_82577()
3274 return ret_val; in e1000_get_cable_length_82577()