termbits.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 termios2 {
  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. struct ktermios {
  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. /* c_cc characters */
  38. #define VINTR 0
  39. #define VQUIT 1
  40. #define VERASE 2
  41. #define VKILL 3
  42. #define VEOF 4
  43. #define VTIME 5
  44. #define VMIN 6
  45. #define VSWTC 7
  46. #define VSTART 8
  47. #define VSTOP 9
  48. #define VSUSP 10
  49. #define VEOL 11
  50. #define VREPRINT 12
  51. #define VDISCARD 13
  52. #define VWERASE 14
  53. #define VLNEXT 15
  54. #define VEOL2 16
  55. /* c_iflag bits */
  56. #define IGNBRK 0000001
  57. #define BRKINT 0000002
  58. #define IGNPAR 0000004
  59. #define PARMRK 0000010
  60. #define INPCK 0000020
  61. #define ISTRIP 0000040
  62. #define INLCR 0000100
  63. #define IGNCR 0000200
  64. #define ICRNL 0000400
  65. #define IUCLC 0001000
  66. #define IXON 0002000
  67. #define IXANY 0004000
  68. #define IXOFF 0010000
  69. #define IMAXBEL 0020000
  70. #define IUTF8 0040000
  71. /* c_oflag bits */
  72. #define OPOST 0000001
  73. #define OLCUC 0000002
  74. #define ONLCR 0000004
  75. #define OCRNL 0000010
  76. #define ONOCR 0000020
  77. #define ONLRET 0000040
  78. #define OFILL 0000100
  79. #define OFDEL 0000200
  80. #define NLDLY 0000400
  81. #define NL0 0000000
  82. #define NL1 0000400
  83. #define CRDLY 0003000
  84. #define CR0 0000000
  85. #define CR1 0001000
  86. #define CR2 0002000
  87. #define CR3 0003000
  88. #define TABDLY 0014000
  89. #define TAB0 0000000
  90. #define TAB1 0004000
  91. #define TAB2 0010000
  92. #define TAB3 0014000
  93. #define XTABS 0014000
  94. #define BSDLY 0020000
  95. #define BS0 0000000
  96. #define BS1 0020000
  97. #define VTDLY 0040000
  98. #define VT0 0000000
  99. #define VT1 0040000
  100. #define FFDLY 0100000
  101. #define FF0 0000000
  102. #define FF1 0100000
  103. /* c_cflag bit meaning */
  104. /*
  105. * 3 2 1
  106. * 10 987 654 321 098 765 432 109 876 543 210
  107. * | | ||| CBAUD
  108. * obaud
  109. *
  110. * ||CSIZE
  111. *
  112. * |CSTOP
  113. * |CREAD
  114. * |CPARENB
  115. *
  116. * |CPARODD
  117. * |HUPCL
  118. * |CLOCAL
  119. * |CBAUDEX
  120. * 10 987 654 321 098 765 432 109 876 543 210
  121. * | || || CIBAUD, IBSHIFT=16
  122. * ibaud
  123. * |CMSPAR
  124. * | CRTSCTS
  125. * x x xxx xxx x x xx Free bits
  126. */
  127. #define CBAUD 0010017
  128. #define B0 0000000 /* hang up */
  129. #define B50 0000001
  130. #define B75 0000002
  131. #define B110 0000003
  132. #define B134 0000004
  133. #define B150 0000005
  134. #define B200 0000006
  135. #define B300 0000007
  136. #define B600 0000010
  137. #define B1200 0000011
  138. #define B1800 0000012
  139. #define B2400 0000013
  140. #define B4800 0000014
  141. #define B9600 0000015
  142. #define B19200 0000016
  143. #define B38400 0000017
  144. #define EXTA B19200
  145. #define EXTB B38400
  146. #define CSIZE 0000060
  147. #define CS5 0000000
  148. #define CS6 0000020
  149. #define CS7 0000040
  150. #define CS8 0000060
  151. #define CSTOPB 0000100
  152. #define CREAD 0000200
  153. #define PARENB 0000400
  154. #define PARODD 0001000
  155. #define HUPCL 0002000
  156. #define CLOCAL 0004000
  157. #define CBAUDEX 0010000
  158. #define BOTHER 0010000
  159. #define B57600 0010001
  160. #define B115200 0010002
  161. #define B230400 0010003
  162. #define B460800 0010004
  163. /* Unsupported rates, but needed to avoid compile error. */
  164. #define B500000 0010005
  165. #define B576000 0010006
  166. #define B1000000 0010010
  167. #define B1152000 0010011
  168. #define B1500000 0010012
  169. #define B2000000 0010013
  170. #define B2500000 0010014
  171. #define B3000000 0010015
  172. #define B3500000 0010016
  173. #define B4000000 0010017
  174. /* etrax supports these additional three baud rates */
  175. #define B921600 0010005
  176. #define B1843200 0010006
  177. #define B6250000 0010007
  178. /* ETRAX FS supports this as well */
  179. #define B12500000 0010010
  180. #define CIBAUD 002003600000 /* input baud rate (used in v32) */
  181. /* The values for CIBAUD bits are the same as the values for CBAUD and CBAUDEX
  182. * shifted left IBSHIFT bits.
  183. */
  184. #define IBSHIFT 16
  185. #define CMSPAR 010000000000 /* mark or space (stick) parity - PARODD=space*/
  186. #define CRTSCTS 020000000000 /* flow control */
  187. /* c_lflag bits */
  188. #define ISIG 0000001
  189. #define ICANON 0000002
  190. #define XCASE 0000004
  191. #define ECHO 0000010
  192. #define ECHOE 0000020
  193. #define ECHOK 0000040
  194. #define ECHONL 0000100
  195. #define NOFLSH 0000200
  196. #define TOSTOP 0000400
  197. #define ECHOCTL 0001000
  198. #define ECHOPRT 0002000
  199. #define ECHOKE 0004000
  200. #define FLUSHO 0010000
  201. #define PENDIN 0040000
  202. #define IEXTEN 0100000
  203. #define EXTPROC 0200000
  204. /* tcflow() and TCXONC use these */
  205. #define TCOOFF 0
  206. #define TCOON 1
  207. #define TCIOFF 2
  208. #define TCION 3
  209. /* tcflush() and TCFLSH use these */
  210. #define TCIFLUSH 0
  211. #define TCOFLUSH 1
  212. #define TCIOFLUSH 2
  213. /* tcsetattr uses these */
  214. #define TCSANOW 0
  215. #define TCSADRAIN 1
  216. #define TCSAFLUSH 2
  217. #endif