History

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.

Andrew Lunn committed 6 years ago

Commit 1a644de1 parent a3311727 files · +144 −10Browse files

Showing the changes to include/linux (2 of 7 files). Show all

Unified · Split

2 files
  1. include/linux/ethtool_netlink.h +2 −2
  2. include/linux/phy.h +13 −0
include/linux/ethtool_netlink.h+2−2
@@ -17,13 +17,13 @@ enum ethtool_multicast_groups { · 16 unmodified lines
1717 struct phy_device;
1818
1919 #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
20−int ethnl_cable_test_alloc(struct phy_device *phydev);
20+int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
2121 void ethnl_cable_test_free(struct phy_device *phydev);
2222 void ethnl_cable_test_finished(struct phy_device *phydev);
2323 int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
2424 int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
2525 #else
26−static inline int ethnl_cable_test_alloc(struct phy_device *phydev)
26+static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
2727 {
2828 return -EOPNOTSUPP;
2929 }
include/linux/phy.h+13−0
@@ -699,6 +699,10 @@ struct phy_driver { · 698 unmodified lines
699699
700700 /* Start a cable test */
701701 int (*cable_test_start)(struct phy_device *dev);
702+
703+ /* Start a raw TDR cable test */
704+ int (*cable_test_tdr_start)(struct phy_device *dev);
705+
702706 /* Once per second, or on interrupt, request the status of the
703707 * test.
704708 */
@@ -1251,6 +1255,8 @@ int phy_reset_after_clk_enable(struct phy_device *phydev); · 546 unmodified lines
12511255 #if IS_ENABLED(CONFIG_PHYLIB)
12521256 int phy_start_cable_test(struct phy_device *phydev,
12531257 struct netlink_ext_ack *extack);
1258+int phy_start_cable_test_tdr(struct phy_device *phydev,
1259+ struct netlink_ext_ack *extack);
12541260 #else
12551261 static inline
12561262 int phy_start_cable_test(struct phy_device *phydev,
@@ -1259,6 +1265,13 @@ int phy_start_cable_test(struct phy_device *phydev, · 2 unmodified lines
12591265 NL_SET_ERR_MSG(extack, "Kernel not compiled with PHYLIB support");
12601266 return -EOPNOTSUPP;
12611267 }
1268+static inline
1269+int phy_start_cable_test_tdr(struct phy_device *phydev,
1270+ struct netlink_ext_ack *extack)
1271+{
1272+ NL_SET_ERR_MSG(extack, "Kernel not compiled with PHYLIB support");
1273+ return -EOPNOTSUPP;
1274+}
12621275 #endif
12631276
12641277 int phy_cable_test_result(struct phy_device *phydev, u8 pair, u16 result);