This source file includes following definitions.
- vc_kbd_led
- vc_kbd_lock
- vc_kbd_mode
- set_vc_kbd_led
- set_vc_kbd_lock
- set_vc_kbd_mode
- clr_vc_kbd_led
- clr_vc_kbd_lock
- clr_vc_kbd_mode
- chg_vc_kbd_led
- chg_vc_kbd_lock
- chg_vc_kbd_mode
1 #ifndef _KBD_KERN_H
2 #define _KBD_KERN_H
3
4 #include <linux/interrupt.h>
5 #define set_leds() mark_bh(KEYBOARD_BH)
6
7 #include <linux/keyboard.h>
8
9
10
11
12
13
14
15
16
17
18 struct kbd_struct {
19 unsigned char ledstate;
20 unsigned char default_ledstate;
21 #define VC_SCROLLOCK 0
22 #define VC_NUMLOCK 1
23 #define VC_CAPSLOCK 2
24
25 unsigned char lockstate;
26 #define VC_SHIFTLOCK KG_SHIFT
27 #define VC_ALTGRLOCK KG_ALTGR
28 #define VC_CTRLLOCK KG_CTRL
29 #define VC_ALTLOCK KG_ALT
30
31 unsigned char modeflags;
32 #define VC_APPLIC 0
33 #define VC_CKMODE 1
34 #define VC_REPEAT 2
35 #define VC_CRLF 3
36 #define VC_META 4
37 #define VC_PAUSE 5
38 #define VC_RAW 6
39 #define VC_MEDIUMRAW 7
40 };
41
42 extern struct kbd_struct kbd_table[];
43
44
45 extern unsigned long kbd_init(unsigned long);
46
47 extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
48 {
49 return ((kbd->ledstate >> flag) & 1);
50 }
51
52 extern inline int vc_kbd_lock(struct kbd_struct * kbd, int flag)
53 {
54 return ((kbd->lockstate >> flag) & 1);
55 }
56
57 extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
58 {
59 return ((kbd->modeflags >> flag) & 1);
60 }
61
62 extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
63 {
64 kbd->ledstate |= 1 << flag;
65 }
66
67 extern inline void set_vc_kbd_lock(struct kbd_struct * kbd, int flag)
68 {
69 kbd->lockstate |= 1 << flag;
70 }
71
72 extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
73 {
74 kbd->modeflags |= 1 << flag;
75 }
76
77 extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
78 {
79 kbd->ledstate &= ~(1 << flag);
80 }
81
82 extern inline void clr_vc_kbd_lock(struct kbd_struct * kbd, int flag)
83 {
84 kbd->lockstate &= ~(1 << flag);
85 }
86
87 extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
88 {
89 kbd->modeflags &= ~(1 << flag);
90 }
91
92 extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
93 {
94 kbd->ledstate ^= 1 << flag;
95 }
96
97 extern inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
98 {
99 kbd->lockstate ^= 1 << flag;
100 }
101
102 extern inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
103 {
104 kbd->modeflags ^= 1 << flag;
105 }
106
107 #endif