[25.12] leds: add "network" LED trigger (lan/wan/wlan)#23685
Merged
Conversation
namiltd
marked this pull request as ready for review
June 6, 2026 11:51
openwrt-ai
reviewed
Jun 6, 2026
openwrt-ai
reviewed
Jun 24, 2026
openwrt-ai
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed 1 new commit; no new issues found.
Backport verification: the (cherry picked from commit 2aa1185fb05eb7f2e4c7e4f9c66e3727010328af) trailer is present and correct. The four substantive files (package/kernel/linux/modules/leds.mk, the bcm27xx 950-0189 patch refresh, ledtrig-network.c, and hack-6.12/820-ledtrig-network-module.patch) are byte-identical to the upstream commit. The upstream commit also touched config-6.18 and hack-6.18/820-ledtrig-network-module.patch; dropping those is correct since the openwrt-25.12 base branch carries only kernel 6.12 under target/linux/generic/. The commit message matches the diff.
Generated by Claude Code
LED trigger for network interfaces.
- Aggregated per-family (lan/wan/wlan).
- Family and flags are taken from device tree properties:
- "family" : simple family string "lan" | "wan" | "wlan"
- "mode" : any combination of "link", "tx", "rx" flags
Priority/combination:
* If "mode" present: flags come from "mode" and take precedence.
Family is taken from "family" if present, otherwise from the LED name.
* If only "family" present: use its family and default flags = link+tx+rx.
* If neither present: fall back to LED device name parsing.
- Suffix "-online" is valid ONLY in the LED name (label),
e.g. "green:wlan-online". It indicates the online variant but is applied
only when DT "mode" is absent.
Behaviour:
- wlan (normal): blink/solid driven by throughput table
- lan/wan (normal): one-shot blink on TX/RX packet change
- *-online variants: steady ON while any interface of the family has carrier
Interfaces are auto-tracked by name match (lan0, wan1, wlan2, phy0, wl1,
ath0, ra0...). Up to MAX_IFACES (16) interfaces per family
This trigger is intended for board/device authors and drivers to provide simple
network-activity LED behaviour without per-interface wiring in userspace.
Refresh bcm27xx patches in the same commit to account for line shifts in
drivers/leds/trigger/Kconfig and Makefile, ensuring clean applies for
bisectability.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: openwrt#19903
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2aa1185)
Link: openwrt#23685
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
oxavelar
pushed a commit
to oxavelar/openwrt
that referenced
this pull request
Jul 2, 2026
LED trigger for network interfaces.
- Aggregated per-family (lan/wan/wlan).
- Family and flags are taken from device tree properties:
- "family" : simple family string "lan" | "wan" | "wlan"
- "mode" : any combination of "link", "tx", "rx" flags
Priority/combination:
* If "mode" present: flags come from "mode" and take precedence.
Family is taken from "family" if present, otherwise from the LED name.
* If only "family" present: use its family and default flags = link+tx+rx.
* If neither present: fall back to LED device name parsing.
- Suffix "-online" is valid ONLY in the LED name (label),
e.g. "green:wlan-online". It indicates the online variant but is applied
only when DT "mode" is absent.
Behaviour:
- wlan (normal): blink/solid driven by throughput table
- lan/wan (normal): one-shot blink on TX/RX packet change
- *-online variants: steady ON while any interface of the family has carrier
Interfaces are auto-tracked by name match (lan0, wan1, wlan2, phy0, wl1,
ath0, ra0...). Up to MAX_IFACES (16) interfaces per family
This trigger is intended for board/device authors and drivers to provide simple
network-activity LED behaviour without per-interface wiring in userspace.
Refresh bcm27xx patches in the same commit to account for line shifts in
drivers/leds/trigger/Kconfig and Makefile, ensuring clean applies for
bisectability.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: openwrt#19903
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2aa1185)
Link: openwrt#23685
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
liudf0716
pushed a commit
to liudf0716/chawrt
that referenced
this pull request
Jul 21, 2026
LED trigger for network interfaces.
- Aggregated per-family (lan/wan/wlan).
- Family and flags are taken from device tree properties:
- "family" : simple family string "lan" | "wan" | "wlan"
- "mode" : any combination of "link", "tx", "rx" flags
Priority/combination:
* If "mode" present: flags come from "mode" and take precedence.
Family is taken from "family" if present, otherwise from the LED name.
* If only "family" present: use its family and default flags = link+tx+rx.
* If neither present: fall back to LED device name parsing.
- Suffix "-online" is valid ONLY in the LED name (label),
e.g. "green:wlan-online". It indicates the online variant but is applied
only when DT "mode" is absent.
Behaviour:
- wlan (normal): blink/solid driven by throughput table
- lan/wan (normal): one-shot blink on TX/RX packet change
- *-online variants: steady ON while any interface of the family has carrier
Interfaces are auto-tracked by name match (lan0, wan1, wlan2, phy0, wl1,
ath0, ra0...). Up to MAX_IFACES (16) interfaces per family
This trigger is intended for board/device authors and drivers to provide simple
network-activity LED behaviour without per-interface wiring in userspace.
Refresh bcm27xx patches in the same commit to account for line shifts in
drivers/leds/trigger/Kconfig and Makefile, ensuring clean applies for
bisectability.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: openwrt/openwrt#19903
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2aa1185fb05eb7f2e4c7e4f9c66e3727010328af)
Link: openwrt/openwrt#23685
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit f191b85d2f7b90b7f907958cfccc0e291ed5e2b3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry picked from commit 2aa1185
I noticed two solutions for displaying the status of several devices/ports using a single LED:
Additionally, it's not possible to define a WAN LED directly in the DTS file.
That's why he created an additional ledtrig_network module to solve all these problems at once.
Features:
echo "network" > /sys/class/leds/<led>/triggerecho "lan" > /sys/class/leds/<led>/familyecho 0 > /sys/class/leds/<led>/linkSample DTS file:
dmesg | grep ledtrig_network
Link: #19903