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

Elliot Ayrey
2024-01-18T01:58:13Z

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