net: ethtool: Add generic parts of cable test TDR

Add the generic parts of the code used to trigger a cable test and
return raw TDR data. Any PHY driver which support this must implement
the new driver op.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>

v2
Update nxp-tja11xx for API change.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn
2020-05-27 00:21:38 +02:00
committed by David S. Miller
parent a331172b15
commit 1a644de29f
7 changed files with 144 additions and 10 deletions

View File

@@ -17,13 +17,13 @@ enum ethtool_multicast_groups {
struct phy_device;
#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
int ethnl_cable_test_alloc(struct phy_device *phydev);
int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
void ethnl_cable_test_free(struct phy_device *phydev);
void ethnl_cable_test_finished(struct phy_device *phydev);
int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
#else
static inline int ethnl_cable_test_alloc(struct phy_device *phydev)
static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
{
return -EOPNOTSUPP;
}