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