termbits.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /* $Id: termbits.h,v 1.1 2000/07/10 16:32:31 bjornw Exp $ */
  2. #ifndef __ARCH_ETRAX100_TERMBITS_H__
  3. #define __ARCH_ETRAX100_TERMBITS_H__
  4. #include <linux/posix_types.h>
  5. typedef unsigned char cc_t;
  6. typedef unsigned int speed_t;
  7. typedef unsigned int tcflag_t;
  8. #define NCCS 19
  9. struct termios {
  10. tcflag_t c_iflag; /* input mode flags */
  11. tcflag_t c_oflag; /* output mode flags */
  12. tcflag_t c_cflag; /* control mode flags */
  13. tcflag_t c_lflag; /* local mode flags */
  14. cc_t c_line; /* line discipline */
  15. cc_t c_cc[NCCS]; /* control characters */
  16. };
  17. struct ktermios {
  18. tcflag_t c_iflag; /* input mode flags */
  19. tcflag_t c_oflag; /* output mode flags */
  20. tcflag_t c_cflag; /* control mode flags */
  21. tcflag_t c_lflag; /* local mode flags */
  22. cc_t c_line; /* line discipline */
  23. cc_t c_cc[NCCS]; /* control characters */
  24. speed_t c_ispeed; /* input speed */
  25. speed_t c_ospeed; /* output speed */
  26. };
  27. /* c_cc characters */
  28. #define VINTR 0
  29. #define VQUIT 1
  30. #define VERASE 2
  31. #define VKILL 3
  32. #define VEOF 4
  33. #define VTIME 5
  34. #define VMIN 6
  35. #define VSWTC 7
  36. #define VSTART 8
  37. #define VSTOP 9
  38. #define VSUSP 10
  39. #define VEOL 11
  40. #define VREPRINT 12
  41. #define VDISCARD 13
  42. #define VWERASE 14
  43. #define VLNEXT 15
  44. #define VEOL2 16
  45. /* c_iflag bits */
  46. #define IGNBRK 0000001
  47. #define BRKINT 0000002
  48. #define IGNPAR 0000004
  49. #define PARMRK 0000010
  50. #define INPCK 0000020
  51. #define ISTRIP 0000040
  52. #define INLCR 0000100
  53. #define IGNCR 0000200
  54. #define ICRNL 0000400
  55. #define IUCLC 0001000
  56. #define IXON 0002000
  57. #define IXANY 0004000
  58. #define IXOFF 0010000
  59. #define IMAXBEL 0020000
  60. #define IUTF8 0040000
  61. /* c_oflag bits */
  62. #define OPOST 0000001
  63. #define OLCUC 0000002
  64. #define ONLCR 0000004
  65. #define OCRNL 0000010
  66. #define ONOCR 0000020
  67. #define ONLRET 0000040
  68. #define OFILL 0000100
  69. #define OFDEL 0000200
  70. #define NLDLY 0000400
  71. #define NL0 0000000
  72. #define NL1 0000400
  73. #define CRDLY 0003000
  74. #define CR0 0000000
  75. #define CR1 0001000
  76. #define CR2 0002000
  77. #define CR3 0003000
  78. #define TABDLY 0014000
  79. #define TAB0 0000000
  80. #define TAB1 0004000
  81. #define TAB2 0010000
  82. #define TAB3 0014000
  83. #define XTABS 0014000
  84. #define BSDLY 0020000
  85. #define BS0 0000000
  86. #define BS1 0020000
  87. #define VTDLY 0040000
  88. #define VT0 0000000
  89. #define VT1 0040000
  90. #define FFDLY 0100000
  91. #define FF0 0000000
  92. #define FF1 0100000
  93. /* c_cflag bit meaning */
  94. /*
  95. * 3 2 1
  96. * 10 987 654 321 098 765 432 109 876 543 210
  97. * | | ||| CBAUD
  98. * obaud
  99. *
  100. * ||CSIZE
  101. *
  102. * |CSTOP
  103. * |CREAD
  104. * |CPARENB
  105. *
  106. * |CPARODD
  107. * |HUPCL
  108. * |CLOCAL
  109. * |CBAUDEX
  110. * 10 987 654 321 098 765 432 109 876 543 210
  111. * | || || CIBAUD, IBSHIFT=16
  112. * ibaud
  113. * |CMSPAR
  114. * | CRTSCTS
  115. * x x xxx xxx x x xx Free bits
  116. */
  117. #define CBAUD 0010017
  118. #define B0 0000000 /* hang up */
  119. #define B50 0000001
  120. #define B75 0000002
  121. #define B110 0000003
  122. #define B134 0000004
  123. #define B150 0000005
  124. #define B200 0000006
  125. #define B300 0000007
  126. #define B600 0000010
  127. #define B1200 0000011
  128. #define B1800 0000012
  129. #define B2400 0000013
  130. #define B4800 0000014
  131. #define B9600 0000015
  132. #define B19200 0000016
  133. #define B38400 0000017
  134. #define EXTA B19200
  135. #define EXTB B38400
  136. #define CSIZE 0000060
  137. #define CS5 0000000
  138. #define CS6 0000020
  139. #define CS7 0000040
  140. #define CS8 0000060
  141. #define CSTOPB 0000100
  142. #define CREAD 0000200
  143. #define PARENB 0000400
  144. #define PARODD 0001000
  145. #define HUPCL 0002000
  146. #define CLOCAL 0004000
  147. #define CBAUDEX 0010000
  148. #define B57600 0010001
  149. #define B115200 0010002
  150. #define B230400 0010003
  151. #define B460800 0010004
  152. /* etrax supports these additional three baud rates */
  153. #define B921600 0010005
  154. #define B1843200 0010006
  155. #define B6250000 0010007
  156. /* ETRAX FS supports this as well */
  157. #define B12500000 0010010
  158. #define CIBAUD 002003600000 /* input baud rate (used in v32) */
  159. /* The values for CIBAUD bits are the same as the values for CBAUD and CBAUDEX
  160. * shifted left IBSHIFT bits.
  161. */
  162. #define IBSHIFT 16
  163. #define CMSPAR 010000000000 /* mark or space (stick) parity - PARODD=space*/
  164. #define CRTSCTS 020000000000 /* flow control */
  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. /* tcflow() and TCXONC use these */
  182. #define TCOOFF 0
  183. #define TCOON 1
  184. #define TCIOFF 2
  185. #define TCION 3
  186. /* tcflush() and TCFLSH use these */
  187. #define TCIFLUSH 0
  188. #define TCOFLUSH 1
  189. #define TCIOFLUSH 2
  190. /* tcsetattr uses these */
  191. #define TCSANOW 0
  192. #define TCSADRAIN 1
  193. #define TCSAFLUSH 2
  194. #endif