Commit 3d21ac6f authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-Add-general-dummy-stubs-for-MMD-register-access'

Kevin Hao says:

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

v2:
As suggested by Andrew:
  - Add general dummy stubs
  - Also use that for the micrel phy

This patch series fix the Ethernet broken on the mpc8315erdb board introduced
by commit b6b5e8a6 ("gianfar: Disable EEE autoneg by default").
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ee54a9f9 c846a2b7
...@@ -635,25 +635,6 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev) ...@@ -635,25 +635,6 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
return 0; return 0;
} }
/* This routine returns -1 as an indication to the caller that the
* Micrel ksz9021 10/100/1000 PHY does not support standard IEEE
* MMD extended PHY registers.
*/
static int
ksz9021_rd_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum)
{
return -1;
}
/* This routine does nothing since the Micrel ksz9021 does not support
* standard IEEE MMD extended PHY registers.
*/
static int
ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum, u16 val)
{
return -1;
}
static int kszphy_get_sset_count(struct phy_device *phydev) static int kszphy_get_sset_count(struct phy_device *phydev)
{ {
return ARRAY_SIZE(kszphy_hw_stats); return ARRAY_SIZE(kszphy_hw_stats);
...@@ -946,8 +927,8 @@ static struct phy_driver ksphy_driver[] = { ...@@ -946,8 +927,8 @@ static struct phy_driver ksphy_driver[] = {
.get_stats = kszphy_get_stats, .get_stats = kszphy_get_stats,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
.read_mmd = ksz9021_rd_mmd_phyreg, .read_mmd = genphy_read_mmd_unsupported,
.write_mmd = ksz9021_wr_mmd_phyreg, .write_mmd = genphy_write_mmd_unsupported,
}, { }, {
.phy_id = PHY_ID_KSZ9031, .phy_id = PHY_ID_KSZ9031,
.phy_id_mask = MICREL_PHY_ID_MASK, .phy_id_mask = MICREL_PHY_ID_MASK,
......
...@@ -1673,6 +1673,23 @@ int genphy_config_init(struct phy_device *phydev) ...@@ -1673,6 +1673,23 @@ int genphy_config_init(struct phy_device *phydev)
} }
EXPORT_SYMBOL(genphy_config_init); 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 genphy_suspend(struct phy_device *phydev)
{ {
return phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN); return phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN);
......
...@@ -172,6 +172,8 @@ static struct phy_driver realtek_drvs[] = { ...@@ -172,6 +172,8 @@ static struct phy_driver realtek_drvs[] = {
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.ack_interrupt = &rtl821x_ack_interrupt, .ack_interrupt = &rtl821x_ack_interrupt,
.config_intr = &rtl8211b_config_intr, .config_intr = &rtl8211b_config_intr,
.read_mmd = &genphy_read_mmd_unsupported,
.write_mmd = &genphy_write_mmd_unsupported,
}, { }, {
.phy_id = 0x001cc914, .phy_id = 0x001cc914,
.name = "RTL8211DN Gigabit Ethernet", .name = "RTL8211DN Gigabit Ethernet",
......
...@@ -984,6 +984,10 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev) ...@@ -984,6 +984,10 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev)
{ {
return 0; 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 */ /* Clause 45 PHY */
int genphy_c45_restart_aneg(struct phy_device *phydev); 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