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

Function rt_phy_write_mmd

components/drivers/phy/phy.c:206–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206int rt_phy_write_mmd(struct rt_phy_device *phydev, int devad, int regnum, rt_uint16_t val)
207{
208 struct rt_phy_driver *drv = phydev->drv;
209
210 if (regnum > (rt_uint16_t)~0 || devad > 32 || !drv)
211 return -EINVAL;
212
213 if (drv->write_mmd)
214 return drv->write_mmd(phydev, devad, regnum, val);
215
216 if ((drv->features & RT_PHY_10G_FEATURES) == RT_PHY_10G_FEATURES ||
217 devad == RT_MDIO_DEVAD_NONE || !devad)
218 return rt_phy_write(phydev, devad, regnum, val);
219
220 rt_phy_mmd_start_indirect(phydev, devad, regnum);
221
222 return rt_phy_write(phydev, RT_MDIO_DEVAD_NONE, RT_MII_MMD_DATA, val);
223}
224
225int rt_phy_reset(struct rt_phy_device *phydev)
226{

Callers

nothing calls this directly

Calls 2

rt_phy_writeFunction · 0.70

Tested by

no test coverage detected