net/mlx5: Parse module mapping using mlx5_ifc

The assumption that the first byte in the module mapping dword is the
module number shouldn't be hard-coded in the driver, but come from
mlx5_ifc structs.

While at it, fix the incorrect width for the 'rx_lane' and 'tx_lane'
fields.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
Gal Pressman 2022-01-17 15:53:06 +02:00 committed by Saeed Mahameed
parent 271907ee2f
commit fcb610a86c
3 changed files with 7 additions and 8 deletions

View file

@ -9888,10 +9888,10 @@ struct mlx5_ifc_pcmr_reg_bits {
};
struct mlx5_ifc_lane_2_module_mapping_bits {
u8 reserved_at_0[0x6];
u8 rx_lane[0x2];
u8 reserved_at_8[0x6];
u8 tx_lane[0x2];
u8 reserved_at_0[0x4];
u8 rx_lane[0x4];
u8 reserved_at_8[0x4];
u8 tx_lane[0x4];
u8 reserved_at_10[0x8];
u8 module[0x8];
};

View file

@ -56,7 +56,6 @@ enum mlx5_an_status {
MLX5_AN_LINK_DOWN = 4,
};
#define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff
#define MLX5_I2C_ADDR_LOW 0x50
#define MLX5_I2C_ADDR_HIGH 0x51
#define MLX5_EEPROM_PAGE_LENGTH 256