termbits.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_TERMBITS_H
  3. #define __ASM_GENERIC_TERMBITS_H
  4. #include <asm-generic/termbits-common.h>
  5. typedef unsigned int tcflag_t;
  6. #define NCCS 19
  7. struct termios {
  8. tcflag_t c_iflag; /* input mode flags */
  9. tcflag_t c_oflag; /* output mode flags */
  10. tcflag_t c_cflag; /* control mode flags */
  11. tcflag_t c_lflag; /* local mode flags */
  12. cc_t c_line; /* line discipline */
  13. cc_t c_cc[NCCS]; /* control characters */
  14. };
  15. struct termios2 {
  16. tcflag_t c_iflag; /* input mode flags */
  17. tcflag_t c_oflag; /* output mode flags */
  18. tcflag_t c_cflag; /* control mode flags */
  19. tcflag_t c_lflag; /* local mode flags */
  20. cc_t c_line; /* line discipline */
  21. cc_t c_cc[NCCS]; /* control characters */
  22. speed_t c_ispeed; /* input speed */
  23. speed_t c_ospeed; /* output speed */
  24. };
  25. struct ktermios {
  26. tcflag_t c_iflag; /* input mode flags */
  27. tcflag_t c_oflag; /* output mode flags */
  28. tcflag_t c_cflag; /* control mode flags */
  29. tcflag_t c_lflag; /* local mode flags */
  30. cc_t c_line; /* line discipline */
  31. cc_t c_cc[NCCS]; /* control characters */
  32. speed_t c_ispeed; /* input speed */
  33. speed_t c_ospeed; /* output speed */
  34. };
  35. /* c_cc characters */
  36. #define VINTR 0
  37. #define VQUIT 1
  38. #define VERASE 2
  39. #define VKILL 3
  40. #define VEOF 4
  41. #define VTIME 5
  42. #define VMIN 6
  43. #define VSWTC 7
  44. #define VSTART 8
  45. #define VSTOP 9
  46. #define VSUSP 10
  47. #define VEOL 11
  48. #define VREPRINT 12
  49. #define VDISCARD 13
  50. #define VWERASE 14
  51. #define VLNEXT 15
  52. #define VEOL2 16
  53. /* c_iflag bits */
  54. #define IUCLC 0x0200
  55. #define IXON 0x0400
  56. #define IXOFF 0x1000
  57. #define IMAXBEL 0x2000
  58. #define IUTF8 0x4000
  59. /* c_oflag bits */
  60. #define OLCUC 0x00002
  61. #define ONLCR 0x00004
  62. #define NLDLY 0x00100
  63. #define NL0 0x00000
  64. #define NL1 0x00100
  65. #define CRDLY 0x00600
  66. #define CR0 0x00000
  67. #define CR1 0x00200
  68. #define CR2 0x00400
  69. #define CR3 0x00600
  70. #define TABDLY 0x01800
  71. #define TAB0 0x00000
  72. #define TAB1 0x00800
  73. #define TAB2 0x01000
  74. #define TAB3 0x01800
  75. #define XTABS 0x01800
  76. #define BSDLY 0x02000
  77. #define BS0 0x00000
  78. #define BS1 0x02000
  79. #define VTDLY 0x04000
  80. #define VT0 0x00000
  81. #define VT1 0x04000
  82. #define FFDLY 0x08000
  83. #define FF0 0x00000
  84. #define FF1 0x08000
  85. /* c_cflag bit meaning */
  86. #define CBAUD 0x0000100f
  87. #define CSIZE 0x00000030
  88. #define CS5 0x00000000
  89. #define CS6 0x00000010
  90. #define CS7 0x00000020
  91. #define CS8 0x00000030
  92. #define CSTOPB 0x00000040
  93. #define CREAD 0x00000080
  94. #define PARENB 0x00000100
  95. #define PARODD 0x00000200
  96. #define HUPCL 0x00000400
  97. #define CLOCAL 0x00000800
  98. #define CBAUDEX 0x00001000
  99. #define BOTHER 0x00001000
  100. #define B57600 0x00001001
  101. #define B115200 0x00001002
  102. #define B230400 0x00001003
  103. #define B460800 0x00001004
  104. #define B500000 0x00001005
  105. #define B576000 0x00001006
  106. #define B921600 0x00001007
  107. #define B1000000 0x00001008
  108. #define B1152000 0x00001009
  109. #define B1500000 0x0000100a
  110. #define B2000000 0x0000100b
  111. #define B2500000 0x0000100c
  112. #define B3000000 0x0000100d
  113. #define B3500000 0x0000100e
  114. #define B4000000 0x0000100f
  115. #define CIBAUD 0x100f0000 /* input baud rate */
  116. /* c_lflag bits */
  117. #define ISIG 0x00001
  118. #define ICANON 0x00002
  119. #define XCASE 0x00004
  120. #define ECHO 0x00008
  121. #define ECHOE 0x00010
  122. #define ECHOK 0x00020
  123. #define ECHONL 0x00040
  124. #define NOFLSH 0x00080
  125. #define TOSTOP 0x00100
  126. #define ECHOCTL 0x00200
  127. #define ECHOPRT 0x00400
  128. #define ECHOKE 0x00800
  129. #define FLUSHO 0x01000
  130. #define PENDIN 0x04000
  131. #define IEXTEN 0x08000
  132. #define EXTPROC 0x10000
  133. /* tcsetattr uses these */
  134. #define TCSANOW 0
  135. #define TCSADRAIN 1
  136. #define TCSAFLUSH 2
  137. #endif /* __ASM_GENERIC_TERMBITS_H */