diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ethtool.h | 5 | ||||
| -rw-r--r-- | include/linux/phy.h | 20 | 
2 files changed, 25 insertions, 0 deletions
| diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b32cd2062f18..f8a2245b70ac 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -312,6 +312,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,   *	by kernel. Returns a negative error code or zero.   * @get_fecparam: Get the network device Forward Error Correction parameters.   * @set_fecparam: Set the network device Forward Error Correction parameters. + * @get_ethtool_phy_stats: Return extended statistics about the PHY device. + *	This is only useful if the device maintains PHY statistics and + *	cannot use the standard PHY library helpers.   *   * All operations are optional (i.e. the function pointer may be set   * to %NULL) and callers must take this into account.  Callers must @@ -407,5 +410,7 @@ struct ethtool_ops {  				      struct ethtool_fecparam *);  	int	(*set_fecparam)(struct net_device *,  				      struct ethtool_fecparam *); +	void	(*get_ethtool_phy_stats)(struct net_device *, +					 struct ethtool_stats *, u64 *);  };  #endif /* _LINUX_ETHTOOL_H */ diff --git a/include/linux/phy.h b/include/linux/phy.h index f0b5870a6d40..6ca81395c545 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1066,6 +1066,26 @@ int phy_ethtool_nway_reset(struct net_device *ndev);  #if IS_ENABLED(CONFIG_PHYLIB)  int __init mdio_bus_init(void);  void mdio_bus_exit(void); +int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data); +int phy_ethtool_get_sset_count(struct phy_device *phydev); +int phy_ethtool_get_stats(struct phy_device *phydev, +			  struct ethtool_stats *stats, u64 *data); +#else +int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data) +{ +	return -EOPNOTSUPP; +} + +int phy_ethtool_get_sset_count(struct phy_device *phydev) +{ +	return -EOPNOTSUPP; +} + +int phy_ethtool_get_stats(struct phy_device *phydev, +			  struct ethtool_stats *stats, u64 *data) +{ +	return -EOPNOTSUPP; +}  #endif  extern struct bus_type mdio_bus_type; | 
