Commit 7d827379 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-clean-up-the-old-gen10g-functions'

Heiner Kallweit says:

====================
net: phy: clean up the old gen10g functions

The old gen10g_ functions are mainly stubs and have been superseded
by genphy_c45_ equivalents. So lets remove / hide the old functions
as far as possible.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6bfc1128 7be3ad84
...@@ -80,10 +80,9 @@ static struct phy_driver cortina_driver[] = { ...@@ -80,10 +80,9 @@ static struct phy_driver cortina_driver[] = {
.phy_id_mask = 0xffffffff, .phy_id_mask = 0xffffffff,
.name = "Cortina CS4340", .name = "Cortina CS4340",
.features = PHY_10GBIT_FEATURES, .features = PHY_10GBIT_FEATURES,
.config_init = gen10g_config_init,
.config_aneg = gen10g_config_aneg, .config_aneg = gen10g_config_aneg,
.read_status = cortina_read_status, .read_status = cortina_read_status,
.soft_reset = gen10g_no_soft_reset, .soft_reset = genphy_no_soft_reset,
.probe = cortina_probe, .probe = cortina_probe,
}, },
}; };
......
...@@ -459,7 +459,7 @@ static struct phy_driver mv3310_drivers[] = { ...@@ -459,7 +459,7 @@ static struct phy_driver mv3310_drivers[] = {
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
.name = "mv88x3310", .name = "mv88x3310",
.get_features = mv3310_get_features, .get_features = mv3310_get_features,
.soft_reset = gen10g_no_soft_reset, .soft_reset = genphy_no_soft_reset,
.config_init = mv3310_config_init, .config_init = mv3310_config_init,
.probe = mv3310_probe, .probe = mv3310_probe,
.suspend = mv3310_suspend, .suspend = mv3310_suspend,
...@@ -474,7 +474,7 @@ static struct phy_driver mv3310_drivers[] = { ...@@ -474,7 +474,7 @@ static struct phy_driver mv3310_drivers[] = {
.name = "mv88x2110", .name = "mv88x2110",
.get_features = genphy_c45_pma_read_abilities, .get_features = genphy_c45_pma_read_abilities,
.probe = mv3310_probe, .probe = mv3310_probe,
.soft_reset = gen10g_no_soft_reset, .soft_reset = genphy_no_soft_reset,
.config_init = mv3310_config_init, .config_init = mv3310_config_init,
.config_aneg = mv3310_config_aneg, .config_aneg = mv3310_config_aneg,
.aneg_done = mv3310_aneg_done, .aneg_done = mv3310_aneg_done,
......
...@@ -499,7 +499,7 @@ int gen10g_config_aneg(struct phy_device *phydev) ...@@ -499,7 +499,7 @@ int gen10g_config_aneg(struct phy_device *phydev)
} }
EXPORT_SYMBOL_GPL(gen10g_config_aneg); EXPORT_SYMBOL_GPL(gen10g_config_aneg);
int gen10g_read_status(struct phy_device *phydev) static int gen10g_read_status(struct phy_device *phydev)
{ {
/* For now just lie and say it's 10G all the time */ /* For now just lie and say it's 10G all the time */
phydev->speed = SPEED_10000; phydev->speed = SPEED_10000;
...@@ -507,49 +507,13 @@ int gen10g_read_status(struct phy_device *phydev) ...@@ -507,49 +507,13 @@ int gen10g_read_status(struct phy_device *phydev)
return genphy_c45_read_link(phydev); return genphy_c45_read_link(phydev);
} }
EXPORT_SYMBOL_GPL(gen10g_read_status);
int gen10g_no_soft_reset(struct phy_device *phydev)
{
/* Do nothing for now */
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_no_soft_reset);
int gen10g_config_init(struct phy_device *phydev)
{
/* Temporarily just say we support everything */
linkmode_zero(phydev->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
phydev->supported);
linkmode_copy(phydev->advertising, phydev->supported);
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_config_init);
int gen10g_suspend(struct phy_device *phydev)
{
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_suspend);
int gen10g_resume(struct phy_device *phydev)
{
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_resume);
struct phy_driver genphy_10g_driver = { struct phy_driver genphy_10g_driver = {
.phy_id = 0xffffffff, .phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff, .phy_id_mask = 0xffffffff,
.name = "Generic 10G PHY", .name = "Generic 10G PHY",
.soft_reset = gen10g_no_soft_reset, .soft_reset = genphy_no_soft_reset,
.config_init = gen10g_config_init,
.features = PHY_10GBIT_FEATURES, .features = PHY_10GBIT_FEATURES,
.config_aneg = gen10g_config_aneg, .config_aneg = gen10g_config_aneg,
.read_status = gen10g_read_status, .read_status = gen10g_read_status,
.suspend = gen10g_suspend,
.resume = gen10g_resume,
}; };
...@@ -144,13 +144,9 @@ int phy_aneg_done(struct phy_device *phydev) ...@@ -144,13 +144,9 @@ int phy_aneg_done(struct phy_device *phydev)
{ {
if (phydev->drv && phydev->drv->aneg_done) if (phydev->drv && phydev->drv->aneg_done)
return phydev->drv->aneg_done(phydev); return phydev->drv->aneg_done(phydev);
else if (phydev->is_c45)
/* Avoid genphy_aneg_done() if the Clause 45 PHY does not return genphy_c45_aneg_done(phydev);
* implement Clause 22 registers else
*/
if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
return -EINVAL;
return genphy_aneg_done(phydev); return genphy_aneg_done(phydev);
} }
EXPORT_SYMBOL(phy_aneg_done); EXPORT_SYMBOL(phy_aneg_done);
......
...@@ -78,9 +78,8 @@ static struct phy_driver teranetics_driver[] = { ...@@ -78,9 +78,8 @@ static struct phy_driver teranetics_driver[] = {
.phy_id_mask = 0xffffffff, .phy_id_mask = 0xffffffff,
.name = "Teranetics TN2020", .name = "Teranetics TN2020",
.features = PHY_10GBIT_FEATURES, .features = PHY_10GBIT_FEATURES,
.soft_reset = gen10g_no_soft_reset, .soft_reset = genphy_no_soft_reset,
.aneg_done = teranetics_aneg_done, .aneg_done = teranetics_aneg_done,
.config_init = gen10g_config_init,
.config_aneg = gen10g_config_aneg, .config_aneg = gen10g_config_aneg,
.read_status = teranetics_read_status, .read_status = teranetics_read_status,
.match_phy_device = teranetics_match_phy_device, .match_phy_device = teranetics_match_phy_device,
......
...@@ -1119,11 +1119,6 @@ int genphy_c45_read_status(struct phy_device *phydev); ...@@ -1119,11 +1119,6 @@ int genphy_c45_read_status(struct phy_device *phydev);
/* The gen10g_* functions are the old Clause 45 stub */ /* The gen10g_* functions are the old Clause 45 stub */
int gen10g_config_aneg(struct phy_device *phydev); int gen10g_config_aneg(struct phy_device *phydev);
int gen10g_read_status(struct phy_device *phydev);
int gen10g_no_soft_reset(struct phy_device *phydev);
int gen10g_config_init(struct phy_device *phydev);
int gen10g_suspend(struct phy_device *phydev);
int gen10g_resume(struct phy_device *phydev);
static inline int phy_read_status(struct phy_device *phydev) static inline int phy_read_status(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