MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / __genphy_restart_aneg

Function __genphy_restart_aneg

components/drivers/phy/general.c:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100int __genphy_restart_aneg(struct rt_phy_device *phydev)
101{
102 int ctl;
103
104 ctl = rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMCR);
105
106 if (ctl < 0)
107 return ctl;
108
109 ctl |= (RT_BMCR_ANENABLE | RT_BMCR_ANRESTART);
110
111 ctl &= ~(RT_BMCR_ISOLATE);
112
113 ctl = rt_phy_write(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMCR, ctl);
114
115 return ctl;
116}
117
118int rt_genphy_config_aneg(struct rt_phy_device *phydev)
119{

Callers 1

rt_genphy_config_anegFunction · 0.85

Calls 2

rt_phy_readFunction · 0.70
rt_phy_writeFunction · 0.70

Tested by

no test coverage detected