summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2020-05-27 00:21:41 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-26 23:22:21 -0700
commitf2bc8ad31a7f814237bc6301d59296d76505a688 (patch)
tree738fb4f9aa7157772793f5c7c5febbedb6d828f4 /drivers/net/phy/phy.c
parent0c9bcc1d2394acef2c6e89e652d984cc845c7bea (diff)
net: ethtool: Allow PHY cable test TDR data to configured
Allow the user to configure where on the cable the TDR data should be retrieved, in terms of first and last sample, and the step between samples. Also add the ability to ask for TDR data for just one pair. If this configuration is not provided, it defaults to 1-150m at 1m intervals for all pairs. Signed-off-by: Andrew Lunn <andrew@lunn.ch> v3: Move the TDR configuration into a structure Add a range check on step Use NL_SET_ERR_MSG_ATTR() when appropriate Move TDR configuration into a nest Document attributes in the request Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 495d9ba3d5bf..1de3938628f4 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -553,7 +553,8 @@ out:
EXPORT_SYMBOL(phy_start_cable_test);
int phy_start_cable_test_tdr(struct phy_device *phydev,
- struct netlink_ext_ack *extack)
+ struct netlink_ext_ack *extack,
+ const struct phy_tdr_config *config)
{
struct net_device *dev = phydev->attached_dev;
int err = -ENOMEM;
@@ -590,7 +591,7 @@ int phy_start_cable_test_tdr(struct phy_device *phydev,
phy_link_down(phydev);
netif_testing_on(dev);
- err = phydev->drv->cable_test_tdr_start(phydev);
+ err = phydev->drv->cable_test_tdr_start(phydev, config);
if (err) {
netif_testing_off(dev);
phy_link_up(phydev);