]> git.ipfire.org Git - thirdparty/openwrt.git/commit
leds: add "network" LED trigger (lan/wan/wlan) 19903/head
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Thu, 27 Nov 2025 12:17:50 +0000 (13:17 +0100)
committerRobert Marko <robimarko@gmail.com>
Fri, 5 Jun 2026 18:30:34 +0000 (20:30 +0200)
commit2aa1185fb05eb7f2e4c7e4f9c66e3727010328af
treeb94bed55b3433ca37e6a6e7baa786ecbf4140983
parent848c54b5f42904d4afaae077efd5180cb6752b9c
leds: add "network" LED trigger (lan/wan/wlan)

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: https://github.com/openwrt/openwrt/pull/19903
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/linux/modules/leds.mk
target/linux/bcm27xx/patches-6.12/950-0189-leds-Add-the-actpwr-trigger.patch
target/linux/generic/config-6.12
target/linux/generic/config-6.18
target/linux/generic/files/drivers/leds/trigger/ledtrig-network.c [new file with mode: 0644]
target/linux/generic/hack-6.12/820-ledtrig-network-module.patch [new file with mode: 0644]
target/linux/generic/hack-6.18/820-ledtrig-network-module.patch [new file with mode: 0644]