Blame SOURCES/0015-update-link-mode-tables.patch

c96cf6
From aefd1fcb99c1d64198f315a20e087888d7715632 Mon Sep 17 00:00:00 2001
c96cf6
From: Michal Kubecek <mkubecek@suse.cz>
c96cf6
Date: Wed, 16 Sep 2020 23:12:18 +0200
c96cf6
Subject: [PATCH 15/17] update link mode tables
c96cf6
c96cf6
Update tables of link modes to cover all modes currently defined in uapi
c96cf6
header:
c96cf6
c96cf6
  - link_modes[] array in netlink/settings.c
c96cf6
  - all_advertised_modes_bits[] array in ethtool.c
c96cf6
  - table of modes and corresponding bit values in manual page
c96cf6
c96cf6
In the manual page table, fix also whitespace and order inconsistencies.
c96cf6
c96cf6
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
c96cf6
(cherry picked from commit 63130d0b00040136629988a1170da93ae742ca51)
c96cf6
---
c96cf6
 ethtool.8.in       | 32 ++++++++++++++++++++++++++------
c96cf6
 ethtool.c          | 24 ++++++++++++++++++++++--
c96cf6
 netlink/settings.c | 15 +++++++++++++++
c96cf6
 3 files changed, 63 insertions(+), 8 deletions(-)
c96cf6
c96cf6
diff --git a/ethtool.8.in b/ethtool.8.in
c96cf6
index a50a4769895c..12866dc456cf 100644
c96cf6
--- a/ethtool.8.in
c96cf6
+++ b/ethtool.8.in
c96cf6
@@ -721,21 +721,21 @@ lB	l	lB.
c96cf6
 0x80000000000000000	100baseT1 Full
c96cf6
 0x010	1000baseT Half	(not supported by IEEE standards)
c96cf6
 0x020	1000baseT Full
c96cf6
-0x100000000000000000	1000baseT1 Full
c96cf6
 0x20000	1000baseKX Full
c96cf6
 0x20000000000	1000baseX Full
c96cf6
-0x800000000000	2500baseT Full
c96cf6
+0x100000000000000000	1000baseT1 Full
c96cf6
 0x8000	2500baseX Full	(not supported by IEEE standards)
c96cf6
+0x800000000000	2500baseT Full
c96cf6
 0x1000000000000	5000baseT Full
c96cf6
 0x1000	10000baseT Full
c96cf6
 0x40000	10000baseKX4 Full
c96cf6
 0x80000	10000baseKR Full
c96cf6
 0x100000	10000baseR_FEC
c96cf6
-0x40000000000	10000baseCR  Full
c96cf6
-0x80000000000	10000baseSR  Full
c96cf6
-0x100000000000	10000baseLR  Full
c96cf6
+0x40000000000	10000baseCR Full
c96cf6
+0x80000000000	10000baseSR Full
c96cf6
+0x100000000000	10000baseLR Full
c96cf6
 0x200000000000	10000baseLRM Full
c96cf6
-0x400000000000	10000baseER  Full
c96cf6
+0x400000000000	10000baseER Full
c96cf6
 0x200000	20000baseMLD2 Full	(not supported by IEEE standards)
c96cf6
 0x400000	20000baseKR2 Full	(not supported by IEEE standards)
c96cf6
 0x80000000	25000baseCR Full
c96cf6
@@ -766,11 +766,31 @@ lB	l	lB.
c96cf6
 0x800000000000000	100000baseCR2 Full
c96cf6
 0x1000000000000000	100000baseLR2_ER2_FR2 Full
c96cf6
 0x2000000000000000	100000baseDR2 Full
c96cf6
+0x8000000000000000000	100000baseKR Full
c96cf6
+0x10000000000000000000	100000baseSR Full
c96cf6
+0x20000000000000000000	100000baseLR_ER_FR Full
c96cf6
+0x40000000000000000000	100000baseCR Full
c96cf6
+0x80000000000000000000	100000baseDR Full
c96cf6
 0x4000000000000000	200000baseKR4 Full
c96cf6
 0x8000000000000000	200000baseSR4 Full
c96cf6
 0x10000000000000000	200000baseLR4_ER4_FR4 Full
c96cf6
 0x20000000000000000	200000baseDR4 Full
