[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230220135605.1136137-3-o.rempel@pengutronix.de>
Date: Mon, 20 Feb 2023 14:56:03 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Russell King <linux@...linux.org.uk>
Subject: [PATCH net-next v1 2/4] net: phy: c45: add genphy_c45_an_config_eee_aneg() function
Add new genphy_c45_an_config_eee_aneg() function and replace some of
genphy_c45_write_eee_adv() calls. This will be needed by the next patch.
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
drivers/net/phy/phy-c45.c | 12 +++++++++++-
drivers/net/phy/phy_device.c | 2 +-
include/linux/phy.h | 1 +
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index f23cce2c5199..904f64818922 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -262,7 +262,7 @@ int genphy_c45_an_config_aneg(struct phy_device *phydev)
linkmode_and(phydev->advertising, phydev->advertising,
phydev->supported);
- ret = genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
+ ret = genphy_c45_an_config_eee_aneg(phydev);
if (ret < 0)
return ret;
else if (ret)
@@ -858,6 +858,16 @@ int genphy_c45_read_eee_abilities(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_read_eee_abilities);
+/**
+ * genphy_c45_an_config_eee_aneg - write advertised EEE link modes
+ * @phydev: target phy_device struct
+ * @adv: the linkmode advertisement settings
+ */
+int genphy_c45_an_config_eee_aneg(struct phy_device *phydev)
+{
+ return genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
+}
+
/**
* genphy_c45_pma_read_abilities - read supported link modes from PMA
* @phydev: target phy_device struct
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8d927c5e3bf8..0c47665effaf 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2231,7 +2231,7 @@ int __genphy_config_aneg(struct phy_device *phydev, bool changed)
{
int err;
- err = genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
+ err = genphy_c45_an_config_eee_aneg(phydev);
if (err < 0)
return err;
else if (err)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 727bff531a14..19d83e112beb 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1765,6 +1765,7 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
struct ethtool_eee *data);
int genphy_c45_write_eee_adv(struct phy_device *phydev, unsigned long *adv);
+int genphy_c45_an_config_eee_aneg(struct phy_device *phydev);
/* Generic C45 PHY driver */
extern struct phy_driver genphy_c45_driver;
--
2.30.2
Powered by blists - more mailing lists