openwrtv4/target/linux/generic/files/drivers/net/phy
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
..
b53 kernel: generic: Add kernel 4.14 support 2017-12-16 22:11:19 +01:00
adm6996.c generic: provide get_port_stats() on adm6996 switches 2017-09-01 09:30:35 +02:00
adm6996.h treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
ar8216.c generic: drop support for get_port_stats() on ar8xxx 2017-09-13 08:07:54 +02:00
ar8216.h generic: drop support for get_port_stats() on ar8xxx 2017-09-13 08:07:54 +02:00
ar8327.c generic: drop support for get_port_stats() on ar8xxx 2017-09-13 08:07:54 +02:00
ar8327.h ar8327: Add workarounds for AR8337 switch. 2017-03-30 09:48:52 +02:00
ip17xx.c ip17xx: correct aneg_done return value 2017-06-07 11:06:29 +02:00
mvsw61xx.c mvsw61xx: add support for MV88E6352 2017-01-13 17:12:40 +01:00
mvsw61xx.h mvsw61xx: add support for MV88E6352 2017-01-13 17:12:40 +01:00
mvswitch.c mvswitch: fix autonegotiation issue 2017-06-07 11:06:12 +02:00
mvswitch.h treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
psb6970.c kernel: update phy drivers for 4.9 2017-02-03 12:35:44 +01:00
rtl8306.c kernel: generic: Add kernel 4.14 support 2017-12-16 22:11:19 +01:00
rtl8366_smi.c generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
rtl8366_smi.h generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
rtl8366rb.c generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
rtl8366s.c generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
rtl8367.c generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
rtl8367b.c generic: provide get_port_stats() on rtl836x switches 2017-09-01 09:30:35 +02:00
swconfig.c kernel: generic: Add kernel 4.14 support 2017-12-16 22:11:19 +01:00
swconfig_leds.c generic: swconfig: add mode led attribute 2018-02-14 07:54:24 +01:00