termbits.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * include/asm-xtensa/termbits.h
  3. *
  4. * Copied from SH.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. *
  10. * Copyright (C) 2001 - 2005 Tensilica Inc.
  11. */
  12. #ifndef _XTENSA_TERMBITS_H
  13. #define _XTENSA_TERMBITS_H
  14. #include <linux/posix_types.h>
  15. typedef unsigned char cc_t;
  16. typedef unsigned int speed_t;
  17. typedef unsigned int tcflag_t;
  18. #define NCCS 19
  19. struct termios {
  20. tcflag_t c_iflag; /* input mode flags */
  21. tcflag_t c_oflag; /* output mode flags */
  22. tcflag_t c_cflag; /* control mode flags */
  23. tcflag_t c_lflag; /* local mode flags */
  24. cc_t c_line; /* line discipline */
  25. cc_t c_cc[NCCS]; /* control characters */
  26. };
  27. struct termios2 {
  28. tcflag_t c_iflag; /* input mode flags */
  29. tcflag_t c_oflag; /* output mode flags */
  30. tcflag_t c_cflag; /* control mode flags */
  31. tcflag_t c_lflag; /* local mode flags */
  32. cc_t c_line; /* line discipline */
  33. cc_t c_cc[NCCS]; /* control characters */
  34. speed_t c_ispeed; /* input speed */
  35. speed_t c_ospeed; /* output speed */
  36. };
  37. struct ktermios {
  38. tcflag_t c_iflag; /* input mode flags */
  39. tcflag_t c_oflag; /* output mode flags */
  40. tcflag_t c_cflag; /* control mode flags */
  41. tcflag_t c_lflag; /* local mode flags */
  42. cc_t c_line; /* line discipline */
  43. cc_t c_cc[NCCS]; /* control characters */
  44. speed_t c_ispeed; /* input speed */
  45. speed_t c_ospeed; /* output speed */
  46. };
  47. /* c_cc characters */
  48. #define VINTR 0
  49. #define VQUIT 1
  50. #define VERASE 2
  51. #define VKILL 3
  52. #define VEOF 4
  53. #define VTIME 5
  54. #define VMIN 6
  55. #define VSWTC 7
  56. #define VSTART 8
  57. #define VSTOP 9
  58. #define VSUSP 10
  59. #define VEOL 11
  60. #define VREPRINT 12
  61. #define VDISCARD 13
  62. #define VWERASE 14
  63. #define VLNEXT 15
  64. #define VEOL2 16
  65. /* c_iflag bits */
  66. #define IGNBRK 0000001
  67. #define BRKINT 0000002
  68. #define IGNPAR 0000004
  69. #define PARMRK 0000010
  70. #define INPCK 0000020
  71. #define ISTRIP 0000040
  72. #define INLCR 0000100
  73. #define IGNCR 0000200
  74. #define ICRNL 0000400
  75. #define IUCLC 0001000
  76. #define IXON 0002000
  77. #define IXANY 0004000
  78. #define IXOFF 0010000
  79. #define IMAXBEL 0020000
  80. #define IUTF8 0040000
  81. /* c_oflag bits */
  82. #define OPOST 0000001
  83. #define OLCUC 0000002
  84. #define ONLCR 0000004
  85. #define OCRNL 0000010
  86. #define ONOCR 0000020
  87. #define ONLRET 0000040
  88. #define OFILL 0000100
  89. #define OFDEL 0000200
  90. #define NLDLY 0000400
  91. #define NL0 0000000
  92. #define NL1 0000400
  93. #define CRDLY 0003000
  94. #define CR0 0000000
  95. #define CR1 0001000
  96. #define CR2 0002000
  97. #define CR3 0003000
  98. #define TABDLY 0014000
  99. #define TAB0 0000000
  100. #define TAB1 0004000
  101. #define TAB2 0010000
  102. #define TAB3 0014000
  103. #define XTABS 0014000
  104. #define BSDLY 0020000
  105. #define BS0 0000000
  106. #define BS1 0020000
  107. #define VTDLY 0040000
  108. #define VT0 0000000
  109. #define VT1 0040000
  110. #define FFDLY 0100000
  111. #define FF0 0000000
  112. #define FF1 0100000
  113. /* c_cflag bit meaning */
  114. #define CBAUD 0010017
  115. #define B0 0000000 /* hang up */
  116. #define B50 0000001
  117. #define B75 0000002
  118. #define B110 0000003
  119. #define B134 0000004
  120. #define B150 0000005
  121. #define B200 0000006
  122. #define B300 0000007
  123. #define B600 0000010
  124. #define B1200 0000011
  125. #define B1800 0000012
  126. #define B2400 0000013
  127. #define B4800 0000014
  128. #define B9600 0000015
  129. #define B19200 0000016
  130. #define B38400 0000017
  131. #define EXTA B19200
  132. #define EXTB B38400
  133. #define CSIZE 0000060
  134. #define CS5 0000000
  135. #define CS6 0000020
  136. #define CS7 0000040
  137. #define CS8 0000060
  138. #define CSTOPB 0000100
  139. #define CREAD 0000200
  140. #define PARENB 0000400
  141. #define PARODD 0001000
  142. #define HUPCL 0002000
  143. #define CLOCAL 0004000
  144. #define CBAUDEX 0010000
  145. #define BOTHER 0010000
  146. #define B57600 0010001
  147. #define B115200 0010002
  148. #define B230400 0010003
  149. #define B460800 0010004
  150. #define B500000 0010005
  151. #define B576000 0010006
  152. #define B921600 0010007
  153. #define B1000000 0010010
  154. #define B1152000 0010011
  155. #define B1500000 0010012
  156. #define B2000000 0010013
  157. #define B2500000 0010014
  158. #define B3000000 0010015
  159. #define B3500000 0010016
  160. #define B4000000 0010017
  161. #define CIBAUD 002003600000 /* input baud rate */
  162. #define CMSPAR 010000000000 /* mark or space (stick) parity */
  163. #define CRTSCTS 020000000000 /* flow control */
  164. #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
  165. /* c_lflag bits */
  166. #define ISIG 0000001
  167. #define ICANON 0000002
  168. #define XCASE 0000004
  169. #define ECHO 0000010
  170. #define ECHOE 0000020
  171. #define ECHOK 0000040
  172. #define ECHONL 0000100
  173. #define NOFLSH 0000200
  174. #define TOSTOP 0000400
  175. #define ECHOCTL 0001000
  176. #define ECHOPRT 0002000
  177. #define ECHOKE 0004000
  178. #define FLUSHO 0010000
  179. #define PENDIN 0040000
  180. #define IEXTEN 0100000
  181. #define EXTPROC 0200000
  182. /* tcflow() and TCXONC use these */
  183. #define TCOOFF 0
  184. #define TCOON 1
  185. #define TCIOFF 2
  186. #define TCION 3
  187. /* tcflush() and TCFLSH use these */
  188. #define TCIFLUSH 0
  189. #define TCOFLUSH 1
  190. #define TCIOFLUSH 2
  191. /* tcsetattr uses these */
  192. #define TCSANOW 0
  193. #define TCSADRAIN 1
  194. #define TCSAFLUSH 2
  195. #endif /* _XTENSA_TERMBITS_H */