星期三, 3月 30, 2016

LED

https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/files-2.6.31/drivers/leds/ledtrig-netdev.c?rev=18925

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
33#include
34#endif
35
36#include "leds.h"
37
38/*
39 * Configurable sysfs attributes:
40 *
41 * device_name - network device name to monitor
42 *
43 * interval - duration of LED blink, in milliseconds
44 *
45 * mode - either "none" (LED is off) or a space separated list of one or more of:
46 *   link: LED's normal state reflects whether the link is up (has carrier) or not
47 *   tx:   LED blinks on transmitted data
48 *   rx:   LED blinks on receive data
49 *
50 * Some suggestions:
51 *
52 *  Simple link status LED:
53 *  $ echo netdev >someled/trigger
54 *  $ echo eth0 >someled/device_name
55 *  $ echo link >someled/mode
56 *
57 *  Ethernet-style link/activity LED:
58 *  $ echo netdev >someled/trigger
59 *  $ echo eth0 >someled/device_name
60 *  $ echo "link tx rx" >someled/mode
61 *
62 *  Modem-style tx/rx LEDs:
63 *  $ echo netdev >led1/trigger
64 *  $ echo ppp0 >led1/device_name
65 *  $ echo tx >led1/mode
66 *  $ echo netdev >led2/trigger
67 *  $ echo ppp0 >led2/device_name
68 *  $ echo rx >led2/mode

沒有留言: