3397d6
From 3ad39b7b490fc130b47ec248de707d3ae481c9ed Mon Sep 17 00:00:00 2001
3397d6
From: Scott Branden <scott.branden@broadcom.com>
3397d6
Date: Tue, 12 Dec 2017 12:20:02 -0800
3397d6
Subject: [PATCH 13/14] ethtool-copy.h: sync with net-next
3397d6
3397d6
This covers kernel changes up to:
3397d6
3397d6
commit 40e44a1e669d078946f46853808a60d29e6f0885
3397d6
Author: Scott Branden <scott.branden@broadcom.com>
3397d6
Date:   Thu Nov 30 11:35:59 2017 -0800
3397d6
3397d6
    net: ethtool: add support for reset of AP inside NIC interface.
3397d6
3397d6
    Add ETH_RESET_AP to reset the application processor(s) inside the NIC
3397d6
    interface.
3397d6
3397d6
    Current ETH_RESET_MGMT supports a management processor inside this NIC.
3397d6
    This is typically used for remote NIC management purposes.
3397d6
3397d6
    Application processors exist inside some SmartNICs to run various
3397d6
    applications inside the NIC processor - be it a simple algorithm without
3397d6
    an OS to as complex as hosting multiple VMs.
3397d6
3397d6
    Signed-off-by: Scott Branden <scott.branden@broadcom.com>
3397d6
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
3397d6
    Signed-off-by: David S. Miller <davem@davemloft.net>
3397d6
3397d6
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
3397d6
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3397d6
(cherry picked from commit 83634baa75b5831ed9bfd135f9747b94aacdd842)
3397d6
---
3397d6
 ethtool-copy.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
3397d6
 1 file changed, 61 insertions(+), 5 deletions(-)
3397d6
3397d6
diff --git a/ethtool-copy.h b/ethtool-copy.h
3397d6
index 06fc04c..f4e7bb2 100644
3397d6
--- a/ethtool-copy.h
3397d6
+++ b/ethtool-copy.h
3397d6
@@ -1,3 +1,4 @@
3397d6
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3397d6
 /*
3397d6
  * ethtool.h: Defines for Linux ethtool.
3397d6
  *
3397d6
@@ -1236,6 +1237,47 @@ struct ethtool_per_queue_op {
3397d6
 	char	data[];
3397d6
 };
3397d6
 
3397d6
+/**
3397d6
+ * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters
3397d6
+ * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM
3397d6
+ * @active_fec: FEC mode which is active on porte
3397d6
+ * @fec: Bitmask of supported/configured FEC modes
3397d6
+ * @rsvd: Reserved for future extensions. i.e FEC bypass feature.
3397d6
+ *
3397d6
+ * Drivers should reject a non-zero setting of @autoneg when
3397d6
+ * autoneogotiation is disabled (or not supported) for the link.
3397d6
+ *
3397d6
+ */
3397d6
+struct ethtool_fecparam {
3397d6
+	__u32   cmd;
3397d6
+	/* bitmask of FEC modes */
3397d6
+	__u32   active_fec;
3397d6
+	__u32   fec;
3397d6
+	__u32   reserved;
3397d6
+};
3397d6
+
3397d6
+/**
3397d6
+ * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration
3397d6
+ * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported
3397d6
+ * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver
3397d6
+ * @ETHTOOL_FEC_OFF: No FEC Mode
3397d6
+ * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode
3397d6
+ * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode
3397d6
+ */
3397d6
+enum ethtool_fec_config_bits {
3397d6
+	ETHTOOL_FEC_NONE_BIT,
3397d6
+	ETHTOOL_FEC_AUTO_BIT,
3397d6
+	ETHTOOL_FEC_OFF_BIT,
3397d6
+	ETHTOOL_FEC_RS_BIT,
3397d6
+	ETHTOOL_FEC_BASER_BIT,
3397d6
+};
3397d6
+
3397d6
+#define ETHTOOL_FEC_NONE		(1 << ETHTOOL_FEC_NONE_BIT)
3397d6
+#define ETHTOOL_FEC_AUTO		(1 << ETHTOOL_FEC_AUTO_BIT)
3397d6
+#define ETHTOOL_FEC_OFF			(1 << ETHTOOL_FEC_OFF_BIT)
3397d6
+#define ETHTOOL_FEC_RS			(1 << ETHTOOL_FEC_RS_BIT)
3397d6
+#define ETHTOOL_FEC_BASER		(1 << ETHTOOL_FEC_BASER_BIT)
3397d6
+
3397d6
 /* CMDs currently supported */
3397d6
 #define ETHTOOL_GSET		0x00000001 /* DEPRECATED, Get settings.
3397d6
 					    * Please use ETHTOOL_GLINKSETTINGS
