diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-04-25 22:12:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 18:53:02 +0300 |
commit | c59530d0d5dccc96795af12c139f618182cf98db (patch) | |
tree | 9e841a2c973dd5fc1f68118fc722b232cab31198 /include/linux/phy.h | |
parent | 834944073301e85001c3ed9913027ca47c6f889b (diff) | |
download | linux-c59530d0d5dccc96795af12c139f618182cf98db.tar.xz |
net: Move PHY statistics code into PHY library helpers
In order to make it possible for network device drivers that do not
necessarily have a phy_device attached, but still report PHY statistics,
have a preliminary refactoring consisting in creating helper functions
that encapsulate the PHY device driver knowledge within PHYLIB.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 20 |
1 files changed, 20 insertions, 0 deletions
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; |