lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200514120959.b24cszsmkjvfzss6@pengutronix.de>
Date:   Thu, 14 May 2020 14:09:59 +0200
From:   Oleksij Rempel <o.rempel@...gutronix.de>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Mark Rutland <mark.rutland@....com>, Marek Vasut <marex@...x.de>,
        Florian Fainelli <f.fainelli@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        David Jander <david@...tonic.nl>,
        "David S. Miller" <davem@...emloft.net>,
        Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH net-next v1] net: phy: tja11xx: add cable-test support

On Wed, May 13, 2020 at 08:01:40PM +0200, Andrew Lunn wrote:
> > What would be the best place to do a test before the link is getting up?
> > Can it be done in the phy core, or it should be done in the PHY driver?
> > 
> > So far, no action except of logging these errors is needed. 
> 
> You could do it in the config_aneg callback.

In this case I get two test cycles if the test was requested from user
space: from .cable_test_get_status and from .config_aneg

> A kernel log entry is not very easy to use. You might want to see how
> easy it is to send a cable test result to userspace. Anything which is
> interested in this information can then listen for it. All the needed
> code is there, you will just need to rearrange it a bit.

Indeed. I discovered" ethtool --monitor" for me. And the code is some
thing like this:
	ethnl_cable_test_alloc(phydev);
	phydev->drv->cable_test_start(phydev);
	usleep_range(100, 200);
	phydev->drv->cable_test_get_status(phydev, &finished);
	if (finished)
		ethnl_cable_test_finished(phydev);


Beside, what do you think about new result codes:
  ETHTOOL_A_CABLE_RESULT_CODE_POLARITY - if cable polarity is wrong (-
  connected to +)
  ETHTOOL_A_CABLE_RESULT_CODE_ACTIVE_PARTNER - the link partner is active.
     The TJA1102 is able to detect it if partner link is master.

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 |

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