0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/tty.h>
0010 #include <linux/tty_flip.h>
0011 #include <linux/keyboard.h>
0012
0013 #define NR_FN_HANDLER 20
0014
0015 struct kbd_data;
0016
0017 extern int ebc_funcbufsize, ebc_funcbufleft;
0018 extern char *ebc_func_table[MAX_NR_FUNC];
0019 extern char ebc_func_buf[];
0020 extern char *ebc_funcbufptr;
0021 extern unsigned int ebc_keymap_count;
0022
0023 extern struct kbdiacruc ebc_accent_table[];
0024 extern unsigned int ebc_accent_table_size;
0025 extern unsigned short *ebc_key_maps[MAX_NR_KEYMAPS];
0026 extern unsigned short ebc_plain_map[NR_KEYS];
0027
0028 typedef void (fn_handler_fn)(struct kbd_data *);
0029
0030
0031
0032
0033
0034 struct kbd_data {
0035 struct tty_port *port;
0036 unsigned short **key_maps;
0037 char **func_table;
0038 fn_handler_fn **fn_handler;
0039 struct kbdiacruc *accent_table;
0040 unsigned int accent_table_size;
0041 unsigned int diacr;
0042 unsigned short sysrq;
0043 };
0044
0045 struct kbd_data *kbd_alloc(void);
0046 void kbd_free(struct kbd_data *);
0047 void kbd_ascebc(struct kbd_data *, unsigned char *);
0048
0049 void kbd_keycode(struct kbd_data *, unsigned int);
0050 int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
0051
0052
0053
0054
0055 static inline void
0056 kbd_put_queue(struct tty_port *port, int ch)
0057 {
0058 tty_insert_flip_char(port, ch, 0);
0059 tty_flip_buffer_push(port);
0060 }
0061
0062 static inline void
0063 kbd_puts_queue(struct tty_port *port, char *cp)
0064 {
0065 while (*cp)
0066 tty_insert_flip_char(port, *cp++, 0);
0067 tty_flip_buffer_push(port);
0068 }