[PATCH] net: mvpp2: Add EEE get/set to mvpp2 driver

Elliot Ayrey posted 1 patch 1 year, 11 months ago
.../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
[PATCH] net: mvpp2: Add EEE get/set to mvpp2 driver
Posted by Elliot Ayrey 1 year, 11 months ago
Fill in the missing .get_eee and .set_eee functions for the mvpp2
driver.

Signed-off-by: Elliot Ayrey <elliot.ayrey@alliedtelesis.co.nz>
---
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 820b1fabe297..85dc06c85b31 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5701,6 +5701,26 @@ static int mvpp2_ethtool_set_rxfh(struct net_device *dev,
 	return ret;
 }
 
+static int mvpp2_get_eee(struct net_device *dev, struct ethtool_eee *edata)
+{
+	int ret = -EOPNOTSUPP;
+
+	if (dev->phydev)
+		ret = phy_ethtool_get_eee(dev->phydev, edata);
+
+	return ret;
+}
+
+static int mvpp2_set_eee(struct net_device *dev, struct ethtool_eee *edata)
+{
+	int ret = -EOPNOTSUPP;
+
+	if (dev->phydev)
+		ret = phy_ethtool_set_eee(dev->phydev, edata);
+
+	return ret;
+}
+
 /* Device ops */
 
 static const struct net_device_ops mvpp2_netdev_ops = {
@@ -5743,6 +5763,8 @@ static const struct ethtool_ops mvpp2_eth_tool_ops = {
 	.get_rxfh_indir_size	= mvpp2_ethtool_get_rxfh_indir_size,
 	.get_rxfh		= mvpp2_ethtool_get_rxfh,
 	.set_rxfh		= mvpp2_ethtool_set_rxfh,
+	.get_eee		= mvpp2_get_eee,
+	.set_eee		= mvpp2_set_eee,
 };
 
 /* Used for PPv2.1, or PPv2.2 with the old Device Tree binding that
-- 
2.43.0
Re: [PATCH] net: mvpp2: Add EEE get/set to mvpp2 driver
Posted by Russell King (Oracle) 1 year, 11 months ago
On Thu, Jan 18, 2024 at 02:57:48PM +1300, Elliot Ayrey wrote:
> Fill in the missing .get_eee and .set_eee functions for the mvpp2
> driver.

This has no benefit without also configuring LPI in the driver.
In any case, you should be calling the phylink functions not the
phylib functions.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!