aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0018-sdk_dpaa-use-new-api-ethtool_ksettings_-get-set.patch
blob: 0df382e7d92f8d6b4352ef2632a2ca87493b5557 (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
56
57
58
59
60
61
62
63
64
65
From c77e142beed7241a1360f2dedbe34e2f697512c9 Mon Sep 17 00:00:00 2001
From: Madalin Bucur <madalin.bucur@nxp.com>
Date: Tue, 29 Aug 2017 09:51:45 +0300
Subject: [PATCH] sdk_dpaa: use new api ethtool_ksettings_{get|set}

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
---
 .../net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c   | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c
@@ -84,8 +84,8 @@ static char dpa_stats_global[][ETH_GSTRI
 #define DPA_STATS_PERCPU_LEN ARRAY_SIZE(dpa_stats_percpu)
 #define DPA_STATS_GLOBAL_LEN ARRAY_SIZE(dpa_stats_global)
 
-static int __cold dpa_get_settings(struct net_device *net_dev,
-		struct ethtool_cmd *et_cmd)
+static int __cold dpa_get_ksettings(struct net_device *net_dev,
+		struct ethtool_link_ksettings *cmd)
 {
 	int			 _errno;
 	struct dpa_priv_s	*priv;
@@ -101,15 +101,13 @@ static int __cold dpa_get_settings(struc
 		return 0;
 	}
 
-	_errno = phy_ethtool_gset(priv->mac_dev->phy_dev, et_cmd);
-	if (unlikely(_errno < 0))
-		netdev_err(net_dev, "phy_ethtool_gset() = %d\n", _errno);
+	phy_ethtool_ksettings_get(priv->mac_dev->phy_dev, cmd);
 
 	return _errno;
 }
 
-static int __cold dpa_set_settings(struct net_device *net_dev,
-		struct ethtool_cmd *et_cmd)
+static int __cold dpa_set_ksettings(struct net_device *net_dev,
+		struct ethtool_link_ksettings *cmd)
 {
 	int			 _errno;
 	struct dpa_priv_s	*priv;
@@ -125,9 +123,9 @@ static int __cold dpa_set_settings(struc
 		return -ENODEV;
 	}
 
-	_errno = phy_ethtool_sset(priv->mac_dev->phy_dev, et_cmd);
+	_errno = phy_ethtool_ksettings_set(priv->mac_dev->phy_dev, cmd);
 	if (unlikely(_errno < 0))
-		netdev_err(net_dev, "phy_ethtool_sset() = %d\n", _errno);
+		netdev_err(net_dev, "phy_ethtool_ksettings_set() = %d\n", _errno);
 
 	return _errno;
 }
@@ -522,8 +520,8 @@ static void dpa_get_strings(struct net_d
 }
 
 const struct ethtool_ops dpa_ethtool_ops = {
-	.get_settings = dpa_get_settings,
-	.set_settings = dpa_set_settings,
+	.get_link_ksettings = dpa_get_ksettings,
+	.set_link_ksettings = dpa_set_ksettings,
 	.get_drvinfo = dpa_get_drvinfo,
 	.get_msglevel = dpa_get_msglevel,
 	.set_msglevel = dpa_set_msglevel,