netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Josua Mayer <josua@solid-run.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH RFC] net: sfp: support assigning status LEDs to SFP connectors
Date: Wed, 11 May 2022 11:21:33 +0100	[thread overview]
Message-ID: <YnuOLelD/mh5GT/T@shell.armlinux.org.uk> (raw)
In-Reply-To: <bc461bd4-e123-212d-42a5-2da2efb7235a@solid-run.com>

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!

  reply	other threads:[~2022-05-11 10:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 12:29 [PATCH RFC] net: sfp: support assigning status LEDs to SFP connectors Josua Mayer
2022-05-09 12:49 ` Andrew Lunn
2022-05-10  8:56   ` Josua Mayer
2022-05-10 12:13     ` Andrew Lunn
2022-05-11 10:26       ` Russell King (Oracle)
2022-05-11 14:48         ` Ioana Ciornei
2022-05-11 10:12     ` Russell King (Oracle)
2022-05-11 15:48     ` Ioana Ciornei
2022-05-18  7:42       ` Josua Mayer
2022-05-09 15:54 ` Russell King (Oracle)
2022-05-10  9:44   ` Josua Mayer
2022-05-11 10:21     ` Russell King (Oracle) [this message]
2022-05-11 13:22     ` Ioana Ciornei
2022-05-11 13:39       ` Russell King (Oracle)
2022-06-01 10:18         ` Josua Mayer
2022-06-01 10:52           ` Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnuOLelD/mh5GT/T@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=josua@solid-run.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).