406-net-mvneta-add-module-EEPROM-reading-support.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 2ff039aa4462c2104c210b7cf39691c612de8214 Mon Sep 17 00:00:00 2001
  2. From: Russell King <rmk+kernel@arm.linux.org.uk>
  3. Date: Thu, 1 Oct 2015 23:32:39 +0100
  4. Subject: net: mvneta: add module EEPROM reading support
  5. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  6. ---
  7. drivers/net/ethernet/marvell/mvneta.c | 18 ++++++++++++++++++
  8. 1 file changed, 18 insertions(+)
  9. --- a/drivers/net/ethernet/marvell/mvneta.c
  10. +++ b/drivers/net/ethernet/marvell/mvneta.c
  11. @@ -4051,6 +4051,22 @@ static int mvneta_ethtool_set_wol(struct
  12. return ret;
  13. }
  14. +static int mvneta_ethtool_get_module_info(struct net_device *dev,
  15. + struct ethtool_modinfo *modinfo)
  16. +{
  17. + struct mvneta_port *pp = netdev_priv(dev);
  18. +
  19. + return phylink_ethtool_get_module_info(pp->phylink, modinfo);
  20. +}
  21. +
  22. +static int mvneta_ethtool_get_module_eeprom(struct net_device *dev,
  23. + struct ethtool_eeprom *ee, u8 *buf)
  24. +{
  25. + struct mvneta_port *pp = netdev_priv(dev);
  26. +
  27. + return phylink_ethtool_get_module_eeprom(pp->phylink, ee, buf);
  28. +}
  29. +
  30. static int mvneta_ethtool_get_eee(struct net_device *dev,
  31. struct ethtool_eee *eee)
  32. {
  33. @@ -4135,6 +4151,8 @@ static const struct ethtool_ops mvneta_e
  34. .set_link_ksettings = mvneta_ethtool_set_link_ksettings,
  35. .get_wol = mvneta_ethtool_get_wol,
  36. .set_wol = mvneta_ethtool_set_wol,
  37. + .get_module_info = mvneta_ethtool_get_module_info,
  38. + .get_module_eeprom = mvneta_ethtool_get_module_eeprom,
  39. .get_eee = mvneta_ethtool_get_eee,
  40. .set_eee = mvneta_ethtool_set_eee,
  41. };