]> 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)
commit1acae22adb85102bb8c5b67e216e3bcd39a623b8
treeec9c24c91c775f08f3bc8f13877bcc17c701fe23
parented80f5d8d70118dc8949fdfda6c9ba5acf03c4f1
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