diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-04-14 15:26:32 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-07-07 16:12:14 +0100 |
commit | ed3b4a0cab31858dade3eaf1ae8b713c584eec41 (patch) | |
tree | 58fa8bf7cfd56a4a625613ef8a03695bbc00ded4 /net | |
parent | 56048dd27cdc14ea34b52e12bca347d04ce1df1d (diff) |
sfp: move module eeprom ethtool access into netdev core ethtool
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/ethtool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 03111a2d6653..9e60b14153d3 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -22,6 +22,7 @@ #include <linux/bitops.h> #include <linux/uaccess.h> #include <linux/vmalloc.h> +#include <linux/sfp.h> #include <linux/slab.h> #include <linux/rtnetlink.h> #include <linux/sched/signal.h> @@ -2203,6 +2204,9 @@ static int __ethtool_get_module_info(struct net_device *dev, const struct ethtool_ops *ops = dev->ethtool_ops; struct phy_device *phydev = dev->phydev; + if (dev->sfp_bus) + return sfp_get_module_info(dev->sfp_bus, modinfo); + if (phydev && phydev->drv && phydev->drv->module_info) return phydev->drv->module_info(phydev, modinfo); @@ -2237,6 +2241,9 @@ static int __ethtool_get_module_eeprom(struct net_device *dev, const struct ethtool_ops *ops = dev->ethtool_ops; struct phy_device *phydev = dev->phydev; + if (dev->sfp_bus) + return sfp_get_module_eeprom(dev->sfp_bus, ee, data); + if (phydev && phydev->drv && phydev->drv->module_eeprom) return phydev->drv->module_eeprom(phydev, ee, data); |