Messages in this thread |  | | Date | Wed, 7 Aug 2024 15:24:52 +0200 | | From | Andrew Lunn <> | | Subject | Re: [PATCH net-next v1 1/1] net: phy: dp83tg720: Add cable testing support |
| |
On Wed, Aug 07, 2024 at 11:32:51AM +0200, Oleksij Rempel wrote: > Introduce cable testing support for the DP83TG720 PHY. This implementation > is based on the "DP83TG720S-Q1: Configuring for Open Alliance Specification > Compliance (Rev. B)" application note.
Does the OA specification describe all these registers? Should we expect other devices to be identical?
> +/** > + * dp83tg720_get_fault_type - Convert TDR fault type to ethtool result code. > + * @fault_type: Fault type value from the PHY. > + * > + * Returns: Corresponding ethtool result code. > + */ > +static int dp83tg720_get_fault_type(int fault_type) > +{ > + switch (fault_type) { > + case DP83TG720S_TDR_FAULT_TYPE_SHORT: > + return ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT; > + case DP83TG720S_TDR_FAULT_TYPE_OPEN: > + return ETHTOOL_A_CABLE_RESULT_CODE_OPEN; > + case DP83TG720S_TDR_FAULT_TYPE_NOISE: > + return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;
You could add a new type for this. I think some implementations will also re-try a few times to see if a quiet period can be found.
Andrew
|  |