Add a netdev LED trigger for all Blinkenlights lovers...
Originally taken from https://dev.openwrt.org/ticket/2776
Slightly updated for 2.6.24 by Mickey Lauer <mickey@openmoko.org>
and for 2.6.36 by Eric Cooper <ecc@cmu.edu>
Signed-off-by: Eric Cooper <ecc@cmu.edu>
---
Changes in v2:
- Use individual entries for link, transmit, and receive;
each can be "enabled" or "disabled"
- Use strict_strtoul instead of simple_strtoul
- Add descriptions to Documentation/ABI/testing/sysfs-class-led
Documentation/ABI/testing/sysfs-class-led | 64 ++++
drivers/leds/Kconfig | 7 +
drivers/leds/Makefile | 1 +
drivers/leds/ledtrig-netdev.c | 475 +++++++++++++++++++++++++++++
4 files changed, 547 insertions(+), 0 deletions(-)
create mode 100644 drivers/leds/ledtrig-netdev.c
diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
index 9e4541d..0b03863 100644
--- a/Documentation/ABI/testing/sysfs-class-led
+++ b/Documentation/ABI/testing/sysfs-class-led
@@ -26,3 +26,67 @@ Description:
scheduler is chosen. Trigger specific parameters can appear in
/sys/class/leds/<led> once a given trigger is selected.
+What: /sys/class/leds/<led>/device_name
+Date: November 2010
+KernelVersion: 2.6.37
+Contact: Eric Cooper <ecc@cmu.edu>
+Description:
+ Network device name to monitor when trigger is set to "netdev".
+
+What: /sys/class/leds/<led>/interval
+Date: November 2010
+KernelVersion: 2.6.37
+Contact: Eric Cooper <ecc@cmu.edu>
+Description:
+ Duration of LED blink in milliseconds when trigger is set to
+ "netdev".
+
+What: /sys/class/leds/<led>/link
+Date: November 2010
+KernelVersion: 2.6.37
+Contact: Eric Cooper <ecc@cmu.edu>
+Description:
+ When trigger is set to "netdev", this value is either "enabled"
+ or "disabled". If enabled, this LED's normal state reflects
+ whether or not the link for the corresponding network device
+ is up (has ...