This source file includes following definitions.
- set_leds
- vc_kbd_mode
- vc_kbd_led
- set_vc_kbd_mode
- set_vc_kbd_led
- clr_vc_kbd_mode
- clr_vc_kbd_led
- chg_vc_kbd_lock
- chg_vc_kbd_slock
- chg_vc_kbd_mode
- chg_vc_kbd_led
1
2 #ifndef _KBD_KERN_H
3 #define _KBD_KERN_H
4
5 #include <linux/tty.h>
6 #include <linux/interrupt.h>
7 #include <linux/keyboard.h>
8
9 extern struct tasklet_struct keyboard_tasklet;
10
11 extern char *func_table[MAX_NR_FUNC];
12 extern char func_buf[];
13 extern char *funcbufptr;
14 extern int funcbufsize, funcbufleft;
15
16
17
18
19
20
21
22
23
24
25 struct kbd_struct {
26
27 unsigned char lockstate;
28
29
30 #define VC_SHIFTLOCK KG_SHIFT
31 #define VC_ALTGRLOCK KG_ALTGR
32 #define VC_CTRLLOCK KG_CTRL
33 #define VC_ALTLOCK KG_ALT
34 #define VC_SHIFTLLOCK KG_SHIFTL
35 #define VC_SHIFTRLOCK KG_SHIFTR
36 #define VC_CTRLLLOCK KG_CTRLL
37 #define VC_CTRLRLOCK KG_CTRLR
38 unsigned char slockstate;
39
40 unsigned char ledmode:1;
41 #define LED_SHOW_FLAGS 0
42 #define LED_SHOW_IOCTL 1
43
44 unsigned char ledflagstate:4;
45 unsigned char default_ledflagstate:4;
46 #define VC_SCROLLOCK 0
47 #define VC_NUMLOCK 1
48 #define VC_CAPSLOCK 2
49 #define VC_KANALOCK 3
50
51 unsigned char kbdmode:3;
52 #define VC_XLATE 0
53 #define VC_MEDIUMRAW 1
54 #define VC_RAW 2
55 #define VC_UNICODE 3
56 #define VC_OFF 4
57
58 unsigned char modeflags:5;
59 #define VC_APPLIC 0
60 #define VC_CKMODE 1
61 #define VC_REPEAT 2
62 #define VC_CRLF 3
63 #define VC_META 4
64 };
65
66 extern int kbd_init(void);
67
68 extern void setledstate(struct kbd_struct *kbd, unsigned int led);
69
70 extern int do_poke_blanked_console;
71
72 extern void (*kbd_ledfunc)(unsigned int led);
73
74 extern int set_console(int nr);
75 extern void schedule_console_callback(void);
76
77
78 static inline void set_leds(void)
79 {
80 tasklet_schedule(&keyboard_tasklet);
81 }
82
83 static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
84 {
85 return ((kbd->modeflags >> flag) & 1);
86 }
87
88 static inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
89 {
90 return ((kbd->ledflagstate >> flag) & 1);
91 }
92
93 static inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
94 {
95 kbd->modeflags |= 1 << flag;
96 }
97
98 static inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
99 {
100 kbd->ledflagstate |= 1 << flag;
101 }
102
103 static inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
104 {
105 kbd->modeflags &= ~(1 << flag);
106 }
107
108 static inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
109 {
110 kbd->ledflagstate &= ~(1 << flag);
111 }
112
113 static inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
114 {
115 kbd->lockstate ^= 1 << flag;
116 }
117
118 static inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag)
119 {
120 kbd->slockstate ^= 1 << flag;
121 }
122
123 static inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
124 {
125 kbd->modeflags ^= 1 << flag;
126 }
127
128 static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
129 {
130 kbd->ledflagstate ^= 1 << flag;
131 }
132
133 #define U(x) ((x) ^ 0xf000)
134
135 #define BRL_UC_ROW 0x2800
136
137
138
139 struct console;
140
141 void compute_shiftstate(void);
142
143
144
145 extern unsigned int keymap_count;
146
147 #endif