Skip to content

Commit abcd302

Browse files
oleremkuba-moo
authored andcommitted
ethtool: Extend cable testing interface with result source information
Extend the ethtool netlink cable testing interface by adding support for specifying the source of cable testing results. This allows users to differentiate between results obtained through different diagnostic methods. For example, some TI 10BaseT1L PHYs provide two variants of cable diagnostics: Time Domain Reflectometry (TDR) and Active Link Cable Diagnostic (ALCD). By introducing `ETHTOOL_A_CABLE_RESULT_SRC` and `ETHTOOL_A_CABLE_FAULT_LENGTH_SRC` attributes, this update enables drivers to indicate whether the result was derived from TDR or ALCD, improving the clarity and utility of diagnostic information. Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b494b16 commit abcd302

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Documentation/netlink/specs/ethtool.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ attribute-sets:
667667
-
668668
name: code
669669
type: u8
670+
-
671+
name: src
672+
type: u32
670673
-
671674
name: cable-fault-length
672675
attributes:
@@ -676,6 +679,9 @@ attribute-sets:
676679
-
677680
name: cm
678681
type: u32
682+
-
683+
name: src
684+
type: u32
679685
-
680686
name: cable-nest
681687
attributes:

Documentation/networking/ethtool-netlink.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,12 +1314,17 @@ information.
13141314
+-+-+-----------------------------------------+--------+---------------------+
13151315
| | | ``ETHTOOL_A_CABLE_RESULTS_CODE`` | u8 | result code |
13161316
+-+-+-----------------------------------------+--------+---------------------+
1317+
| | | ``ETHTOOL_A_CABLE_RESULT_SRC`` | u32 | information source |
1318+
+-+-+-----------------------------------------+--------+---------------------+
13171319
| | ``ETHTOOL_A_CABLE_NEST_FAULT_LENGTH`` | nested | cable length |
13181320
+-+-+-----------------------------------------+--------+---------------------+
13191321
| | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR`` | u8 | pair number |
13201322
+-+-+-----------------------------------------+--------+---------------------+
13211323
| | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_CM`` | u32 | length in cm |
13221324
+-+-+-----------------------------------------+--------+---------------------+
1325+
| | | ``ETHTOOL_A_CABLE_FAULT_LENGTH_SRC`` | u32 | information source |
1326+
+-+-+-----------------------------------------+--------+---------------------+
1327+
13231328

13241329
CABLE_TEST TDR
13251330
==============

include/uapi/linux/ethtool_netlink.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,20 @@ enum {
573573
ETHTOOL_A_CABLE_PAIR_D,
574574
};
575575

576+
/* Information source for specific results. */
577+
enum {
578+
ETHTOOL_A_CABLE_INF_SRC_UNSPEC,
579+
/* Results provided by the Time Domain Reflectometry (TDR) */
580+
ETHTOOL_A_CABLE_INF_SRC_TDR,
581+
/* Results provided by the Active Link Cable Diagnostic (ALCD) */
582+
ETHTOOL_A_CABLE_INF_SRC_ALCD,
583+
};
584+
576585
enum {
577586
ETHTOOL_A_CABLE_RESULT_UNSPEC,
578587
ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
579588
ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */
589+
ETHTOOL_A_CABLE_RESULT_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
580590

581591
__ETHTOOL_A_CABLE_RESULT_CNT,
582592
ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
@@ -586,6 +596,7 @@ enum {
586596
ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
587597
ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
588598
ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */
599+
ETHTOOL_A_CABLE_FAULT_LENGTH_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
589600

590601
__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
591602
ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)

0 commit comments

Comments
 (0)