1
2
3
4
5
6
7
8#include <linux/tty.h>
9#include <linux/tty_flip.h>
10#include <linux/keyboard.h>
11
12#define NR_FN_HANDLER 20
13
14struct kbd_data;
15
16typedef void (fn_handler_fn)(struct kbd_data *);
17
18
19
20
21
22struct kbd_data {
23 struct tty_port *port;
24 unsigned short **key_maps;
25 char **func_table;
26 fn_handler_fn **fn_handler;
27 struct kbdiacruc *accent_table;
28 unsigned int accent_table_size;
29 unsigned int diacr;
30 unsigned short sysrq;
31};
32
33struct kbd_data *kbd_alloc(void);
34void kbd_free(struct kbd_data *);
35void kbd_ascebc(struct kbd_data *, unsigned char *);
36
37void kbd_keycode(struct kbd_data *, unsigned int);
38int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
39
40
41
42
43static inline void
44kbd_put_queue(struct tty_port *port, int ch)
45{
46 tty_insert_flip_char(port, ch, 0);
47 tty_schedule_flip(port);
48}
49
50static inline void
51kbd_puts_queue(struct tty_port *port, char *cp)
52{
53 while (*cp)
54 tty_insert_flip_char(port, *cp++, 0);
55 tty_schedule_flip(port);
56}
57