openwrtv4/target/linux
Kevin Darbyshire-Bryant eb8fbc4318 generic: swconfig: add mode led attribute
Add sysfs 'mode' attribute to swconfig controlled LEDs.

swconfig 'link state' LEDs blink in the presence of port traffic.  This
behaviour becomes more obvious as switches start to support
get_port_stats() e.g. commits 0369e35891,
3056d09b40,
4ddbc43cc1,
4d8a66d934.

This blinking can be confusing/distracting if the switch has other LEDs
used to indicate traffic.  Provide a 'mode' sysfs attribute that
controls the blink on traffic behaviour.

mode - either "none" (LED is off) or a space separated list of one or more:

link: LED's normal state reflects whether the link is up (has carrier) or not
tx:   LED blinks on transmitted data
rx:   LED blinks on receive data

Note that 'link' considers any port speed mask that may be applicable.
e.g. if an LED is configured to indicate 1Gbit link speed and mode is
set to 'link rx tx' but the port is connected at 100Mbit then the LED
will not light or blink. A mode of 'tx rx' will blink in the presence of
traffic only if the port matches the rate (if configured)
This maintains compatibility with existing behaviour.

Attribute is 'link tx rx' by default for backwards compatible behaviour.

Many thanks to Thibaut Varene for providing a more sensible led_event
routine after I had mangled the original, and other coding style hints.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Acked-by: Thibaut VARENE <hacks@slashdirt.org>
2018-02-14 07:54:24 +01:00
..
adm5120 treewide: populate boardname and model earlier 2017-07-15 23:13:34 +02:00
adm8668 build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
apm821xx kernel: bump 4.14 to 4.14.18 2018-02-08 18:43:13 +01:00
ar7 ar7: switch to kernel 4.9 2018-02-12 11:45:33 +01:00
ar71xx ar71xx: add more registers to ar71x_regs.h 2018-02-13 11:20:58 +01:00
arc770 arc770: mark as source-only 2017-10-28 13:59:03 +02:00
archs38 archs38: bump kernel to 4.14. 2018-02-10 20:59:52 +01:00
armvirt armvirt: Resync kernel configuration 2018-01-12 15:14:27 -08:00
at91 at91: create device specific sdcard images 2018-01-11 20:35:33 +01:00
ath25 build: replace uses of OpenWrt with $(VERSION_DIST) 2018-02-05 10:15:53 +01:00
au1000 kernel: update kernel 3.18 to version 3.18.43 2016-10-24 20:25:14 +03:00
bcm53xx bcm53xx: rename SPI driver fix to use 0xx prefix as it was accepted 2018-01-12 23:29:48 +01:00
brcm47xx brcm47xx: image: build firmware for Asus WL-500g Deluxe 2017-12-29 23:18:19 +01:00
brcm63xx brcm63xx: drop root parameter from cmdline 2018-02-13 13:17:26 +01:00
brcm2708 target: disable CONFIG_PROC_PAGE_MONITOR on most targets 2018-01-13 15:04:15 +01:00
cns3xxx cns3xxx: remove linux 4.9 support 2018-02-13 10:01:53 +01:00
gemini kernel: Update kernel 4.4 to 4.4.100 2017-11-25 19:48:39 +01:00
generic generic: swconfig: add mode led attribute 2018-02-14 07:54:24 +01:00
imx6 imx6: use DTS_DIR at image build code 2018-02-10 21:02:53 +01:00
ipq806x ipq806x: switch to full dual-boot for the nbg6817 sysupgrade support 2018-02-13 12:45:00 +01:00
ixp4xx ixp4xx: remove linux 4.4 support 2018-02-09 10:29:07 +01:00
kirkwood kernel: bump 4.9 to 4.9.77 2018-01-20 20:22:01 +01:00
lantiq build: replace uses of OpenWrt with $(VERSION_DIST) 2018-02-05 10:15:53 +01:00
layerscape layerscape: fix call trace of pfe module removing 2018-02-13 10:01:51 +01:00
malta malta: bump tp v4.14 2018-01-09 10:26:16 +01:00
mcs814x build: replace uses of OpenWrt with $(VERSION_DIST) 2018-02-05 10:15:53 +01:00
mediatek mediatek: remove the CPU_SUBTYPE 2018-02-13 10:01:53 +01:00
mpc85xx target: disable CONFIG_PROC_PAGE_MONITOR on most targets 2018-01-13 15:04:15 +01:00
mvebu mvebu: Migrate uci config to new PCIe path 2018-02-13 22:30:59 +01:00
mxs mxs: rename files to files-4.9 2018-02-13 10:01:52 +01:00
octeon octeon: switch to kernel 4.14 2018-02-08 19:04:38 +01:00
octeontx octeontx: add support for OCTEON TX target 2018-02-13 10:01:52 +01:00
omap omap: clean up configuration 2017-10-18 21:46:05 +02:00
omap24xx omap24xx: remove referece to not existing kmod-usb-musb-tusb6010 2018-01-15 13:13:34 +01:00
orion orion: Switch to 4.9 kernel 2017-10-24 18:39:17 -07:00
oxnas kernel: bump 4.4 to 4.4.110 2018-01-10 00:11:39 +02:00
pistachio build: add config option KERNEL_MIPS_FPU_EMULATOR 2018-01-29 15:06:53 +08:00
ppc40x treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
ppc44x ppc44x: mark as broken 2017-01-10 12:49:34 +01:00
ramips ramips: add support for D-Link DAP-1522 A1 2018-02-13 11:18:07 +01:00
rb532 treewide: drop obsolete kernel config options 2017-10-04 20:08:15 +02:00
sunxi sunxi: Orange Pi R1: configure USB Ethernet controller. 2018-01-22 22:59:38 +01:00
uml merge: targets: update image generation and targets 2017-12-08 19:41:18 +01:00
x86 x86: add preinit hook to reload microcode 2018-02-11 14:39:24 +01:00
xburst target: disable CONFIG_PROC_PAGE_MONITOR on most targets 2018-01-13 15:04:15 +01:00
zynq target: disable CONFIG_PROC_PAGE_MONITOR on most targets 2018-01-13 15:04:15 +01:00
Makefile