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