diff mbox series

net: mvpp2: Add EEE get/set to mvpp2 driver

Message ID 20240118015748.3507954-1-elliot.ayrey@alliedtelesis.co.nz (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: mvpp2: Add EEE get/set to mvpp2 driver | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1148 this patch: 1148
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1107 this patch: 1107
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1164 this patch: 1164
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 34 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-01-18--03-00 (tests: 403)

Commit Message

Elliot Ayrey Jan. 18, 2024, 1:57 a.m. UTC
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(+)

Comments

Russell King (Oracle) Jan. 18, 2024, 8:36 a.m. UTC | #1
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.
diff mbox series

Patch

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