]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: tja11xx: add cable-test support
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 13 May 2020 12:34:40 +0000 (14:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2020 19:35:47 +0000 (12:35 -0700)
commit8b5d94d8a1ff558b934fdf061c9dfb79204fbcb8
treeec9c24c91c775f08f3bc8f13877bcc17c701fe23
parent27cbebd089a661d368461163b9733125e0f89a1d
net: phy: tja11xx: add cable-test support

Add initial cable testing support.
This PHY needs only 100usec for this test and it is recommended to run it
before the link is up. For now, provide at least ethtool support, so it
can be tested by more developers.

This patch was tested with TJA1102 PHY with following results:
- No cable, is detected as open
- 1m cable, with no connected other end and detected as open
- a 40m cable (out of spec, max lenght should be 15m) is detected as OK.

Current patch do not provide polarity test support. This test would
indicate not proper wire connection, where "+" wire of main phy is
connected to the "-" wire of the link partner.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/nxp-tja11xx.c