Subject: Re: [PATCH RFC] net: sfp: support assigning status LEDs to SFP connectors

From: "Russell King (Oracle)" <[email-masked]>
Date: Wed, 11 May 2022 11:21:33 +0100

On Tue, May 10, 2022 at 12:44:41PM +0300, Josua Mayer wrote:
> Hi Russell,
> 
> Am 09.05.22 um 18:54 schrieb Russell King (Oracle):
> > On Mon, May 09, 2022 at 03:29:38PM +0300, Josua Mayer wrote:
> > I do this on the SolidSense platform with the two LEDs when using it as
> > my internet gateway on the boat - one LED gives wlan status, the other
> > LED gives wwan status, both of them green for link and red for tx/rx
> > activity.
> Ah. And do you put the assignment of the LEDs into an init script?

Yes, I do it from a systemd unit that runs a "platform-leds-init"
script as the easiest way on the SolidSense - since I want one for
wwan0 and the other for wlan0, there is no chance of the names
being swapped.

However, I'm quite sure it's possible to have udev and systemd scripts
that do what is necessary, or poke in sysfs.

I can't remotely power up my Clearfog-CX to see exactly how to do it,
but I am quite sure one can have a script in udev that notices a new
netdev coming along, works out which it is (by looking at
/sys/class/net/$name/device, or more probably some udev variable
that gives you that) and decides which LED should be configured.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!