Blob Blame History Raw
From d09ab11033b2fc10860b7316af38b9fcd63421c8 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Fri, 26 May 2017 18:10:29 +0200
Subject: [PATCH 2/3] dpaa2: Use legacy ethtool interface
Patch-mainline: Never, only needed to make code work with SP3 kernel
References: bsc#1041022

SP3 does not know the ksettings based ethtool interface. Convert the dpaa2
driver to use the legacy get/set one.

Signed-off-by: Alexander Graf <agraf@suse.de>

---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index dd0cffa..6d880e4 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -85,8 +85,8 @@ static void dpaa2_eth_get_drvinfo(struct net_device *net_dev,
 }
 
 static int
-dpaa2_eth_get_link_ksettings(struct net_device *net_dev,
-			     struct ethtool_link_ksettings *link_settings)
+dpaa2_eth_get_settings(struct net_device *net_dev,
+		       struct ethtool_cmd *cmd)
 {
 	struct dpni_link_state state = {0};
 	int err = 0;
@@ -104,18 +104,18 @@ dpaa2_eth_get_link_ksettings(struct net_device *net_dev,
 	 * beyond the DPNI attributes.
 	 */
 	if (state.options & DPNI_LINK_OPT_AUTONEG)
-		link_settings->base.autoneg = AUTONEG_ENABLE;
+		cmd->autoneg = AUTONEG_ENABLE;
 	if (!(state.options & DPNI_LINK_OPT_HALF_DUPLEX))
-		link_settings->base.duplex = DUPLEX_FULL;
-	link_settings->base.speed = state.rate;
+		cmd->duplex = DUPLEX_FULL;
+	ethtool_cmd_speed_set(cmd, state.rate);
 
 out:
 	return err;
 }
 
 static int
-dpaa2_eth_set_link_ksettings(struct net_device *net_dev,
-			     const struct ethtool_link_ksettings *link_settings)
+dpaa2_eth_set_settings(struct net_device *net_dev,
+		       struct ethtool_cmd *cmd)
 {
 	struct dpni_link_cfg cfg = {0};
 	struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
@@ -132,12 +132,12 @@ dpaa2_eth_set_link_ksettings(struct net_device *net_dev,
 		return -EACCES;
 	}
 
-	cfg.rate = link_settings->base.speed;
-	if (link_settings->base.autoneg == AUTONEG_ENABLE)
+	cfg.rate = ethtool_cmd_speed(cmd);
+	if (cmd->autoneg == AUTONEG_ENABLE)
 		cfg.options |= DPNI_LINK_OPT_AUTONEG;
 	else
 		cfg.options &= ~DPNI_LINK_OPT_AUTONEG;
-	if (link_settings->base.duplex  == DUPLEX_HALF)
+	if (cmd->duplex  == DUPLEX_HALF)
 		cfg.options |= DPNI_LINK_OPT_HALF_DUPLEX;
 	else
 		cfg.options &= ~DPNI_LINK_OPT_HALF_DUPLEX;
@@ -270,8 +270,8 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
 const struct ethtool_ops dpaa2_ethtool_ops = {
 	.get_drvinfo = dpaa2_eth_get_drvinfo,
 	.get_link = ethtool_op_get_link,
-	.get_link_ksettings = dpaa2_eth_get_link_ksettings,
-	.set_link_ksettings = dpaa2_eth_set_link_ksettings,
+	.get_settings = dpaa2_eth_get_settings,
+	.set_settings = dpaa2_eth_set_settings,
 	.get_sset_count = dpaa2_eth_get_sset_count,
 	.get_ethtool_stats = dpaa2_eth_get_ethtool_stats,
 	.get_strings = dpaa2_eth_get_strings,
-- 
1.8.5.6