mlxsw: core: Add an infrastructure to track transceiver overheat counter
authorAmit Cohen <amcohen@nvidia.com>
Sun, 27 Sep 2020 07:50:10 +0000 (10:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2020 20:27:00 +0000 (13:27 -0700)
commit0652ac07756588d6f1aa8419f569b5894a149d6e
treed30b0b3ab5bf00f1009a8f430e32c4ca44845108
parentfb1292f821cce8df765be15b2a1b8ebe9a6e304e
mlxsw: core: Add an infrastructure to track transceiver overheat counter

Initialize an array that stores per-module overheat state and a counter
indicating how many times the module was in overheat state.

Export a function to query the counter according to module number.
Will be used later on by the switch driver (i.e., mlxsw_spectrum) to expose
module's overheat counter as part of ethtool statistics.

Initialize mlxsw_env after driver initialization to be able to query
number of modules from MGPIR register.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/core_env.c
drivers/net/ethernet/mellanox/mlxsw/core_env.h