diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ethtool.h | 5 | ||||
| -rw-r--r-- | include/linux/phy.h | 20 | ||||
| -rw-r--r-- | include/net/dsa.h | 12 | 
3 files changed, 35 insertions, 2 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; diff --git a/include/net/dsa.h b/include/net/dsa.h index 60fb4ec8ba61..462e9741b210 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -356,10 +356,13 @@ struct dsa_switch_ops {  	/*  	 * ethtool hardware statistics.  	 */ -	void	(*get_strings)(struct dsa_switch *ds, int port, uint8_t *data); +	void	(*get_strings)(struct dsa_switch *ds, int port, +			       u32 stringset, uint8_t *data);  	void	(*get_ethtool_stats)(struct dsa_switch *ds,  				     int port, uint64_t *data); -	int	(*get_sset_count)(struct dsa_switch *ds, int port); +	int	(*get_sset_count)(struct dsa_switch *ds, int port, int sset); +	void	(*get_ethtool_phy_stats)(struct dsa_switch *ds, +					 int port, uint64_t *data);  	/*  	 * ethtool Wake-on-LAN @@ -588,4 +591,9 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,  #define BRCM_TAG_GET_PORT(v)		((v) >> 8)  #define BRCM_TAG_GET_QUEUE(v)		((v) & 0xff) + +int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data); +int dsa_port_get_ethtool_phy_stats(struct dsa_port *dp, uint64_t *data); +int dsa_port_get_phy_sset_count(struct dsa_port *dp); +  #endif |