c96cf6
 0x40000000000000000	200000baseCR4 Full
c96cf6
+0x100000000000000000000	200000baseKR2 Full
c96cf6
+0x200000000000000000000	200000baseSR2 Full
c96cf6
+0x400000000000000000000	200000baseLR2_ER2_FR2 Full
c96cf6
+0x800000000000000000000	200000baseDR2 Full
c96cf6
+0x1000000000000000000000	200000baseCR2 Full
c96cf6
+0x200000000000000000	400000baseKR8 Full
c96cf6
+0x400000000000000000	400000baseSR8 Full
c96cf6
+0x800000000000000000	400000baseLR8_ER8_FR8 Full
c96cf6
+0x1000000000000000000	400000baseDR8 Full
c96cf6
+0x2000000000000000000	400000baseCR8 Full
c96cf6
+0x2000000000000000000000	400000baseKR4 Full
c96cf6
+0x4000000000000000000000	400000baseSR4 Full
c96cf6
+0x8000000000000000000000	400000baseLR4_ER4_FR4 Full
c96cf6
+0x10000000000000000000000	400000baseDR4 Full
c96cf6
+0x20000000000000000000000	400000baseCR4 Full
c96cf6
 .TE
c96cf6
 .TP
c96cf6
 .BI phyad \ N
c96cf6
diff --git a/ethtool.c b/ethtool.c
c96cf6
index 606af3e6b48f..2e24e98187d2 100644
c96cf6
--- a/ethtool.c
c96cf6
+++ b/ethtool.c
c96cf6
@@ -392,9 +392,9 @@ static void init_global_link_mode_masks(void)
c96cf6
 		ETHTOOL_LINK_MODE_100baseT_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
c96cf6
-		ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
c96cf6
-		ETHTOOL_LINK_MODE_2500baseX_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_2500baseX_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_10000baseKR_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_10000baseR_FEC_BIT,
c96cf6
@@ -443,6 +443,26 @@ static void init_global_link_mode_masks(void)
c96cf6
 		ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
c96cf6
 		ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_100000baseKR_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_100000baseSR_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_100000baseCR_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_100000baseDR_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT,
c96cf6
+		ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT,
c96cf6
 	};
c96cf6
 	static const enum ethtool_link_mode_bit_indices
c96cf6
 		additional_advertised_flags_bits[] = {
c96cf6
diff --git a/netlink/settings.c b/netlink/settings.c
c96cf6
index d1da995b434c..3a9518a7e12b 100644
c96cf6
--- a/netlink/settings.c
c96cf6
+++ b/netlink/settings.c
c96cf6
@@ -147,6 +147,21 @@ static const struct link_mode_info link_modes[] = {
c96cf6
 	[ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT]	= __REAL(400000),
c96cf6
 	[ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT]	= __REAL(400000),
c96cf6
 	[ETHTOOL_LINK_MODE_FEC_LLRS_BIT]		= __SPECIAL(FEC),
c96cf6
+	[ETHTOOL_LINK_MODE_100000baseKR_Full_BIT]	= __REAL(100000),
c96cf6
+	[ETHTOOL_LINK_MODE_100000baseSR_Full_BIT]	= __REAL(100000),
c96cf6
+	[ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT]	= __REAL(100000),
c96cf6
+	[ETHTOOL_LINK_MODE_100000baseCR_Full_BIT]	= __REAL(100000),
c96cf6
+	[ETHTOOL_LINK_MODE_100000baseDR_Full_BIT]	= __REAL(100000),
c96cf6
+	[ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT]	= __REAL(200000),
c96cf6
+	[ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT]	= __REAL(200000),
c96cf6
+	[ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT] = __REAL(200000),
c96cf6
+	[ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT]	= __REAL(200000),
c96cf6
+	[ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT]	= __REAL(200000),
c96cf6
+	[ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT]	= __REAL(400000),
c96cf6
+	[ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT]	= __REAL(400000),
c96cf6
+	[ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT] = __REAL(400000),
c96cf6
+	[ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT]	= __REAL(400000),
c96cf6
+	[ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT]	= __REAL(400000),
c96cf6
 };
c96cf6
 const unsigned int link_modes_count = ARRAY_SIZE(link_modes);
c96cf6
 
c96cf6
-- 
c96cf6
2.26.2
c96cf6