initial commit with v3.6.7
[linux-3.6.7-moxart.git] / drivers / s390 / char / keyboard.h
blobd0ae2be581910bad288b808fe4e6940c212b4ef8
1 /*
2 * ebcdic keycode functions for s390 console drivers
4 * Copyright IBM Corp. 2003
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
6 */
8 #include <linux/tty.h>
9 #include <linux/tty_flip.h>
10 #include <linux/keyboard.h>
12 #define NR_FN_HANDLER 20
14 struct kbd_data;
16 typedef void (fn_handler_fn)(struct kbd_data *);
19 * FIXME: explain key_maps tricks.
22 struct 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;
33 struct kbd_data *kbd_alloc(void);
34 void kbd_free(struct kbd_data *);
35 void kbd_ascebc(struct kbd_data *, unsigned char *);
37 void kbd_keycode(struct kbd_data *, unsigned int);
38 int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
41 * Helper Functions.
43 static inline void
44 kbd_put_queue(struct tty_port *port, int ch)
46 struct tty_struct *tty = tty_port_tty_get(port);
47 if (!tty)
48 return;
49 tty_insert_flip_char(tty, ch, 0);
50 tty_schedule_flip(tty);
51 tty_kref_put(tty);
54 static inline void
55 kbd_puts_queue(struct tty_port *port, char *cp)
57 struct tty_struct *tty = tty_port_tty_get(port);
58 if (!tty)
59 return;
60 while (*cp)
61 tty_insert_flip_char(tty, *cp++, 0);
62 tty_schedule_flip(tty);
63 tty_kref_put(tty);