]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ethtool: Add fallback to get_module_eeprom from netlink command
authorVladyslav Tarasiuk <vladyslavt@nvidia.com>
Fri, 9 Apr 2021 08:06:39 +0000 (11:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Apr 2021 23:34:56 +0000 (16:34 -0700)
commit96d971e307cc0e434f96329b42bbd98cfbca07d2
tree3fbcce0246c0d5c08d6a8fce9422e8862e18463a
parent95dfc7effd88b49d66791678e042970824cae838
ethtool: Add fallback to get_module_eeprom from netlink command

In case netlink get_module_eeprom_by_page() callback is not implemented
by the driver, try to call old get_module_info() and get_module_eeprom()
pair. Recalculate parameters to get_module_eeprom() offset and len using
page number and their sizes. Return error if this can't be done.

Signed-off-by: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/eeprom.c