Blame SOURCES/0008-ethtool-copy.h-sync-with-net-next.patch

4cc9fb
From 1cfc4bab2c9109f8d9c58344e21da4fa0cae17ca Mon Sep 17 00:00:00 2001
4cc9fb
From: "Allan W. Nielsen" <allan.nielsen@microsemi.com>
4cc9fb
Date: Thu, 24 Nov 2016 09:56:50 +0100
4cc9fb
Subject: [PATCH 08/11] ethtool-copy.h:sync with net-next
4cc9fb
4cc9fb
This covers kernel changes upto:
4cc9fb
4cc9fb
commit 607c7029146790201e90b58c4235ddff0304d6e0
4cc9fb
Author: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
4cc9fb
Date:   Thu Nov 17 13:07:22 2016 +0100
4cc9fb
4cc9fb
    ethtool: (uapi) Add ETHTOOL_PHY_DOWNSHIFT to PHY tunables
4cc9fb
4cc9fb
    For operation in cabling environments that are incompatible with
4cc9fb
    1000BASE-T, PHY device may provide an automatic link speed downshift
4cc9fb
    operation. When enabled, the device automatically changes its 1000BASE-T
4cc9fb
    auto-negotiation to the next slower speed after a configured number of
4cc9fb
    failed attempts at 1000BASE-T.  This feature is useful in setting up in
4cc9fb
    networks using older cable installations that include only pairs A and B,
4cc9fb
    and not pairs C and D.
4cc9fb
4cc9fb
    Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
4cc9fb
    Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
4cc9fb
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
4cc9fb
    Signed-off-by: David S. Miller <davem@davemloft.net>
4cc9fb
4cc9fb
Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
4cc9fb
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4cc9fb
(cherry picked from commit af5af00a644e117c573d9afe591f8ce51348953f)
4cc9fb
---
4cc9fb
 ethtool-copy.h | 21 ++++++++++++++++++---
4cc9fb
 1 file changed, 18 insertions(+), 3 deletions(-)
4cc9fb
4cc9fb
diff --git a/ethtool-copy.h b/ethtool-copy.h
4cc9fb
index 70748f5..3d299e3 100644
4cc9fb
--- a/ethtool-copy.h
4cc9fb
+++ b/ethtool-copy.h
4cc9fb
@@ -117,8 +117,7 @@ struct ethtool_cmd {
4cc9fb
 static __inline__ void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
4cc9fb
 					 __u32 speed)
4cc9fb
 {
4cc9fb
-
4cc9fb
-	ep->speed = (__u16)speed;
4cc9fb
+	ep->speed = (__u16)(speed & 0xFFFF);
4cc9fb
 	ep->speed_hi = (__u16)(speed >> 16);
4cc9fb
 }
4cc9fb
 
4cc9fb
@@ -247,6 +246,19 @@ struct ethtool_tunable {
4cc9fb
 	void	*data[0];
4cc9fb
 };
4cc9fb
 
4cc9fb
+#define DOWNSHIFT_DEV_DEFAULT_COUNT	0xff
4cc9fb
+#define DOWNSHIFT_DEV_DISABLE		0
4cc9fb
+
4cc9fb
+enum phy_tunable_id {
4cc9fb
+	ETHTOOL_PHY_ID_UNSPEC,
4cc9fb
+	ETHTOOL_PHY_DOWNSHIFT,
4cc9fb
+	/*
4cc9fb
+	 * Add your fresh new phy tunable attribute above and remember to update
4cc9fb
+	 * phy_tunable_strings[] in net/core/ethtool.c
4cc9fb
+	 */
4cc9fb
+	__ETHTOOL_PHY_TUNABLE_COUNT,
4cc9fb
+};
4cc9fb
+
4cc9fb
 /**
4cc9fb
  * struct ethtool_regs - hardware register dump
4cc9fb
  * @cmd: Command number = %ETHTOOL_GREGS
4cc9fb
@@ -547,6 +559,7 @@ struct ethtool_pauseparam {
4cc9fb
  * @ETH_SS_FEATURES: Device feature names
4cc9fb
  * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
4cc9fb
  * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
4cc9fb
+ * @ETH_SS_PHY_TUNABLES: PHY tunable names
4cc9fb
  */
4cc9fb
 enum ethtool_stringset {
4cc9fb
 	ETH_SS_TEST		= 0,
4cc9fb
@@ -557,6 +570,7 @@ enum ethtool_stringset {
4cc9fb
 	ETH_SS_RSS_HASH_FUNCS,
4cc9fb
 	ETH_SS_TUNABLES,
4cc9fb
 	ETH_SS_PHY_STATS,
4cc9fb
+	ETH_SS_PHY_TUNABLES,
4cc9fb
 };
4cc9fb
 
4cc9fb
 /**
4cc9fb
@@ -1312,7 +1326,8 @@ struct ethtool_per_queue_op {
4cc9fb
 
4cc9fb
 #define ETHTOOL_GLINKSETTINGS	0x0000004c /* Get ethtool_link_settings */
4cc9fb
 #define ETHTOOL_SLINKSETTINGS	0x0000004d /* Set ethtool_link_settings */
4cc9fb
-
4cc9fb
+#define ETHTOOL_PHY_GTUNABLE	0x0000004e /* Get PHY tunable configuration */
4cc9fb
+#define ETHTOOL_PHY_STUNABLE	0x0000004f /* Set PHY tunable configuration */
4cc9fb
 
4cc9fb
 /* compatibility with older code */
4cc9fb
 #define SPARC_ETH_GSET		ETHTOOL_GSET
4cc9fb
-- 
4cc9fb
1.8.3.1
4cc9fb