ethtool: Fix get module eeprom fallback
Function fallback_set_params() checks if the module type returned
by a driver is ETH_MODULE_SFF_8079 and in this case it assumes
that buffer returns a concatenated content of page A0h and A2h.
The check is wrong because the correct type is ETH_MODULE_SFF_8472.
Fixes: 96d971e307
("ethtool: Add fallback to get_module_eeprom from netlink command")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20220616160856.3623273-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
7a9214f3d8
commit
a3bb7b6381
@ -36,7 +36,7 @@ static int fallback_set_params(struct eeprom_req_info *request,
|
||||
if (request->page)
|
||||
offset = request->page * ETH_MODULE_EEPROM_PAGE_LEN + offset;
|
||||
|
||||
if (modinfo->type == ETH_MODULE_SFF_8079 &&
|
||||
if (modinfo->type == ETH_MODULE_SFF_8472 &&
|
||||
request->i2c_address == 0x51)
|
||||
offset += ETH_MODULE_EEPROM_PAGE_LEN * 2;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user