aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-08-26 09:34:03 -0700
committerJakub Kicinski <kuba@kernel.org>2024-08-26 09:34:03 -0700
commitf85cd6aec1f1dfc29fd4a8440cdf0693c2411a3f (patch)
tree7931919e3d2fb68d4e19b0d7639c14956d39418c /net
parentnet: netconsole: selftests: Create a new netconsole selftest (diff)
parentphy: dp83td510: Utilize ALCD for cable length measurement when link is active (diff)
downloadwireguard-linux-f85cd6aec1f1dfc29fd4a8440cdf0693c2411a3f.tar.xz
wireguard-linux-f85cd6aec1f1dfc29fd4a8440cdf0693c2411a3f.zip
Merge branch 'add-alcd-support-to-cable-testing-interface'
Oleksij Rempel says: ==================== Add ALCD Support to Cable Testing Interface This patch series introduces support for Active Link Cable Diagnostics (ALCD) in the ethtool cable testing interface and the DP83TD510 PHY driver. Why ALCD? On a 10BaseT1L interface, TDR (Time Domain Reflectometry) is not possible if the link partner is active - TDR will fail in these cases because it requires interrupting the link. Since the link is active, we already know the cable is functioning, so instead of using TDR, we can use ALCD. ALCD lets us measure cable length without disrupting the active link, which is crucial in environments where network uptime is important. It provides a way to gather diagnostic data without the need for downtime. What's in this series: - Extended the ethtool cable testing interface to specify the source of diagnostic results (TDR or ALCD). - Updated the DP83TD510 PHY driver to use ALCD when the link is active, ensuring we can still get cable length info without dropping the connection. ==================== Link: https://patch.msgid.link/20240822120703.1393130-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/ethtool/cabletest.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index 01db8f394869..ff2fe3566ace 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -164,7 +164,8 @@ void ethnl_cable_test_finished(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(ethnl_cable_test_finished);
-int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result)
+int ethnl_cable_test_result_with_src(struct phy_device *phydev, u8 pair,
+ u8 result, u32 src)
{
struct nlattr *nest;
int ret = -EMSGSIZE;
@@ -177,6 +178,10 @@ int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result)
goto err;
if (nla_put_u8(phydev->skb, ETHTOOL_A_CABLE_RESULT_CODE, result))
goto err;
+ if (src != ETHTOOL_A_CABLE_INF_SRC_UNSPEC) {
+ if (nla_put_u32(phydev->skb, ETHTOOL_A_CABLE_RESULT_SRC, src))
+ goto err;
+ }
nla_nest_end(phydev->skb, nest);
return 0;
@@ -185,9 +190,10 @@ err:
nla_nest_cancel(phydev->skb, nest);
return ret;
}
-EXPORT_SYMBOL_GPL(ethnl_cable_test_result);
+EXPORT_SYMBOL_GPL(ethnl_cable_test_result_with_src);
-int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm)
+int ethnl_cable_test_fault_length_with_src(struct phy_device *phydev, u8 pair,
+ u32 cm, u32 src)
{
struct nlattr *nest;
int ret = -EMSGSIZE;
@@ -201,6 +207,11 @@ int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm)
goto err;
if (nla_put_u32(phydev->skb, ETHTOOL_A_CABLE_FAULT_LENGTH_CM, cm))
goto err;
+ if (src != ETHTOOL_A_CABLE_INF_SRC_UNSPEC) {
+ if (nla_put_u32(phydev->skb, ETHTOOL_A_CABLE_FAULT_LENGTH_SRC,
+ src))
+ goto err;
+ }
nla_nest_end(phydev->skb, nest);
return 0;
@@ -209,7 +220,7 @@ err:
nla_nest_cancel(phydev->skb, nest);
return ret;
}
-EXPORT_SYMBOL_GPL(ethnl_cable_test_fault_length);
+EXPORT_SYMBOL_GPL(ethnl_cable_test_fault_length_with_src);
static const struct nla_policy cable_test_tdr_act_cfg_policy[] = {
[ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST] = { .type = NLA_U32 },