[PATCH net-next v13 02/18] net: ethtool: common: Indicate that BaseT works on up to 4 lanes

Maxime Chevallier
2025-09-21T16:05:33Z

The way BaseT modes (Ethernet over twisted copper pairs) are represented
in the kernel are through the following modes :

ETHTOOL_LINK_MODE_10baseT_Half
ETHTOOL_LINK_MODE_10baseT_Full
ETHTOOL_LINK_MODE_100baseT_Half
ETHTOOL_LINK_MODE_100baseT_Full
ETHTOOL_LINK_MODE_1000baseT_Half
ETHTOOL_LINK_MODE_1000baseT_Full
ETHTOOL_LINK_MODE_2500baseT_Full
ETHTOOL_LINK_MODE_5000baseT_Full
ETHTOOL_LINK_MODE_10000baseT_Full
ETHTOOL_LINK_MODE_100baseT1_Full
ETHTOOL_LINK_MODE_1000baseT1_Full
ETHTOOL_LINK_MODE_10baseT1L_Full
ETHTOOL_LINK_MODE_10baseT1S_Full
ETHTOOL_LINK_MODE_10baseT1S_Half
ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half
ETHTOOL_LINK_MODE_10baseT1BRR_Full

The baseT1* modes explicitly specify that they work on a single,
unshielded twister copper pair.

However, the other modes do not state the number of pairs that are used
to carry the link. 10 and 100BaseT use 2 twisted copper pairs, while
1GBaseT and higher use 4 pairs.

although 10 and 100BaseT use 2 pairs, they can work on a Cat3/4/5+
cables that contain 4 pairs.

Change the number of pairs associated to BaseT modes to indicate the
allowable number of pairs for BaseT. Further commits will then refine
the minimum number of pairs required for the linkmode to work.

BaseT1 modes aren't affected by this commit.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
net/ethtool/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 55223ebc2a7e..82d3df02164f 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -267,7 +267,7 @@ static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
#define __LINK_MODE_LANES_LR8_ER8_FR8 8
#define __LINK_MODE_LANES_LRM 1
#define __LINK_MODE_LANES_MLD2 2
-#define __LINK_MODE_LANES_T 1
+#define __LINK_MODE_LANES_T 4
#define __LINK_MODE_LANES_T1 1
#define __LINK_MODE_LANES_X 1
#define __LINK_MODE_LANES_FX 1
--
2.49.0