summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-07-07 15:41:05 -0700
committerDavid S. Miller <davem@davemloft.net>2020-07-07 15:41:05 -0700
commit417e19d12be49e86f29c5d3410b65adc6a3e2a0a (patch)
treec71cc2bbc12802028a4319d89c9f3df471e9b4a0 /include/linux
parent1a4d681634fad302157afcb53a178c4c59cb75ee (diff)
parentf3631ab08eeb67ad023ba1b37004ecba0158f93f (diff)
downloadcachepc-linux-417e19d12be49e86f29c5d3410b65adc6a3e2a0a.tar.gz
cachepc-linux-417e19d12be49e86f29c5d3410b65adc6a3e2a0a.zip
Merge branch 'net-ethtool-Untangle-PHYLIB-dependency'
Florian Fainelli says: ==================== net: ethtool: Untangle PHYLIB dependency This patch series untangles the ethtool netlink dependency with PHYLIB which exists because the cable test feature calls directly into PHY library functions. The approach taken here is to introduce ethtool_phy_ops function pointers which can be dynamically registered when PHYLIB loads. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ethtool.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 48ad3b6a0150..0c139a93b67a 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -502,5 +502,30 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd,
u32 *dev_speed, u8 *dev_duplex);
+struct netlink_ext_ack;
+struct phy_device;
+struct phy_tdr_config;
+
+/**
+ * struct ethtool_phy_ops - Optional PHY device options
+ * @start_cable_test - Start a cable test
+ * @start_cable_test_tdr - Start a Time Domain Reflectometry cable test
+ *
+ * All operations are optional (i.e. the function pointer may be set to %NULL)
+ * and callers must take this into account. Callers must hold the RTNL lock.
+ */
+struct ethtool_phy_ops {
+ int (*start_cable_test)(struct phy_device *phydev,
+ struct netlink_ext_ack *extack);
+ int (*start_cable_test_tdr)(struct phy_device *phydev,
+ struct netlink_ext_ack *extack,
+ const struct phy_tdr_config *config);
+};
+
+/**
+ * ethtool_set_ethtool_phy_ops - Set the ethtool_phy_ops singleton
+ * @ops: Ethtool PHY operations to set
+ */
+void ethtool_set_ethtool_phy_ops(const struct ethtool_phy_ops *ops);
#endif /* _LINUX_ETHTOOL_H */