termbits.h 4.6 KB

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