aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0159-staging-fsl-dpaa2-mac-Update-ethtool-ops.patch
blob: 5276ee1c2ac39ad77e3a75dd9e4ef557a2790c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From f964e8840c12e0659c4cfe7aa7d66b310e09ca51 Mon Sep 17 00:00:00 2001
From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Date: Tue, 22 Aug 2017 15:00:29 +0300
Subject: [PATCH] staging: fsl-dpaa2/mac: Update ethtool ops

Ethtool ops get/set_settings() are deprecated, so implement
get/set_link_ksettings() instead.

These now call the corresponding phy_ethtool_ksettings_*
generic functions, as the old ones also got deprecated
and removed from the kernel entirely.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
 drivers/staging/fsl-dpaa2/mac/mac.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/drivers/staging/fsl-dpaa2/mac/mac.c
+++ b/drivers/staging/fsl-dpaa2/mac/mac.c
@@ -152,16 +152,18 @@ done:
 	return 0;
 }
 
-static int dpaa2_mac_get_settings(struct net_device *netdev,
-				  struct ethtool_cmd *cmd)
+static int dpaa2_mac_get_link_ksettings(struct net_device *netdev,
+					struct ethtool_link_ksettings *ks)
 {
-	return phy_ethtool_gset(netdev->phydev, cmd);
+	phy_ethtool_ksettings_get(netdev->phydev, ks);
+
+	return 0;
 }
 
-static int dpaa2_mac_set_settings(struct net_device *netdev,
-				  struct ethtool_cmd *cmd)
+static int dpaa2_mac_set_link_ksettings(struct net_device *netdev,
+					const struct ethtool_link_ksettings *ks)
 {
-	return phy_ethtool_sset(netdev->phydev, cmd);
+	return phy_ethtool_ksettings_set(netdev->phydev, ks);
 }
 
 static void dpaa2_mac_get_stats(struct net_device *netdev,
@@ -319,8 +321,8 @@ static const struct net_device_ops dpaa2
 };
 
 static const struct ethtool_ops dpaa2_mac_ethtool_ops = {
-	.get_settings		= &dpaa2_mac_get_settings,
-	.set_settings		= &dpaa2_mac_set_settings,
+	.get_link_ksettings	= &dpaa2_mac_get_link_ksettings,
+	.set_link_ksettings	= &dpaa2_mac_set_link_ksettings,
 	.get_strings		= &dpaa2_mac_get_strings,
 	.get_ethtool_stats	= &dpaa2_mac_get_ethtool_stats,
 	.get_sset_count		= &dpaa2_mac_get_sset_count,