diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2017-07-25 15:03:23 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-06 20:55:29 -0700 |
commit | 770a1ad55763a8a783cb71078e0b33a6b91ad92b (patch) | |
tree | 8325b8062fe7e8128c16c0a7f01a3699b0fa0a5d /drivers/net | |
parent | ce0aa27ff3f68ed4ea1631d33797e573b3508bfa (diff) | |
download | op-kernel-dev-770a1ad55763a8a783cb71078e0b33a6b91ad92b.zip op-kernel-dev-770a1ad55763a8a783cb71078e0b33a6b91ad92b.tar.gz |
phylink: add module EEPROM support
Add support for reading module EEPROMs through phylink.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/phylink.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 02082f4..026060c 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1020,6 +1020,34 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl, } EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam); +int phylink_ethtool_get_module_info(struct phylink *pl, + struct ethtool_modinfo *modinfo) +{ + int ret = -EOPNOTSUPP; + + WARN_ON(!lockdep_rtnl_is_held()); + + if (pl->sfp_bus) + ret = sfp_get_module_info(pl->sfp_bus, modinfo); + + return ret; +} +EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_info); + +int phylink_ethtool_get_module_eeprom(struct phylink *pl, + struct ethtool_eeprom *ee, u8 *buf) +{ + int ret = -EOPNOTSUPP; + + WARN_ON(!lockdep_rtnl_is_held()); + + if (pl->sfp_bus) + ret = sfp_get_module_eeprom(pl->sfp_bus, ee, buf); + + return ret; +} +EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_eeprom); + int phylink_init_eee(struct phylink *pl, bool clk_stop_enable) { int ret = -EPROTONOSUPPORT; |