termios_internal.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_TERMIOS_CONV_H
  3. #define _LINUX_TERMIOS_CONV_H
  4. #include <linux/uaccess.h>
  5. #include <asm/termios.h>
  6. /* intr=^C quit=^\ erase=del kill=^U
  7. eof=^D vtime=\0 vmin=\1 sxtc=\0
  8. start=^Q stop=^S susp=^Z eol=\0
  9. reprint=^R discard=^O werase=^W lnext=^V
  10. eol2=\0
  11. */
  12. #ifdef VDSUSP
  13. #define INIT_C_CC_VDSUSP_EXTRA [VDSUSP] = 'Y'-0x40,
  14. #else
  15. #define INIT_C_CC_VDSUSP_EXTRA
  16. #endif
  17. #define INIT_C_CC { \
  18. [VINTR] = 'C'-0x40, \
  19. [VQUIT] = '\\'-0x40, \
  20. [VERASE] = '\177', \
  21. [VKILL] = 'U'-0x40, \
  22. [VEOF] = 'D'-0x40, \
  23. [VSTART] = 'Q'-0x40, \
  24. [VSTOP] = 'S'-0x40, \
  25. [VSUSP] = 'Z'-0x40, \
  26. [VREPRINT] = 'R'-0x40, \
  27. [VDISCARD] = 'O'-0x40, \
  28. [VWERASE] = 'W'-0x40, \
  29. [VLNEXT] = 'V'-0x40, \
  30. INIT_C_CC_VDSUSP_EXTRA \
  31. [VMIN] = 1 }
  32. int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *);
  33. int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *);
  34. #ifdef TCGETS2
  35. int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *);
  36. int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *);
  37. int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *);
  38. int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *);
  39. #else /* TCGETS2 */
  40. int user_termios_to_kernel_termios(struct ktermios *, struct termios __user *);
  41. int kernel_termios_to_user_termios(struct termios __user *, struct ktermios *);
  42. #endif /* TCGETS2 */
  43. #endif /* _LINUX_TERMIOS_CONV_H */