Skip to content

Commit

Permalink
net: phy: Export gen10g_* functions
Browse files Browse the repository at this point in the history
In order to remove a fair amount of duplication in the different 10G PHY
drivers, export all gen10g_* functions to be able to make use of those.
While we are at it, rename gen10g_soft_reset() to gen10g_no_soft_reset()
to illustrate what it does.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Mar 2, 2018
1 parent 6ed33d3 commit e8a714e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
20 changes: 13 additions & 7 deletions drivers/net/phy/phy-c45.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,13 @@ EXPORT_SYMBOL_GPL(genphy_c45_read_mdix);

/* The gen10g_* functions are the old Clause 45 stub */

static int gen10g_config_aneg(struct phy_device *phydev)
int gen10g_config_aneg(struct phy_device *phydev)
{
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_config_aneg);

static int gen10g_read_status(struct phy_device *phydev)
int gen10g_read_status(struct phy_device *phydev)
{
u32 mmd_mask = phydev->c45_ids.devices_in_package;
int ret;
Expand All @@ -291,37 +292,42 @@ static int gen10g_read_status(struct phy_device *phydev)

return 0;
}
EXPORT_SYMBOL_GPL(gen10g_read_status);

static int gen10g_soft_reset(struct phy_device *phydev)
int gen10g_no_soft_reset(struct phy_device *phydev)
{
/* Do nothing for now */
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_no_soft_reset);

static int gen10g_config_init(struct phy_device *phydev)
int gen10g_config_init(struct phy_device *phydev)
{
/* Temporarily just say we support everything */
phydev->supported = SUPPORTED_10000baseT_Full;
phydev->advertising = SUPPORTED_10000baseT_Full;

return 0;
}
EXPORT_SYMBOL_GPL(gen10g_config_init);

static int gen10g_suspend(struct phy_device *phydev)
int gen10g_suspend(struct phy_device *phydev)
{
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_suspend);

static int gen10g_resume(struct phy_device *phydev)
int gen10g_resume(struct phy_device *phydev)
{
return 0;
}
EXPORT_SYMBOL_GPL(gen10g_resume);

struct phy_driver genphy_10g_driver = {
.phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff,
.name = "Generic 10G PHY",
.soft_reset = gen10g_soft_reset,
.soft_reset = gen10g_no_soft_reset,
.config_init = gen10g_config_init,
.features = 0,
.config_aneg = gen10g_config_aneg,
Expand Down
8 changes: 8 additions & 0 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,14 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev);
int genphy_c45_an_disable_aneg(struct phy_device *phydev);
int genphy_c45_read_mdix(struct phy_device *phydev);

/* The gen10g_* functions are the old Clause 45 stub */
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)
{
if (!phydev->drv)
Expand Down

0 comments on commit e8a714e

Please sign in to comment.