mlxsw: Add support for transceiver module extended state
authorIdo Schimmel <idosch@nvidia.com>
Wed, 6 Oct 2021 10:46:47 +0000 (13:46 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Oct 2021 00:47:50 +0000 (17:47 -0700)
Add support for the transceiver module extended state and sub-state
added in previous patch. The extended state is meant to describe link
issues related to transceiver modules.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c

index 7329bc8..84d4460 100644 (file)
@@ -96,6 +96,9 @@ mlxsw_sp_link_ext_state_opcode_map[] = {
        {1032, ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED, 0},
 
        {1030, ETHTOOL_LINK_EXT_STATE_OVERHEAT, 0},
+
+       {1042, ETHTOOL_LINK_EXT_STATE_MODULE,
+        ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY},
 };
 
 static void
@@ -124,6 +127,10 @@ mlxsw_sp_port_set_link_ext_state(struct mlxsw_sp_ethtool_link_ext_state_opcode_m
                link_ext_state_info->cable_issue =
                        link_ext_state_mapping.link_ext_substate;
                break;
+       case ETHTOOL_LINK_EXT_STATE_MODULE:
+               link_ext_state_info->module =
+                       link_ext_state_mapping.link_ext_substate;
+               break;
        default:
                break;
        }