OSDN Git Service

mlxsw: core: Add support for module EEPROM read by page
authorIdo Schimmel <idosch@nvidia.com>
Mon, 21 Jun 2021 07:50:41 +0000 (10:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2021 19:33:05 +0000 (12:33 -0700)
commit1e27b9e408039af6210708f76c6fe735c2c2c9c1
tree7fca126adf0316b8f0768649d741d6c7980c707a
parentcecefb3a6eeb5d835abd051e67e27e1506289ccf
mlxsw: core: Add support for module EEPROM read by page

Add support for ethtool_ops::get_module_eeprom_by_page() which allows
user space to read transceiver module EEPROM based on passed parameters.

The I2C address is not validated in order to avoid module-specific code.
In case of wrong address, error will be returned from device's firmware.

Tested by comparing output with legacy method (ioctl) output.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_env.c
drivers/net/ethernet/mellanox/mlxsw/core_env.h
drivers/net/ethernet/mellanox/mlxsw/minimal.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c