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

Function rt_phy_read_mmd

components/drivers/phy/phy.c:187–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187int rt_phy_read_mmd(struct rt_phy_device *phydev, int devad, int regnum)
188{
189 struct rt_phy_driver *drv = phydev->drv;
190
191 if (regnum > (rt_uint16_t)~0 || devad > 32 || !drv)
192 return -EINVAL;
193
194 if (drv->read_mmd)
195 return drv->read_mmd(phydev, devad, regnum);
196
197 if ((drv->features & RT_PHY_10G_FEATURES) == RT_PHY_10G_FEATURES ||
198 devad == RT_MDIO_DEVAD_NONE || !devad)
199 return rt_phy_read(phydev, devad, regnum);
200
201 rt_phy_mmd_start_indirect(phydev, devad, regnum);
202
203 return rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_MMD_DATA);
204}
205
206int rt_phy_write_mmd(struct rt_phy_device *phydev, int devad, int regnum, rt_uint16_t val)
207{

Callers

nothing calls this directly

Calls 2

rt_phy_readFunction · 0.70

Tested by

no test coverage detected