s390/comments: unify copyright messages and remove file names
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / s390 / char / keyboard.h
CommitLineData
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
14struct kbd_data;
15
16typedef void (fn_handler_fn)(struct kbd_data *);
17
18/*
19 * FIXME: explain key_maps tricks.
20 */
21
22struct 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
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);
65c56e07 38int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
1da177e4
LT
39
40/*
41 * Helper Functions.
42 */
4448aaf0 43static inline void
ba186e7d 44kbd_put_queue(struct tty_port *port, int ch)
1da177e4 45{
ba186e7d
JS
46 struct tty_struct *tty = tty_port_tty_get(port);
47 if (!tty)
48 return;
1da177e4
LT
49 tty_insert_flip_char(tty, ch, 0);
50 tty_schedule_flip(tty);
ba186e7d 51 tty_kref_put(tty);
1da177e4
LT
52}
53
4448aaf0 54static inline void
ba186e7d 55kbd_puts_queue(struct tty_port *port, char *cp)
1da177e4 56{
ba186e7d
JS
57 struct tty_struct *tty = tty_port_tty_get(port);
58 if (!tty)
59 return;
1da177e4
LT
60 while (*cp)
61 tty_insert_flip_char(tty, *cp++, 0);
62 tty_schedule_flip(tty);
ba186e7d 63 tty_kref_put(tty);
1da177e4 64}