[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211207093359.69974-4-idosch@idosch.org>
Date: Tue, 7 Dec 2021 11:33:59 +0200
From: Ido Schimmel <idosch@...sch.org>
To: netdev@...r.kernel.org
Cc: mkubecek@...e.cz, vadimp@...dia.com, mlxsw@...dia.com,
Ido Schimmel <idosch@...dia.com>
Subject: [PATCH ethtool-next 3/3] ethtool: Add transceiver module extended state
From: Ido Schimmel <idosch@...dia.com>
Add support for an extended state and an extended sub-state to describe
link issues related to transceiver modules.
In case "CMIS transceiver module is not in ModuleReady state" and the
module is in ModuleFault state, it is possible to read the fault reason
from the EEPROM dump.
Signed-off-by: Ido Schimmel <idosch@...dia.com>
---
netlink/settings.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/netlink/settings.c b/netlink/settings.c
index ff1e783d099c..3cf816f06299 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -593,6 +593,7 @@ static const char *const names_link_ext_state[] = {
[ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE] = "Calibration failure",
[ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED] = "Power budget exceeded",
[ETHTOOL_LINK_EXT_STATE_OVERHEAT] = "Overheat",
+ [ETHTOOL_LINK_EXT_STATE_MODULE] = "Module",
};
static const char *const names_autoneg_link_ext_substate[] = {
@@ -652,6 +653,11 @@ static const char *const names_cable_issue_link_ext_substate[] = {
"Cable test failure",
};
+static const char *const names_module_link_ext_substate[] = {
+ [ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY] =
+ "CMIS module is not in ModuleReady state",
+};
+
static const char *link_ext_substate_get(uint8_t link_ext_state_val, uint8_t link_ext_substate_val)
{
switch (link_ext_state_val) {
@@ -675,6 +681,10 @@ static const char *link_ext_substate_get(uint8_t link_ext_state_val, uint8_t lin
return get_enum_string(names_cable_issue_link_ext_substate,
ARRAY_SIZE(names_cable_issue_link_ext_substate),
link_ext_substate_val);
+ case ETHTOOL_LINK_EXT_STATE_MODULE:
+ return get_enum_string(names_module_link_ext_substate,
+ ARRAY_SIZE(names_module_link_ext_substate),
+ link_ext_substate_val);
default:
return NULL;
}
--
2.31.1
Powered by blists - more mailing lists