aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-02-13 13:53:49 +0000
committerJohn Crispin <john@phrozen.org>2018-02-14 07:54:24 +0100
commiteb8fbc431879a698b5bd8f3bcb8a057ce01793c0 (patch)
tree3a01ebb22fc91990ee0e70f3414c2f204909ce7d /include
parent0b8629c0e3c041ad71501a8bbd83ba924ef6e84e (diff)
downloadupstream-eb8fbc431879a698b5bd8f3bcb8a057ce01793c0.tar.gz
upstream-eb8fbc431879a698b5bd8f3bcb8a057ce01793c0.tar.bz2
upstream-eb8fbc431879a698b5bd8f3bcb8a057ce01793c0.zip
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 0369e358916ef092a1644334f5dd1412051b68a4, 3056d09b4046e0eb0f6de0f3f5432cd9fa86fc51, 4ddbc43cc15c2fa128a2f169964ef7eb508cf2c5, 4d8a66d9346373c2a7fcac5bdae3f662a9dbd9df. 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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions