MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / linux / ledman.h
bloba703e0d9e795d56ca3f536e2dd917825060fb500
1 #ifndef __LINUX_LEDMAN_H__
2 #define __LINUX_LEDMAN_H__ 1
3 /****************************************************************************/
4 /*
5 * ledman.h: LED manager header, generic, device indepedant LED stuff
7 * defines for led functionality which may/may not be implemented by the
8 * currently active LED configuration
10 * NOTE: do not change the numbering of the defines below, tables of
11 * LED patterns rely on these values
14 #include <linux/version.h>
16 #define LEDMAN_ALL 0 /* special case, all LED's */
18 #define LEDMAN_POWER 1
19 #define LEDMAN_HEARTBEAT 2
20 #define LEDMAN_COM1_RX 3
21 #define LEDMAN_COM1_TX 4
22 #define LEDMAN_COM2_RX 5
23 #define LEDMAN_COM2_TX 6
24 #define LEDMAN_LAN1_RX 7
25 #define LEDMAN_LAN1_TX 8
26 #define LEDMAN_LAN2_RX 9
27 #define LEDMAN_LAN2_TX 10
28 #define LEDMAN_USB1_RX 11
29 #define LEDMAN_USB1_TX 12
30 #define LEDMAN_USB2_RX 13
31 #define LEDMAN_USB2_TX 14
32 #define LEDMAN_NVRAM_1 15
33 #define LEDMAN_NVRAM_2 16
34 #define LEDMAN_VPN 17
35 #define LEDMAN_LAN1_DHCP 18
36 #define LEDMAN_LAN2_DHCP 19
37 #define LEDMAN_COM1_DCD 20
38 #define LEDMAN_COM2_DCD 21
39 #define LEDMAN_ONLINE 22
40 #define LEDMAN_LAN1_LINK 23
41 #define LEDMAN_LAN2_LINK 24
42 #define LEDMAN_VPN_RX 25
43 #define LEDMAN_VPN_TX 26
44 #define LEDMAN_RESET 27
45 #define LEDMAN_STATIC 28
46 #define LEDMAN_LAN3_RX 29
47 #define LEDMAN_LAN3_TX 30
48 #define LEDMAN_LAN3_LINK 31
49 #define LEDMAN_LAN3_DHCP 32
50 #define LEDMAN_FAILOVER 33
51 #define LEDMAN_HIGHAVAIL 34
52 #define LEDMAN_MAX 35 /* one more than the highest LED above */
54 #define LEDMAN_MAX_NAME 16
56 /****************************************************************************/
58 * ioctl cmds
61 #define LEDMAN_CMD_SET 0x01 /* turn on briefly to show activity */
62 #define LEDMAN_CMD_ON 0x02 /* turn LED on permanently */
63 #define LEDMAN_CMD_OFF 0x03 /* turn LED off permanently */
64 #define LEDMAN_CMD_FLASH 0x04 /* flash this LED */
65 #define LEDMAN_CMD_RESET 0x05 /* reset LED to default behaviour */
67 #define LEDMAN_CMD_ALT_ON 0x06 /* LED is being used for non-std reasons */
68 #define LEDMAN_CMD_ALT_OFF 0x07 /* LED is being used for std reasons */
70 #define LEDMAN_CMD_MODE 0x80 /* set LED to named mode (led=char *) */
71 #define LEDMAN_CMD_STARTTIMER 0x81 /* enable and init the ledman driver */
72 #define LEDMAN_CMD_KILLTIMER 0x82 /* disable the ledman driver */
74 #define LEDMAN_CMD_SIGNAL 0x100 /* pid of process to signal on reset */
76 #define LEDMAN_CMD_ALTBIT 0x8000 /* operate on alternate LED settings */
78 /****************************************************************************/
80 #define LEDMAN_MAJOR 126
82 /****************************************************************************/
83 #ifdef __KERNEL__
85 #if LINUX_VERSION_CODE < 0x020100
86 extern int ledman_init(void);
87 #endif
89 extern int ledman_setup(char *arg);
90 extern void ledman_killtimer(void);
91 extern void ledman_starttimer(void);
92 extern int ledman_cmd(int cmd, unsigned long led);
93 extern void ledman_signalreset(void);
95 #else
97 #include <fcntl.h>
99 #define ledman_cmd(cmd, led) ({ \
100 int fd; \
101 if ((fd = open("/dev/ledman", O_RDWR)) != -1) { \
102 ioctl(fd, cmd, led); \
103 close(fd); \
107 #endif
108 /****************************************************************************/
109 #endif /* __LINUX_LEDMAN_H__ */