Re: [PATCH net-next v1 1/1] net: phy: dp83tg720: Add cable testing support
From: Oleksij Rempel
Date: Thu Aug 08 2024 - 04:16:24 EST
On Wed, Aug 07, 2024 at 03:24:52PM +0200, Andrew Lunn wrote:
> 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?
Not all of them.
OA specification provide recommendation for the bit layout for the TDR
status register (HDD.TDR):
https://opensig.org/wp-content/uploads/2024/03/Advanced_PHY_features_for_automotive_Ethernet_v2.0_fin.pdf
> Should we expect other devices to be identical?
Yes. I'll create a new file for OA specific helpers.
> > +/**
> > + * 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.
ack.
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |