Commit 8b882dbb authored by Kevin Hao's avatar Kevin Hao Committed by Greg Kroah-Hartman

net: phy: Add general dummy stubs for MMD register access

[ Upstream commit 5df7af85 ]

For some phy devices, even though they don't support the MMD extended
register access, it does have some side effect if we are trying to
read/write the MMD registers via indirect method. So introduce general
dummy stubs for MMD register access which these devices can use to avoid
such side effect.

Fixes: b6b5e8a6 ("gianfar: Disable EEE autoneg by default")
Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8d9d7f01
......@@ -1641,6 +1641,23 @@ int genphy_config_init(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_config_init);
/* This is used for the phy device which doesn't support the MMD extended
* register access, but it does have side effect when we are trying to access
* the MMD register via indirect method.
*/
int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, u16 regnum)
{
return -EOPNOTSUPP;
}
EXPORT_SYMBOL(genphy_read_mmd_unsupported);
int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
u16 regnum, u16 val)
{
return -EOPNOTSUPP;
}
EXPORT_SYMBOL(genphy_write_mmd_unsupported);
int genphy_suspend(struct phy_device *phydev)
{
int value;
......
......@@ -879,6 +879,10 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev)
{
return 0;
}
int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad,
u16 regnum);
int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
u16 regnum, u16 val);
/* Clause 45 PHY */
int genphy_c45_restart_aneg(struct phy_device *phydev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment