Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * ebcdic keycode functions for s390 console drivers |
3 | * | |
a53c8fab | 4 | * Copyright IBM Corp. 2003 |
1da177e4 LT |
5 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), |
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 | ||
14 | struct kbd_data; | |
15 | ||
16 | typedef void (fn_handler_fn)(struct kbd_data *); | |
17 | ||
18 | /* | |
19 | * FIXME: explain key_maps tricks. | |
20 | */ | |
21 | ||
22 | struct kbd_data { | |
ba186e7d | 23 | struct tty_port *port; |
1da177e4 LT |
24 | unsigned short **key_maps; |
25 | char **func_table; | |
26 | fn_handler_fn **fn_handler; | |
04c71976 | 27 | struct kbdiacruc *accent_table; |
1da177e4 | 28 | unsigned int accent_table_size; |
04c71976 | 29 | unsigned int diacr; |
1da177e4 LT |
30 | unsigned short sysrq; |
31 | }; | |
32 | ||
33 | struct kbd_data *kbd_alloc(void); | |
34 | void kbd_free(struct kbd_data *); | |
35 | void kbd_ascebc(struct kbd_data *, unsigned char *); | |
36 | ||
37 | void kbd_keycode(struct kbd_data *, unsigned int); | |
65c56e07 | 38 | int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long); |
1da177e4 LT |
39 | |
40 | /* | |
41 | * Helper Functions. | |
42 | */ | |
4448aaf0 | 43 | static inline void |
ba186e7d | 44 | kbd_put_queue(struct tty_port *port, int ch) |
1da177e4 | 45 | { |
92a19f9c | 46 | tty_insert_flip_char(port, ch, 0); |
6732c8bb | 47 | tty_schedule_flip(port); |
1da177e4 LT |
48 | } |
49 | ||
4448aaf0 | 50 | static inline void |
ba186e7d | 51 | kbd_puts_queue(struct tty_port *port, char *cp) |
1da177e4 LT |
52 | { |
53 | while (*cp) | |
92a19f9c | 54 | tty_insert_flip_char(port, *cp++, 0); |
6732c8bb | 55 | tty_schedule_flip(port); |
1da177e4 | 56 | } |