keyboard.h 1.1 KB

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