From: Andrew Lunn <andrew@lunn.ch>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
alexaundru.ardelean@analog.com, hkallweit1@gmail.com,
linux@armlinux.org.uk, davem@davemloft.net,
ardeleanalex@gmail.com, kuba@kernel.org
Subject: Re: [PATCH 2/2] net: phy: adin: implement cable-test support
Date: Wed, 21 Oct 2020 16:08:52 +0200 [thread overview]
Message-ID: <20201021140852.GN139700@lunn.ch> (raw)
In-Reply-To: <20201021135140.51300-2-alexandru.ardelean@analog.com>
> 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
next prev parent reply other threads:[~2020-10-21 14:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 13:51 [PATCH 1/2] net: phy: adin: clear the diag clock and set LINKING_EN during autoneg Alexandru Ardelean
2020-10-21 13:51 ` [PATCH 2/2] net: phy: adin: implement cable-test support Alexandru Ardelean
2020-10-21 14:08 ` Andrew Lunn [this message]
2020-10-21 14:16 ` Alexandru Ardelean
2020-10-21 14:28 ` Andrew Lunn
2020-10-21 14:46 ` Alexandru Ardelean
2020-10-21 13:58 ` [PATCH 1/2] net: phy: adin: clear the diag clock and set LINKING_EN during autoneg Andrew Lunn
2020-10-21 14:05 ` Alexandru Ardelean
2020-10-21 14:13 ` Andrew Lunn
2020-10-21 14:23 ` Alexandru Ardelean
2020-10-21 16:34 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201021140852.GN139700@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexandru.ardelean@analog.com \
--cc=alexaundru.ardelean@analog.com \
--cc=ardeleanalex@gmail.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).