Lines Matching refs:ret_val
62 s32 ret_val = 0; in e1000e_get_phy_id() local
70 ret_val = e1e_rphy(hw, MII_PHYSID1, &phy_id); in e1000e_get_phy_id()
71 if (ret_val) in e1000e_get_phy_id()
72 return ret_val; in e1000e_get_phy_id()
76 ret_val = e1e_rphy(hw, MII_PHYSID2, &phy_id); in e1000e_get_phy_id()
77 if (ret_val) in e1000e_get_phy_id()
78 return ret_val; in e1000e_get_phy_id()
100 s32 ret_val; in e1000e_phy_reset_dsp() local
102 ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0xC1); in e1000e_phy_reset_dsp()
103 if (ret_val) in e1000e_phy_reset_dsp()
104 return ret_val; in e1000e_phy_reset_dsp()
248 s32 ret_val; in e1000e_read_phy_reg_m88() local
250 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_m88()
251 if (ret_val) in e1000e_read_phy_reg_m88()
252 return ret_val; in e1000e_read_phy_reg_m88()
254 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_m88()
259 return ret_val; in e1000e_read_phy_reg_m88()
273 s32 ret_val; in e1000e_write_phy_reg_m88() local
275 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_m88()
276 if (ret_val) in e1000e_write_phy_reg_m88()
277 return ret_val; in e1000e_write_phy_reg_m88()
279 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_m88()
284 return ret_val; in e1000e_write_phy_reg_m88()
319 s32 ret_val = 0; in __e1000e_read_phy_reg_igp() local
325 ret_val = hw->phy.ops.acquire(hw); in __e1000e_read_phy_reg_igp()
326 if (ret_val) in __e1000e_read_phy_reg_igp()
327 return ret_val; in __e1000e_read_phy_reg_igp()
331 ret_val = e1000e_write_phy_reg_mdic(hw, in __e1000e_read_phy_reg_igp()
334 if (!ret_val) in __e1000e_read_phy_reg_igp()
335 ret_val = e1000e_read_phy_reg_mdic(hw, in __e1000e_read_phy_reg_igp()
341 return ret_val; in __e1000e_read_phy_reg_igp()
386 s32 ret_val = 0; in __e1000e_write_phy_reg_igp() local
392 ret_val = hw->phy.ops.acquire(hw); in __e1000e_write_phy_reg_igp()
393 if (ret_val) in __e1000e_write_phy_reg_igp()
394 return ret_val; in __e1000e_write_phy_reg_igp()
398 ret_val = e1000e_write_phy_reg_mdic(hw, in __e1000e_write_phy_reg_igp()
401 if (!ret_val) in __e1000e_write_phy_reg_igp()
402 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & in __e1000e_write_phy_reg_igp()
407 return ret_val; in __e1000e_write_phy_reg_igp()
455 s32 ret_val = 0; in __e1000_read_kmrn_reg() local
460 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_kmrn_reg()
461 if (ret_val) in __e1000_read_kmrn_reg()
462 return ret_val; in __e1000_read_kmrn_reg()
528 s32 ret_val = 0; in __e1000_write_kmrn_reg() local
533 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_kmrn_reg()
534 if (ret_val) in __e1000_write_kmrn_reg()
535 return ret_val; in __e1000_write_kmrn_reg()
587 s32 ret_val; in e1000_set_master_slave_mode() local
591 ret_val = e1e_rphy(hw, MII_CTRL1000, &phy_data); in e1000_set_master_slave_mode()
592 if (ret_val) in e1000_set_master_slave_mode()
593 return ret_val; in e1000_set_master_slave_mode()
626 s32 ret_val; in e1000_copper_link_setup_82577() local
630 ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data); in e1000_copper_link_setup_82577()
631 if (ret_val) in e1000_copper_link_setup_82577()
632 return ret_val; in e1000_copper_link_setup_82577()
639 ret_val = e1e_wphy(hw, I82577_CFG_REG, phy_data); in e1000_copper_link_setup_82577()
640 if (ret_val) in e1000_copper_link_setup_82577()
641 return ret_val; in e1000_copper_link_setup_82577()
644 ret_val = e1e_rphy(hw, I82577_PHY_CTRL_2, &phy_data); in e1000_copper_link_setup_82577()
645 if (ret_val) in e1000_copper_link_setup_82577()
646 return ret_val; in e1000_copper_link_setup_82577()
664 ret_val = e1e_wphy(hw, I82577_PHY_CTRL_2, phy_data); in e1000_copper_link_setup_82577()
665 if (ret_val) in e1000_copper_link_setup_82577()
666 return ret_val; in e1000_copper_link_setup_82577()
681 s32 ret_val; in e1000e_copper_link_setup_m88() local
685 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
686 if (ret_val) in e1000e_copper_link_setup_m88()
687 return ret_val; in e1000e_copper_link_setup_m88()
733 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, in e1000e_copper_link_setup_m88()
735 if (ret_val) in e1000e_copper_link_setup_m88()
736 return ret_val; in e1000e_copper_link_setup_m88()
738 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
739 if (ret_val) { in e1000e_copper_link_setup_m88()
741 return ret_val; in e1000e_copper_link_setup_m88()
748 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_copper_link_setup_m88()
749 if (ret_val) in e1000e_copper_link_setup_m88()
750 return ret_val; in e1000e_copper_link_setup_m88()
758 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
759 if (ret_val) in e1000e_copper_link_setup_m88()
760 return ret_val; in e1000e_copper_link_setup_m88()
775 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); 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()
782 ret_val = e1e_wphy(hw, 29, 0x0003); in e1000e_copper_link_setup_m88()
783 if (ret_val) in e1000e_copper_link_setup_m88()
784 return ret_val; in e1000e_copper_link_setup_m88()
787 ret_val = e1e_wphy(hw, 30, 0x0000); in e1000e_copper_link_setup_m88()
788 if (ret_val) in e1000e_copper_link_setup_m88()
789 return ret_val; in e1000e_copper_link_setup_m88()
794 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
795 if (ret_val) { in e1000e_copper_link_setup_m88()
797 return ret_val; in e1000e_copper_link_setup_m88()
802 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_copper_link_setup_m88()
803 if (ret_val) in e1000e_copper_link_setup_m88()
804 return ret_val; in e1000e_copper_link_setup_m88()
809 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); in e1000e_copper_link_setup_m88()
810 if (ret_val) in e1000e_copper_link_setup_m88()
811 return ret_val; in e1000e_copper_link_setup_m88()
827 s32 ret_val; in e1000e_copper_link_setup_igp() local
830 ret_val = e1000_phy_hw_reset(hw); in e1000e_copper_link_setup_igp()
831 if (ret_val) { in e1000e_copper_link_setup_igp()
833 return ret_val; in e1000e_copper_link_setup_igp()
843 ret_val = hw->phy.ops.set_d0_lplu_state(hw, false); in e1000e_copper_link_setup_igp()
844 if (ret_val) { in e1000e_copper_link_setup_igp()
846 return ret_val; in e1000e_copper_link_setup_igp()
850 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &data); in e1000e_copper_link_setup_igp()
851 if (ret_val) in e1000e_copper_link_setup_igp()
852 return ret_val; in e1000e_copper_link_setup_igp()
868 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, data); in e1000e_copper_link_setup_igp()
869 if (ret_val) in e1000e_copper_link_setup_igp()
870 return ret_val; in e1000e_copper_link_setup_igp()
880 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_copper_link_setup_igp()
882 if (ret_val) in e1000e_copper_link_setup_igp()
883 return ret_val; in e1000e_copper_link_setup_igp()
886 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_copper_link_setup_igp()
888 if (ret_val) in e1000e_copper_link_setup_igp()
889 return ret_val; in e1000e_copper_link_setup_igp()
892 ret_val = e1e_rphy(hw, MII_CTRL1000, &data); in e1000e_copper_link_setup_igp()
893 if (ret_val) in e1000e_copper_link_setup_igp()
894 return ret_val; in e1000e_copper_link_setup_igp()
897 ret_val = e1e_wphy(hw, MII_CTRL1000, data); in e1000e_copper_link_setup_igp()
898 if (ret_val) in e1000e_copper_link_setup_igp()
899 return ret_val; in e1000e_copper_link_setup_igp()
902 ret_val = e1000_set_master_slave_mode(hw); in e1000e_copper_link_setup_igp()
905 return ret_val; in e1000e_copper_link_setup_igp()
920 s32 ret_val; in e1000_phy_setup_autoneg() local
927 ret_val = e1e_rphy(hw, MII_ADVERTISE, &mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
928 if (ret_val) in e1000_phy_setup_autoneg()
929 return ret_val; in e1000_phy_setup_autoneg()
933 ret_val = e1e_rphy(hw, MII_CTRL1000, &mii_1000t_ctrl_reg); in e1000_phy_setup_autoneg()
934 if (ret_val) in e1000_phy_setup_autoneg()
935 return ret_val; in e1000_phy_setup_autoneg()
1047 ret_val = e1e_wphy(hw, MII_ADVERTISE, mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
1048 if (ret_val) in e1000_phy_setup_autoneg()
1049 return ret_val; in e1000_phy_setup_autoneg()
1054 ret_val = e1e_wphy(hw, MII_CTRL1000, mii_1000t_ctrl_reg); in e1000_phy_setup_autoneg()
1056 return ret_val; in e1000_phy_setup_autoneg()
1071 s32 ret_val; in e1000_copper_link_autoneg() local
1086 ret_val = e1000_phy_setup_autoneg(hw); in e1000_copper_link_autoneg()
1087 if (ret_val) { in e1000_copper_link_autoneg()
1089 return ret_val; in e1000_copper_link_autoneg()
1096 ret_val = e1e_rphy(hw, MII_BMCR, &phy_ctrl); in e1000_copper_link_autoneg()
1097 if (ret_val) in e1000_copper_link_autoneg()
1098 return ret_val; in e1000_copper_link_autoneg()
1101 ret_val = e1e_wphy(hw, MII_BMCR, phy_ctrl); in e1000_copper_link_autoneg()
1102 if (ret_val) in e1000_copper_link_autoneg()
1103 return ret_val; in e1000_copper_link_autoneg()
1109 ret_val = e1000_wait_autoneg(hw); in e1000_copper_link_autoneg()
1110 if (ret_val) { in e1000_copper_link_autoneg()
1112 return ret_val; in e1000_copper_link_autoneg()
1118 return ret_val; in e1000_copper_link_autoneg()
1132 s32 ret_val; in e1000e_setup_copper_link() local
1139 ret_val = e1000_copper_link_autoneg(hw); in e1000e_setup_copper_link()
1140 if (ret_val) in e1000e_setup_copper_link()
1141 return ret_val; in e1000e_setup_copper_link()
1147 ret_val = hw->phy.ops.force_speed_duplex(hw); in e1000e_setup_copper_link()
1148 if (ret_val) { in e1000e_setup_copper_link()
1150 return ret_val; in e1000e_setup_copper_link()
1157 ret_val = e1000e_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10, in e1000e_setup_copper_link()
1159 if (ret_val) in e1000e_setup_copper_link()
1160 return ret_val; in e1000e_setup_copper_link()
1165 ret_val = e1000e_config_fc_after_link_up(hw); in e1000e_setup_copper_link()
1170 return ret_val; in e1000e_setup_copper_link()
1184 s32 ret_val; in e1000e_phy_force_speed_duplex_igp() local
1188 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000e_phy_force_speed_duplex_igp()
1189 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1190 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1194 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000e_phy_force_speed_duplex_igp()
1195 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1196 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1201 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_igp()
1202 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1203 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1208 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, phy_data); in e1000e_phy_force_speed_duplex_igp()
1209 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1210 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1219 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_igp()
1221 if (ret_val) in e1000e_phy_force_speed_duplex_igp()
1222 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1228 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_igp()
1232 return ret_val; in e1000e_phy_force_speed_duplex_igp()
1248 s32 ret_val; in e1000e_phy_force_speed_duplex_m88() local
1255 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1256 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1257 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1260 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_phy_force_speed_duplex_m88()
1261 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1262 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1266 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1267 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1268 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1272 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000e_phy_force_speed_duplex_m88()
1273 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1274 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1278 ret_val = hw->phy.ops.commit(hw); in e1000e_phy_force_speed_duplex_m88()
1279 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1280 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1286 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_m88()
1288 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1289 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1298 ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, in e1000e_phy_force_speed_duplex_m88()
1300 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1301 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1302 ret_val = e1000e_phy_reset_dsp(hw); in e1000e_phy_force_speed_duplex_m88()
1303 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1304 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1309 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000e_phy_force_speed_duplex_m88()
1311 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1312 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1318 ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1319 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1320 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1327 ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); 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()
1334 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_phy_force_speed_duplex_m88()
1335 if (ret_val) in e1000e_phy_force_speed_duplex_m88()
1336 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1339 ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in e1000e_phy_force_speed_duplex_m88()
1341 return ret_val; in e1000e_phy_force_speed_duplex_m88()
1355 s32 ret_val; in e1000_phy_force_speed_duplex_ife() local
1359 ret_val = e1e_rphy(hw, MII_BMCR, &data); in e1000_phy_force_speed_duplex_ife()
1360 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1361 return ret_val; in e1000_phy_force_speed_duplex_ife()
1365 ret_val = e1e_wphy(hw, MII_BMCR, data); in e1000_phy_force_speed_duplex_ife()
1366 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1367 return ret_val; in e1000_phy_force_speed_duplex_ife()
1370 ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data); in e1000_phy_force_speed_duplex_ife()
1371 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1372 return ret_val; in e1000_phy_force_speed_duplex_ife()
1377 ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data); in e1000_phy_force_speed_duplex_ife()
1378 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1379 return ret_val; in e1000_phy_force_speed_duplex_ife()
1388 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_ife()
1390 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1391 return ret_val; in e1000_phy_force_speed_duplex_ife()
1397 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_ife()
1399 if (ret_val) in e1000_phy_force_speed_duplex_ife()
1400 return ret_val; in e1000_phy_force_speed_duplex_ife()
1482 s32 ret_val; in e1000e_set_d3_lplu_state() local
1485 ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data); in e1000e_set_d3_lplu_state()
1486 if (ret_val) in e1000e_set_d3_lplu_state()
1487 return ret_val; in e1000e_set_d3_lplu_state()
1491 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000e_set_d3_lplu_state()
1492 if (ret_val) in e1000e_set_d3_lplu_state()
1493 return ret_val; in e1000e_set_d3_lplu_state()
1500 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1502 if (ret_val) in e1000e_set_d3_lplu_state()
1503 return ret_val; in e1000e_set_d3_lplu_state()
1506 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1508 if (ret_val) in e1000e_set_d3_lplu_state()
1509 return ret_val; in e1000e_set_d3_lplu_state()
1511 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1513 if (ret_val) in e1000e_set_d3_lplu_state()
1514 return ret_val; in e1000e_set_d3_lplu_state()
1517 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000e_set_d3_lplu_state()
1519 if (ret_val) in e1000e_set_d3_lplu_state()
1520 return ret_val; in e1000e_set_d3_lplu_state()
1526 ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); in e1000e_set_d3_lplu_state()
1527 if (ret_val) in e1000e_set_d3_lplu_state()
1528 return ret_val; in e1000e_set_d3_lplu_state()
1531 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data); in e1000e_set_d3_lplu_state()
1532 if (ret_val) in e1000e_set_d3_lplu_state()
1533 return ret_val; in e1000e_set_d3_lplu_state()
1536 ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data); in e1000e_set_d3_lplu_state()
1539 return ret_val; in e1000e_set_d3_lplu_state()
1553 s32 ret_val; in e1000e_check_downshift() local
1575 ret_val = e1e_rphy(hw, offset, &phy_data); in e1000e_check_downshift()
1577 if (!ret_val) in e1000e_check_downshift()
1580 return ret_val; in e1000e_check_downshift()
1594 s32 ret_val; in e1000_check_polarity_m88() local
1597 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &data); in e1000_check_polarity_m88()
1599 if (!ret_val) in e1000_check_polarity_m88()
1604 return ret_val; in e1000_check_polarity_m88()
1619 s32 ret_val; in e1000_check_polarity_igp() local
1625 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data); in e1000_check_polarity_igp()
1626 if (ret_val) in e1000_check_polarity_igp()
1627 return ret_val; in e1000_check_polarity_igp()
1641 ret_val = e1e_rphy(hw, offset, &data); in e1000_check_polarity_igp()
1643 if (!ret_val) in e1000_check_polarity_igp()
1648 return ret_val; in e1000_check_polarity_igp()
1660 s32 ret_val; in e1000_check_polarity_ife() local
1673 ret_val = e1e_rphy(hw, offset, &phy_data); in e1000_check_polarity_ife()
1675 if (!ret_val) in e1000_check_polarity_ife()
1680 return ret_val; in e1000_check_polarity_ife()
1692 s32 ret_val = 0; in e1000_wait_autoneg() local
1697 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000_wait_autoneg()
1698 if (ret_val) in e1000_wait_autoneg()
1700 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000_wait_autoneg()
1701 if (ret_val) in e1000_wait_autoneg()
1711 return ret_val; in e1000_wait_autoneg()
1726 s32 ret_val = 0; in e1000e_phy_has_link_generic() local
1735 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000e_phy_has_link_generic()
1736 if (ret_val) { in e1000e_phy_has_link_generic()
1746 ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); in e1000e_phy_has_link_generic()
1747 if (ret_val) in e1000e_phy_has_link_generic()
1759 return ret_val; in e1000e_phy_has_link_generic()
1780 s32 ret_val; in e1000e_get_cable_length_m88() local
1783 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000e_get_cable_length_m88()
1784 if (ret_val) in e1000e_get_cable_length_m88()
1785 return ret_val; in e1000e_get_cable_length_m88()
1815 s32 ret_val; in e1000e_get_cable_length_igp_2() local
1828 ret_val = e1e_rphy(hw, agc_reg_array[i], &phy_data); in e1000e_get_cable_length_igp_2()
1829 if (ret_val) in e1000e_get_cable_length_igp_2()
1830 return ret_val; in e1000e_get_cable_length_igp_2()
1883 s32 ret_val; in e1000e_get_phy_info_m88() local
1892 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000e_get_phy_info_m88()
1893 if (ret_val) in e1000e_get_phy_info_m88()
1894 return ret_val; in e1000e_get_phy_info_m88()
1901 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in e1000e_get_phy_info_m88()
1902 if (ret_val) in e1000e_get_phy_info_m88()
1903 return ret_val; in e1000e_get_phy_info_m88()
1908 ret_val = e1000_check_polarity_m88(hw); in e1000e_get_phy_info_m88()
1909 if (ret_val) in e1000e_get_phy_info_m88()
1910 return ret_val; in e1000e_get_phy_info_m88()
1912 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in e1000e_get_phy_info_m88()
1913 if (ret_val) in e1000e_get_phy_info_m88()
1914 return ret_val; in e1000e_get_phy_info_m88()
1919 ret_val = hw->phy.ops.get_cable_length(hw); in e1000e_get_phy_info_m88()
1920 if (ret_val) in e1000e_get_phy_info_m88()
1921 return ret_val; in e1000e_get_phy_info_m88()
1923 ret_val = e1e_rphy(hw, MII_STAT1000, &phy_data); in e1000e_get_phy_info_m88()
1924 if (ret_val) in e1000e_get_phy_info_m88()
1925 return ret_val; in e1000e_get_phy_info_m88()
1939 return ret_val; in e1000e_get_phy_info_m88()
1954 s32 ret_val; in e1000e_get_phy_info_igp() local
1958 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000e_get_phy_info_igp()
1959 if (ret_val) in e1000e_get_phy_info_igp()
1960 return ret_val; in e1000e_get_phy_info_igp()
1969 ret_val = e1000_check_polarity_igp(hw); in e1000e_get_phy_info_igp()
1970 if (ret_val) in e1000e_get_phy_info_igp()
1971 return ret_val; in e1000e_get_phy_info_igp()
1973 ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data); in e1000e_get_phy_info_igp()
1974 if (ret_val) in e1000e_get_phy_info_igp()
1975 return ret_val; in e1000e_get_phy_info_igp()
1981 ret_val = phy->ops.get_cable_length(hw); in e1000e_get_phy_info_igp()
1982 if (ret_val) in e1000e_get_phy_info_igp()
1983 return ret_val; in e1000e_get_phy_info_igp()
1985 ret_val = e1e_rphy(hw, MII_STAT1000, &data); in e1000e_get_phy_info_igp()
1986 if (ret_val) in e1000e_get_phy_info_igp()
1987 return ret_val; in e1000e_get_phy_info_igp()
2000 return ret_val; in e1000e_get_phy_info_igp()
2012 s32 ret_val; in e1000_get_phy_info_ife() local
2016 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000_get_phy_info_ife()
2017 if (ret_val) in e1000_get_phy_info_ife()
2018 return ret_val; in e1000_get_phy_info_ife()
2025 ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data); in e1000_get_phy_info_ife()
2026 if (ret_val) in e1000_get_phy_info_ife()
2027 return ret_val; in e1000_get_phy_info_ife()
2031 ret_val = e1000_check_polarity_ife(hw); in e1000_get_phy_info_ife()
2032 if (ret_val) in e1000_get_phy_info_ife()
2033 return ret_val; in e1000_get_phy_info_ife()
2041 ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data); in e1000_get_phy_info_ife()
2042 if (ret_val) in e1000_get_phy_info_ife()
2043 return ret_val; in e1000_get_phy_info_ife()
2064 s32 ret_val; in e1000e_phy_sw_reset() local
2067 ret_val = e1e_rphy(hw, MII_BMCR, &phy_ctrl); in e1000e_phy_sw_reset()
2068 if (ret_val) in e1000e_phy_sw_reset()
2069 return ret_val; in e1000e_phy_sw_reset()
2072 ret_val = e1e_wphy(hw, MII_BMCR, phy_ctrl); in e1000e_phy_sw_reset()
2073 if (ret_val) in e1000e_phy_sw_reset()
2074 return ret_val; in e1000e_phy_sw_reset()
2078 return ret_val; in e1000e_phy_sw_reset()
2093 s32 ret_val; in e1000e_phy_hw_reset_generic() local
2097 ret_val = phy->ops.check_reset_block(hw); in e1000e_phy_hw_reset_generic()
2098 if (ret_val) in e1000e_phy_hw_reset_generic()
2102 ret_val = phy->ops.acquire(hw); in e1000e_phy_hw_reset_generic()
2103 if (ret_val) in e1000e_phy_hw_reset_generic()
2104 return ret_val; in e1000e_phy_hw_reset_generic()
2339 s32 ret_val; in e1000e_write_phy_reg_bm() local
2342 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm()
2343 if (ret_val) in e1000e_write_phy_reg_bm()
2344 return ret_val; in e1000e_write_phy_reg_bm()
2348 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in e1000e_write_phy_reg_bm()
2371 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, in e1000e_write_phy_reg_bm()
2373 if (ret_val) in e1000e_write_phy_reg_bm()
2377 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_bm()
2382 return ret_val; in e1000e_write_phy_reg_bm()
2397 s32 ret_val; in e1000e_read_phy_reg_bm() local
2400 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm()
2401 if (ret_val) in e1000e_read_phy_reg_bm()
2402 return ret_val; in e1000e_read_phy_reg_bm()
2406 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in e1000e_read_phy_reg_bm()
2429 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, in e1000e_read_phy_reg_bm()
2431 if (ret_val) in e1000e_read_phy_reg_bm()
2435 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_bm()
2439 return ret_val; in e1000e_read_phy_reg_bm()
2454 s32 ret_val; in e1000e_read_phy_reg_bm2() local
2457 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm2()
2458 if (ret_val) in e1000e_read_phy_reg_bm2()
2459 return ret_val; in e1000e_read_phy_reg_bm2()
2463 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in e1000e_read_phy_reg_bm2()
2472 ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, in e1000e_read_phy_reg_bm2()
2475 if (ret_val) in e1000e_read_phy_reg_bm2()
2479 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_read_phy_reg_bm2()
2483 return ret_val; in e1000e_read_phy_reg_bm2()
2497 s32 ret_val; in e1000e_write_phy_reg_bm2() local
2500 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm2()
2501 if (ret_val) in e1000e_write_phy_reg_bm2()
2502 return ret_val; in e1000e_write_phy_reg_bm2()
2506 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in e1000e_write_phy_reg_bm2()
2515 ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, in e1000e_write_phy_reg_bm2()
2518 if (ret_val) in e1000e_write_phy_reg_bm2()
2522 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, in e1000e_write_phy_reg_bm2()
2527 return ret_val; in e1000e_write_phy_reg_bm2()
2540 s32 ret_val; in e1000_enable_phy_wakeup_reg_access_bm() local
2547 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); in e1000_enable_phy_wakeup_reg_access_bm()
2548 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2550 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2553 ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, phy_reg); in e1000_enable_phy_wakeup_reg_access_bm()
2554 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2557 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2567 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, temp); in e1000_enable_phy_wakeup_reg_access_bm()
2568 if (ret_val) { in e1000_enable_phy_wakeup_reg_access_bm()
2571 return ret_val; in e1000_enable_phy_wakeup_reg_access_bm()
2593 s32 ret_val; in e1000_disable_phy_wakeup_reg_access_bm() local
2596 ret_val = e1000_set_page_igp(hw, (BM_PORT_CTRL_PAGE << IGP_PAGE_SHIFT)); in e1000_disable_phy_wakeup_reg_access_bm()
2597 if (ret_val) { in e1000_disable_phy_wakeup_reg_access_bm()
2599 return ret_val; in e1000_disable_phy_wakeup_reg_access_bm()
2603 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, *phy_reg); in e1000_disable_phy_wakeup_reg_access_bm()
2604 if (ret_val) in e1000_disable_phy_wakeup_reg_access_bm()
2608 return ret_val; in e1000_disable_phy_wakeup_reg_access_bm()
2639 s32 ret_val; in e1000_access_phy_wakeup_reg_bm() local
2652 ret_val = e1000_enable_phy_wakeup_reg_access_bm(hw, &phy_reg); in e1000_access_phy_wakeup_reg_bm()
2653 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2655 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2662 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_ADDRESS_OPCODE, reg); in e1000_access_phy_wakeup_reg_bm()
2663 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2665 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2670 ret_val = e1000e_read_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE, in e1000_access_phy_wakeup_reg_bm()
2674 ret_val = e1000e_write_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE, in e1000_access_phy_wakeup_reg_bm()
2678 if (ret_val) { in e1000_access_phy_wakeup_reg_bm()
2680 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2684 ret_val = e1000_disable_phy_wakeup_reg_access_bm(hw, &phy_reg); in e1000_access_phy_wakeup_reg_bm()
2686 return ret_val; in e1000_access_phy_wakeup_reg_bm()
2751 s32 ret_val; in __e1000_read_phy_reg_hv() local
2757 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_phy_reg_hv()
2758 if (ret_val) in __e1000_read_phy_reg_hv()
2759 return ret_val; in __e1000_read_phy_reg_hv()
2764 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, in __e1000_read_phy_reg_hv()
2770 ret_val = e1000_access_phy_debug_regs_hv(hw, offset, in __e1000_read_phy_reg_hv()
2781 ret_val = e1000_set_page_igp(hw, in __e1000_read_phy_reg_hv()
2786 if (ret_val) in __e1000_read_phy_reg_hv()
2794 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, data); in __e1000_read_phy_reg_hv()
2799 return ret_val; in __e1000_read_phy_reg_hv()
2859 s32 ret_val; in __e1000_write_phy_reg_hv() local
2865 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_phy_reg_hv()
2866 if (ret_val) in __e1000_write_phy_reg_hv()
2867 return ret_val; in __e1000_write_phy_reg_hv()
2872 ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, in __e1000_write_phy_reg_hv()
2878 ret_val = e1000_access_phy_debug_regs_hv(hw, offset, in __e1000_write_phy_reg_hv()
2896 ret_val = e1000_access_phy_debug_regs_hv(hw, in __e1000_write_phy_reg_hv()
2899 if (ret_val) in __e1000_write_phy_reg_hv()
2905 ret_val = e1000_set_page_igp(hw, in __e1000_write_phy_reg_hv()
2910 if (ret_val) in __e1000_write_phy_reg_hv()
2918 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, in __e1000_write_phy_reg_hv()
2925 return ret_val; in __e1000_write_phy_reg_hv()
2999 s32 ret_val; in e1000_access_phy_debug_regs_hv() local
3012 ret_val = e1000e_write_phy_reg_mdic(hw, addr_reg, (u16)offset & 0x3F); in e1000_access_phy_debug_regs_hv()
3013 if (ret_val) { in e1000_access_phy_debug_regs_hv()
3015 return ret_val; in e1000_access_phy_debug_regs_hv()
3020 ret_val = e1000e_read_phy_reg_mdic(hw, data_reg, data); in e1000_access_phy_debug_regs_hv()
3022 ret_val = e1000e_write_phy_reg_mdic(hw, data_reg, *data); in e1000_access_phy_debug_regs_hv()
3024 if (ret_val) in e1000_access_phy_debug_regs_hv()
3027 return ret_val; in e1000_access_phy_debug_regs_hv()
3043 s32 ret_val = 0; in e1000_link_stall_workaround_hv() local
3050 ret_val = e1e_rphy(hw, MII_BMCR, &data); in e1000_link_stall_workaround_hv()
3051 if (ret_val) { in e1000_link_stall_workaround_hv()
3053 return ret_val; in e1000_link_stall_workaround_hv()
3059 ret_val = e1e_rphy(hw, BM_CS_STATUS, &data); in e1000_link_stall_workaround_hv()
3060 if (ret_val) in e1000_link_stall_workaround_hv()
3061 return ret_val; in e1000_link_stall_workaround_hv()
3073 ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, in e1000_link_stall_workaround_hv()
3076 if (ret_val) in e1000_link_stall_workaround_hv()
3077 return ret_val; in e1000_link_stall_workaround_hv()
3093 s32 ret_val; in e1000_check_polarity_82577() local
3096 ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data); in e1000_check_polarity_82577()
3098 if (!ret_val) in e1000_check_polarity_82577()
3103 return ret_val; in e1000_check_polarity_82577()
3115 s32 ret_val; in e1000_phy_force_speed_duplex_82577() local
3119 ret_val = e1e_rphy(hw, MII_BMCR, &phy_data); in e1000_phy_force_speed_duplex_82577()
3120 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3121 return ret_val; in e1000_phy_force_speed_duplex_82577()
3125 ret_val = e1e_wphy(hw, MII_BMCR, phy_data); in e1000_phy_force_speed_duplex_82577()
3126 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3127 return ret_val; in e1000_phy_force_speed_duplex_82577()
3134 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_82577()
3136 if (ret_val) in e1000_phy_force_speed_duplex_82577()
3137 return ret_val; in e1000_phy_force_speed_duplex_82577()
3143 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT, in e1000_phy_force_speed_duplex_82577()
3147 return ret_val; in e1000_phy_force_speed_duplex_82577()
3162 s32 ret_val; in e1000_get_phy_info_82577() local
3166 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); in e1000_get_phy_info_82577()
3167 if (ret_val) in e1000_get_phy_info_82577()
3168 return ret_val; in e1000_get_phy_info_82577()
3177 ret_val = e1000_check_polarity_82577(hw); in e1000_get_phy_info_82577()
3178 if (ret_val) in e1000_get_phy_info_82577()
3179 return ret_val; in e1000_get_phy_info_82577()
3181 ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data); in e1000_get_phy_info_82577()
3182 if (ret_val) in e1000_get_phy_info_82577()
3183 return ret_val; in e1000_get_phy_info_82577()
3189 ret_val = hw->phy.ops.get_cable_length(hw); in e1000_get_phy_info_82577()
3190 if (ret_val) in e1000_get_phy_info_82577()
3191 return ret_val; in e1000_get_phy_info_82577()
3193 ret_val = e1e_rphy(hw, MII_STAT1000, &data); in e1000_get_phy_info_82577()
3194 if (ret_val) in e1000_get_phy_info_82577()
3195 return ret_val; in e1000_get_phy_info_82577()
3221 s32 ret_val; in e1000_get_cable_length_82577() local
3224 ret_val = e1e_rphy(hw, I82577_PHY_DIAG_STATUS, &phy_data); in e1000_get_cable_length_82577()
3225 if (ret_val) in e1000_get_cable_length_82577()
3226 return ret_val; in e1000_get_cable_length_82577()