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  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]
Date:   Sat, 25 Jul 2020 11:37:00 +0200
From:   Marek Behun <marek.behun@....cz>
To:     Pavel Machek <pavel@....cz>
Cc:     netdev@...r.kernel.org, linux-leds@...r.kernel.org,
        jacek.anaszewski@...il.com, Dan Murphy <dmurphy@...com>,
        Ondřej Jirman 
        <megous@...ous.com>, Russell King <linux@...linux.org.uk>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Andrew Lunn <andrew@...n.ch>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC leds + net-next v3 1/2] net: phy: add API for LEDs
 controlled by PHY HW

On Sat, 25 Jul 2020 11:21:24 +0200
Pavel Machek <pavel@....cz> wrote:

> Hi!
> 
> > Many PHYs support various HW control modes for LEDs connected directly
> > to them.
> > 
> > This code adds a new private LED trigger called phydev-hw-mode. When
> > this trigger is enabled for a LED, the various HW control modes which
> > the PHY supports for given LED can be get/set via hw_mode sysfs file.
> > 
> > A PHY driver wishing to utilize this API needs to register the LEDs on
> > its own and set the .trigger_type member of LED classdev to
> > &phy_hw_led_trig_type. It also needs to implement the methods
> > .led_iter_hw_mode, .led_set_hw_mode and .led_get_hw_mode in struct
> > phydev.
> > 
> > Signed-off-by: Marek Behún <marek.behun@....cz>  
> 
> Nothing too wrong.
> 
> New sysfs file will require documentation.
> 
> Plus I wonder: should we have single hw_mode file? It seems many
> different "bits" fit inside. Would it be possible to split it further,
> and have bits saying:
> 
> "I want the LED to be on if link is 10Mbps".
> "I want the LED to be on if link is 100Mbps".
> "I want the LED to be on if link is 1000Mbps".
> "I want the LED to blink on tx".
> "I want the LED to blink on rx".
> 
> ?

I don't think this is possible. Only specific combinations are possible
on Marvell PHYs. There is no HW control mode which would do, for
example:
  - ON when linked to 100Mbps
  - BLINK when receive

PHYs from other vendors can different mode sets.

Marek

> +       { "1Gbps/100Mbps/10Mbps",       { 0x2,  -1,  -1,  -1,  -1,
> +       { "1Gbps",                      { 0x7,  -1,  -1,  -1,  -1,
> +       { "100Mbps-fiber",              {  -1, 0x5,  -1,  -1,  -1,
> +       { "100Mbps-10Mbps",             {  -1, 0x5,  -1,  -1,  -1,
> +       { "1Gbps-100Mbps",              {  -1, 0x6,  -1,  -1,  -1,
> +       { "1Gbps-10Mbps",               {  -1,  -1, 0x6, 0x6,  -1,
> +       { "100Mbps",                    {  -1, 0x7,  -1,  -1,  -1,
> +       { "10Mbps",                     {  -1,  -1, 0x7,  -1,  -1,
> 
> Best regards,
> 									Pavel
> 

Powered by blists - more mailing lists