Commit 770a1ad5 authored by Russell King's avatar Russell King Committed by David S. Miller

phylink: add module EEPROM support

Add support for reading module EEPROMs through phylink.
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ce0aa27f
...@@ -1020,6 +1020,34 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl, ...@@ -1020,6 +1020,34 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl,
} }
EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam); 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 phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
{ {
int ret = -EPROTONOSUPPORT; int ret = -EPROTONOSUPPORT;
......
...@@ -125,6 +125,9 @@ void phylink_ethtool_get_pauseparam(struct phylink *, ...@@ -125,6 +125,9 @@ void phylink_ethtool_get_pauseparam(struct phylink *,
struct ethtool_pauseparam *); struct ethtool_pauseparam *);
int phylink_ethtool_set_pauseparam(struct phylink *, int phylink_ethtool_set_pauseparam(struct phylink *,
struct ethtool_pauseparam *); struct ethtool_pauseparam *);
int phylink_ethtool_get_module_info(struct phylink *, struct ethtool_modinfo *);
int phylink_ethtool_get_module_eeprom(struct phylink *,
struct ethtool_eeprom *, u8 *);
int phylink_init_eee(struct phylink *, bool); int phylink_init_eee(struct phylink *, bool);
int phylink_get_eee_err(struct phylink *); int phylink_get_eee_err(struct phylink *);
int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *); int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment