lkml.org 
[lkml]   [2020]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] net: phy: adin: implement cable-test support
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Hi Alexandru

Overall, this looks good.

> +static int adin_cable_test_report_trans(int result)
> +{
> + int mask;
> +
> + if (result & ADIN1300_CDIAG_RSLT_GOOD)
> + return ETHTOOL_A_CABLE_RESULT_CODE_OK;
> + if (result & ADIN1300_CDIAG_RSLT_OPEN)
> + return ETHTOOL_A_CABLE_RESULT_CODE_OPEN;
> +
> + /* short with other pairs */
> + mask = ADIN1300_CDIAG_RSLT_XSHRT3 |
> + ADIN1300_CDIAG_RSLT_XSHRT2 |
> + ADIN1300_CDIAG_RSLT_XSHRT1;
> + if (result & mask)
> + return ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT;

The nice thing about the netlink API is that it is extendable without
breaking backwards compatibility. You could if you want add another
attribute, indicating what pair it is shorted to.

Andrew

\
 
 \ /
  Last update: 2020-10-21 16:09    [W:0.087 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site