keyboard.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * drivers/s390/char/keyboard.h
  3. * ebcdic keycode functions for s390 console drivers
  4. *
  5. * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  6. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
  7. */
  8. #include <linux/tty.h>
  9. #include <linux/tty_flip.h>
  10. #include <linux/keyboard.h>
  11. #define NR_FN_HANDLER 20
  12. struct kbd_data;
  13. typedef void (fn_handler_fn)(struct kbd_data *);
  14. /*
  15. * FIXME: explain key_maps tricks.
  16. */
  17. struct kbd_data {
  18. struct tty_struct *tty;
  19. unsigned short **key_maps;
  20. char **func_table;
  21. fn_handler_fn **fn_handler;
  22. struct kbdiacruc *accent_table;
  23. unsigned int accent_table_size;
  24. unsigned int diacr;
  25. unsigned short sysrq;
  26. };
  27. struct kbd_data *kbd_alloc(void);
  28. void kbd_free(struct kbd_data *);
  29. void kbd_ascebc(struct kbd_data *, unsigned char *);
  30. void kbd_keycode(struct kbd_data *, unsigned int);
  31. int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
  32. /*
  33. * Helper Functions.
  34. */
  35. static inline void
  36. kbd_put_queue(struct tty_struct *tty, int ch)
  37. {
  38. tty_insert_flip_char(tty, ch, 0);
  39. tty_schedule_flip(tty);
  40. }
  41. static inline void
  42. kbd_puts_queue(struct tty_struct *tty, char *cp)
  43. {
  44. while (*cp)
  45. tty_insert_flip_char(tty, *cp++, 0);
  46. tty_schedule_flip(tty);
  47. }