• Vladyslav Tarasiuk's avatar
    net/mlx4: Fix EEPROM dump support · db825fee
    Vladyslav Tarasiuk authored
    Fix SFP and QSFP* EEPROM queries by setting i2c_address, offset and page
    number correctly. For SFP set the following params:
    - I2C address for offsets 0-255 is 0x50. For 256-511 - 0x51.
    - Page number is zero.
    - Offset is 0-255.
    
    At the same time, QSFP* parameters are different:
    - I2C address is always 0x50.
    - Page number is not limited to zero.
    - Offset is 0-255 for page zero and 128-255 for others.
    
    To set parameters accordingly to cable used, implement function to query
    module ID and implement respective helper functions to set parameters
    correctly.
    
    Fixes: 135dd959 ("net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query")
    Signed-off-by: default avatarVladyslav Tarasiuk <vladyslavt@nvidia.com>
    Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    db825fee
en_ethtool.c 60.8 KB