3397d6
@@ -1328,6 +1370,8 @@ struct ethtool_per_queue_op {
3397d6
 #define ETHTOOL_SLINKSETTINGS	0x0000004d /* Set ethtool_link_settings */
3397d6
 #define ETHTOOL_PHY_GTUNABLE	0x0000004e /* Get PHY tunable configuration */
3397d6
 #define ETHTOOL_PHY_STUNABLE	0x0000004f /* Set PHY tunable configuration */
3397d6
+#define ETHTOOL_GFECPARAM	0x00000050 /* Get FEC settings */
3397d6
+#define ETHTOOL_SFECPARAM	0x00000051 /* Set FEC settings */
3397d6
 
3397d6
 /* compatibility with older code */
3397d6
 #define SPARC_ETH_GSET		ETHTOOL_GSET
3397d6
@@ -1382,9 +1426,12 @@ enum ethtool_link_mode_bit_indices {
3397d6
 	ETHTOOL_LINK_MODE_10000baseLR_Full_BIT	= 44,
3397d6
 	ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT	= 45,
3397d6
 	ETHTOOL_LINK_MODE_10000baseER_Full_BIT	= 46,
3397d6
-	ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47,
3397d6
-	ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48,
3397d6
+	ETHTOOL_LINK_MODE_2500baseT_Full_BIT	= 47,
3397d6
+	ETHTOOL_LINK_MODE_5000baseT_Full_BIT	= 48,
3397d6
 
3397d6
+	ETHTOOL_LINK_MODE_FEC_NONE_BIT	= 49,
3397d6
+	ETHTOOL_LINK_MODE_FEC_RS_BIT	= 50,
3397d6
+	ETHTOOL_LINK_MODE_FEC_BASER_BIT	= 51,
3397d6
 
3397d6
 	/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
3397d6
 	 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
3397d6
@@ -1393,7 +1440,7 @@ enum ethtool_link_mode_bit_indices {
3397d6
 	 */
3397d6
 
3397d6
 	__ETHTOOL_LINK_MODE_LAST
3397d6
-	  = ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
3397d6
+	  = ETHTOOL_LINK_MODE_FEC_BASER_BIT,
3397d6
 };
3397d6
 
3397d6
 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name)	\
3397d6
@@ -1484,13 +1531,17 @@ enum ethtool_link_mode_bit_indices {
3397d6
  * it was forced up into this mode or autonegotiated.
3397d6
  */
3397d6
 
3397d6
-/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */
3397d6
+/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal.
3397d6
+ * Update drivers/net/phy/phy.c:phy_speed_to_str() and
3397d6
+ * drivers/net/bonding/bond_3ad.c:__get_link_speed() when adding new values.
3397d6
+ */
3397d6
 #define SPEED_10		10
3397d6
 #define SPEED_100		100
3397d6
 #define SPEED_1000		1000
3397d6
 #define SPEED_2500		2500
3397d6
 #define SPEED_5000		5000
3397d6
 #define SPEED_10000		10000
3397d6
+#define SPEED_14000		14000
3397d6
 #define SPEED_20000		20000
3397d6
 #define SPEED_25000		25000
3397d6
 #define SPEED_40000		40000
3397d6
@@ -1633,6 +1684,7 @@ enum ethtool_reset_flags {
3397d6
 	ETH_RESET_PHY		= 1 << 6,	/* Transceiver/PHY */
3397d6
 	ETH_RESET_RAM		= 1 << 7,	/* RAM shared between
3397d6
 						 * multiple components */
3397d6
+	ETH_RESET_AP		= 1 << 8,	/* Application processor */
3397d6
 
3397d6
 	ETH_RESET_DEDICATED	= 0x0000ffff,	/* All components dedicated to
3397d6
 						 * this interface */
3397d6
@@ -1701,6 +1753,8 @@ enum ethtool_reset_flags {
3397d6
  *	%ethtool_link_mode_bit_indices for the link modes, and other
3397d6
  *	link features that the link partner advertised through
3397d6
  *	autonegotiation; 0 if unknown or not applicable.  Read-only.
3397d6
+ * @transceiver: Used to distinguish different possible PHY types,
3397d6
+ *	reported consistently by PHYLIB.  Read-only.
3397d6
  *
3397d6
  * If autonegotiation is disabled, the speed and @duplex represent the
3397d6
  * fixed link mode and are writable if the driver supports multiple
3397d6
@@ -1752,7 +1806,9 @@ struct ethtool_link_settings {
3397d6
 	__u8	eth_tp_mdix;
3397d6
 	__u8	eth_tp_mdix_ctrl;
3397d6
 	__s8	link_mode_masks_nwords;
3397d6
-	__u32	reserved[8];
3397d6
+	__u8	transceiver;
3397d6
+	__u8	reserved1[3];
3397d6
+	__u32	reserved[7];
3397d6
 	__u32	link_mode_masks[0];
3397d6
 	/* layout of link_mode_masks fields:
3397d6
 	 * __u32 map_supported[link_mode_masks_nwords];
3397d6
-- 
3397d6
1.8.3.1
3397d6