termbits.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1995, 1996, 1999, 2001 Ralf Baechle
  7. * Copyright (C) 1999 Silicon Graphics, Inc.
  8. * Copyright (C) 2001 MIPS Technologies, Inc.
  9. */
  10. #ifndef _ASM_TERMBITS_H
  11. #define _ASM_TERMBITS_H
  12. #include <linux/posix_types.h>
  13. typedef unsigned char cc_t;
  14. #if (_MIPS_SZLONG == 32)
  15. typedef unsigned long speed_t;
  16. typedef unsigned long tcflag_t;
  17. #endif
  18. #if (_MIPS_SZLONG == 64)
  19. typedef __u32 speed_t;
  20. typedef __u32 tcflag_t;
  21. #endif
  22. /*
  23. * The ABI says nothing about NCC but seems to use NCCS as
  24. * replacement for it in struct termio
  25. */
  26. #define NCCS 23
  27. struct termios {
  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. };
  35. /* c_cc characters */
  36. #define VINTR 0 /* Interrupt character [ISIG]. */
  37. #define VQUIT 1 /* Quit character [ISIG]. */
  38. #define VERASE 2 /* Erase character [ICANON]. */
  39. #define VKILL 3 /* Kill-line character [ICANON]. */
  40. #define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
  41. #define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
  42. #define VEOL2 6 /* Second EOL character [ICANON]. */
  43. #define VSWTC 7 /* ??? */
  44. #define VSWTCH VSWTC
  45. #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
  46. #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
  47. #define VSUSP 10 /* Suspend character [ISIG]. */
  48. #if 0
  49. /*
  50. * VDSUSP is not supported
  51. */
  52. #define VDSUSP 11 /* Delayed suspend character [ISIG]. */
  53. #endif
  54. #define VREPRINT 12 /* Reprint-line character [ICANON]. */
  55. #define VDISCARD 13 /* Discard character [IEXTEN]. */
  56. #define VWERASE 14 /* Word-erase character [ICANON]. */
  57. #define VLNEXT 15 /* Literal-next character [IEXTEN]. */
  58. #define VEOF 16 /* End-of-file character [ICANON]. */
  59. #define VEOL 17 /* End-of-line character [ICANON]. */
  60. /* c_iflag bits */
  61. #define IGNBRK 0000001 /* Ignore break condition. */
  62. #define BRKINT 0000002 /* Signal interrupt on break. */
  63. #define IGNPAR 0000004 /* Ignore characters with parity errors. */
  64. #define PARMRK 0000010 /* Mark parity and framing errors. */
  65. #define INPCK 0000020 /* Enable input parity check. */
  66. #define ISTRIP 0000040 /* Strip 8th bit off characters. */
  67. #define INLCR 0000100 /* Map NL to CR on input. */
  68. #define IGNCR 0000200 /* Ignore CR. */
  69. #define ICRNL 0000400 /* Map CR to NL on input. */
  70. #define IUCLC 0001000 /* Map upper case to lower case on input. */
  71. #define IXON 0002000 /* Enable start/stop output control. */
  72. #define IXANY 0004000 /* Any character will restart after stop. */
  73. #define IXOFF 0010000 /* Enable start/stop input control. */
  74. #define IMAXBEL 0020000 /* Ring bell when input queue is full. */
  75. #define IUTF8 0040000 /* Input is UTF8 */
  76. /* c_oflag bits */
  77. #define OPOST 0000001 /* Perform output processing. */
  78. #define OLCUC 0000002 /* Map lower case to upper case on output. */
  79. #define ONLCR 0000004 /* Map NL to CR-NL on output. */
  80. #define OCRNL 0000010
  81. #define ONOCR 0000020
  82. #define ONLRET 0000040
  83. #define OFILL 0000100
  84. #define OFDEL 0000200
  85. #define NLDLY 0000400
  86. #define NL0 0000000
  87. #define NL1 0000400
  88. #define CRDLY 0003000
  89. #define CR0 0000000
  90. #define CR1 0001000
  91. #define CR2 0002000
  92. #define CR3 0003000
  93. #define TABDLY 0014000
  94. #define TAB0 0000000
  95. #define TAB1 0004000
  96. #define TAB2 0010000
  97. #define TAB3 0014000
  98. #define XTABS 0014000
  99. #define BSDLY 0020000
  100. #define BS0 0000000
  101. #define BS1 0020000
  102. #define VTDLY 0040000
  103. #define VT0 0000000
  104. #define VT1 0040000
  105. #define FFDLY 0100000
  106. #define FF0 0000000
  107. #define FF1 0100000
  108. /*
  109. #define PAGEOUT ???
  110. #define WRAP ???
  111. */
  112. /* c_cflag bit meaning */
  113. #define CBAUD 0010017
  114. #define B0 0000000 /* hang up */
  115. #define B50 0000001
  116. #define B75 0000002
  117. #define B110 0000003
  118. #define B134 0000004
  119. #define B150 0000005
  120. #define B200 0000006
  121. #define B300 0000007
  122. #define B600 0000010
  123. #define B1200 0000011
  124. #define B1800 0000012
  125. #define B2400 0000013
  126. #define B4800 0000014
  127. #define B9600 0000015
  128. #define B19200 0000016
  129. #define B38400 0000017
  130. #define EXTA B19200
  131. #define EXTB B38400
  132. #define CSIZE 0000060 /* Number of bits per byte (mask). */
  133. #define CS5 0000000 /* 5 bits per byte. */
  134. #define CS6 0000020 /* 6 bits per byte. */
  135. #define CS7 0000040 /* 7 bits per byte. */
  136. #define CS8 0000060 /* 8 bits per byte. */
  137. #define CSTOPB 0000100 /* Two stop bits instead of one. */
  138. #define CREAD 0000200 /* Enable receiver. */
  139. #define PARENB 0000400 /* Parity enable. */
  140. #define PARODD 0001000 /* Odd parity instead of even. */
  141. #define HUPCL 0002000 /* Hang up on last close. */
  142. #define CLOCAL 0004000 /* Ignore modem status lines. */
  143. #define CBAUDEX 0010000
  144. #define B57600 0010001
  145. #define B115200 0010002
  146. #define B230400 0010003
  147. #define B460800 0010004
  148. #define B500000 0010005
  149. #define B576000 0010006
  150. #define B921600 0010007
  151. #define B1000000 0010010
  152. #define B1152000 0010011
  153. #define B1500000 0010012
  154. #define B2000000 0010013
  155. #define B2500000 0010014
  156. #define B3000000 0010015
  157. #define B3500000 0010016
  158. #define B4000000 0010017
  159. #define CIBAUD 002003600000 /* input baud rate (not used) */
  160. #define CMSPAR 010000000000 /* mark or space (stick) parity */
  161. #define CRTSCTS 020000000000 /* flow control */
  162. /* c_lflag bits */
  163. #define ISIG 0000001 /* Enable signals. */
  164. #define ICANON 0000002 /* Do erase and kill processing. */
  165. #define XCASE 0000004
  166. #define ECHO 0000010 /* Enable echo. */
  167. #define ECHOE 0000020 /* Visual erase for ERASE. */
  168. #define ECHOK 0000040 /* Echo NL after KILL. */
  169. #define ECHONL 0000100 /* Echo NL even if ECHO is off. */
  170. #define NOFLSH 0000200 /* Disable flush after interrupt. */
  171. #define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
  172. #define ECHOCTL 0001000 /* Echo control characters as ^X. */
  173. #define ECHOPRT 0002000 /* Hardcopy visual erase. */
  174. #define ECHOKE 0004000 /* Visual erase for KILL. */
  175. #define FLUSHO 0020000
  176. #define PENDIN 0040000 /* Retype pending input (state). */
  177. #define TOSTOP 0100000 /* Send SIGTTOU for background output. */
  178. #define ITOSTOP TOSTOP
  179. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  180. #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  181. /* tcflow() and TCXONC use these */
  182. #define TCOOFF 0 /* Suspend output. */
  183. #define TCOON 1 /* Restart suspended output. */
  184. #define TCIOFF 2 /* Send a STOP character. */
  185. #define TCION 3 /* Send a START character. */
  186. /* tcflush() and TCFLSH use these */
  187. #define TCIFLUSH 0 /* Discard data received but not yet read. */
  188. #define TCOFLUSH 1 /* Discard data written but not yet sent. */
  189. #define TCIOFLUSH 2 /* Discard all pending data. */
  190. /* tcsetattr uses these */
  191. #define TCSANOW TCSETS /* Change immediately. */
  192. #define TCSADRAIN TCSETSW /* Change when pending output is written. */
  193. #define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
  194. #endif /* _ASM_TERMBITS_H */