root/include/asm-i386/termios.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. trans_from_termio
  2. trans_to_termio

   1 #ifndef _I386_TERMIOS_H
   2 #define _I386_TERMIOS_H
   3 
   4 /* 0x54 is just a magic number to make these relatively unique ('T') */
   5 
   6 #define TCGETS          0x5401
   7 #define TCSETS          0x5402
   8 #define TCSETSW         0x5403
   9 #define TCSETSF         0x5404
  10 #define TCGETA          0x5405
  11 #define TCSETA          0x5406
  12 #define TCSETAW         0x5407
  13 #define TCSETAF         0x5408
  14 #define TCSBRK          0x5409
  15 #define TCXONC          0x540A
  16 #define TCFLSH          0x540B
  17 #define TIOCEXCL        0x540C
  18 #define TIOCNXCL        0x540D
  19 #define TIOCSCTTY       0x540E
  20 #define TIOCGPGRP       0x540F
  21 #define TIOCSPGRP       0x5410
  22 #define TIOCOUTQ        0x5411
  23 #define TIOCSTI         0x5412
  24 #define TIOCGWINSZ      0x5413
  25 #define TIOCSWINSZ      0x5414
  26 #define TIOCMGET        0x5415
  27 #define TIOCMBIS        0x5416
  28 #define TIOCMBIC        0x5417
  29 #define TIOCMSET        0x5418
  30 #define TIOCGSOFTCAR    0x5419
  31 #define TIOCSSOFTCAR    0x541A
  32 #define FIONREAD        0x541B
  33 #define TIOCINQ         FIONREAD
  34 #define TIOCLINUX       0x541C
  35 #define TIOCCONS        0x541D
  36 #define TIOCGSERIAL     0x541E
  37 #define TIOCSSERIAL     0x541F
  38 #define TIOCPKT         0x5420
  39 #define FIONBIO         0x5421
  40 #define TIOCNOTTY       0x5422
  41 #define TIOCSETD        0x5423
  42 #define TIOCGETD        0x5424
  43 #define TCSBRKP         0x5425  /* Needed for POSIX tcsendbreak() */
  44 #define TIOCTTYGSTRUCT  0x5426  /* For debugging only */
  45 #define FIONCLEX        0x5450  /* these numbers need to be adjusted. */
  46 #define FIOCLEX         0x5451
  47 #define FIOASYNC        0x5452
  48 #define TIOCSERCONFIG   0x5453
  49 #define TIOCSERGWILD    0x5454
  50 #define TIOCSERSWILD    0x5455
  51 #define TIOCGLCKTRMIOS  0x5456
  52 #define TIOCSLCKTRMIOS  0x5457
  53 #define TIOCSERGSTRUCT  0x5458 /* For debugging only */
  54 #define TIOCSERGETLSR   0x5459 /* Get line status register */
  55 #define TIOCSERGETMULTI 0x545A /* Get multiport config  */
  56 #define TIOCSERSETMULTI 0x545B /* Set multiport config */
  57 
  58 #define TIOCMIWAIT      0x545C  /* wait for a change on serial input line(s) */
  59 #define TIOCGICOUNT     0x545D  /* read serial port inline interrupt counts */
  60 
  61 /* Used for packet mode */
  62 #define TIOCPKT_DATA             0
  63 #define TIOCPKT_FLUSHREAD        1
  64 #define TIOCPKT_FLUSHWRITE       2
  65 #define TIOCPKT_STOP             4
  66 #define TIOCPKT_START            8
  67 #define TIOCPKT_NOSTOP          16
  68 #define TIOCPKT_DOSTOP          32
  69 
  70 struct winsize {
  71         unsigned short ws_row;
  72         unsigned short ws_col;
  73         unsigned short ws_xpixel;
  74         unsigned short ws_ypixel;
  75 };
  76 
  77 #define NCC 8
  78 struct termio {
  79         unsigned short c_iflag;         /* input mode flags */
  80         unsigned short c_oflag;         /* output mode flags */
  81         unsigned short c_cflag;         /* control mode flags */
  82         unsigned short c_lflag;         /* local mode flags */
  83         unsigned char c_line;           /* line discipline */
  84         unsigned char c_cc[NCC];        /* control characters */
  85 };
  86 
  87 #define NCCS 19
  88 struct termios {
  89         tcflag_t c_iflag;               /* input mode flags */
  90         tcflag_t c_oflag;               /* output mode flags */
  91         tcflag_t c_cflag;               /* control mode flags */
  92         tcflag_t c_lflag;               /* local mode flags */
  93         cc_t c_line;                    /* line discipline */
  94         cc_t c_cc[NCCS];                /* control characters */
  95 };
  96 
  97 /* c_cc characters */
  98 #define VINTR 0
  99 #define VQUIT 1
 100 #define VERASE 2
 101 #define VKILL 3
 102 #define VEOF 4
 103 #define VTIME 5
 104 #define VMIN 6
 105 #define VSWTC 7
 106 #define VSTART 8
 107 #define VSTOP 9
 108 #define VSUSP 10
 109 #define VEOL 11
 110 #define VREPRINT 12
 111 #define VDISCARD 13
 112 #define VWERASE 14
 113 #define VLNEXT 15
 114 #define VEOL2 16
 115 
 116 #ifdef __KERNEL__
 117 /*      intr=^C         quit=^\         erase=del       kill=^U
 118         eof=^D          vtime=\0        vmin=\1         sxtc=\0
 119         start=^Q        stop=^S         susp=^Z         eol=\0
 120         reprint=^R      discard=^U      werase=^W       lnext=^V
 121         eol2=\0
 122 */
 123 #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
 124 #endif
 125 
 126 /* c_iflag bits */
 127 #define IGNBRK  0000001
 128 #define BRKINT  0000002
 129 #define IGNPAR  0000004
 130 #define PARMRK  0000010
 131 #define INPCK   0000020
 132 #define ISTRIP  0000040
 133 #define INLCR   0000100
 134 #define IGNCR   0000200
 135 #define ICRNL   0000400
 136 #define IUCLC   0001000
 137 #define IXON    0002000
 138 #define IXANY   0004000
 139 #define IXOFF   0010000
 140 #define IMAXBEL 0020000
 141 
 142 /* c_oflag bits */
 143 #define OPOST   0000001
 144 #define OLCUC   0000002
 145 #define ONLCR   0000004
 146 #define OCRNL   0000010
 147 #define ONOCR   0000020
 148 #define ONLRET  0000040
 149 #define OFILL   0000100
 150 #define OFDEL   0000200
 151 #define NLDLY   0000400
 152 #define   NL0   0000000
 153 #define   NL1   0000400
 154 #define CRDLY   0003000
 155 #define   CR0   0000000
 156 #define   CR1   0001000
 157 #define   CR2   0002000
 158 #define   CR3   0003000
 159 #define TABDLY  0014000
 160 #define   TAB0  0000000
 161 #define   TAB1  0004000
 162 #define   TAB2  0010000
 163 #define   TAB3  0014000
 164 #define   XTABS 0014000
 165 #define BSDLY   0020000
 166 #define   BS0   0000000
 167 #define   BS1   0020000
 168 #define VTDLY   0040000
 169 #define   VT0   0000000
 170 #define   VT1   0040000
 171 #define FFDLY   0100000
 172 #define   FF0   0000000
 173 #define   FF1   0100000
 174 
 175 /* c_cflag bit meaning */
 176 #define CBAUD   0010017
 177 #define  B0     0000000         /* hang up */
 178 #define  B50    0000001
 179 #define  B75    0000002
 180 #define  B110   0000003
 181 #define  B134   0000004
 182 #define  B150   0000005
 183 #define  B200   0000006
 184 #define  B300   0000007
 185 #define  B600   0000010
 186 #define  B1200  0000011
 187 #define  B1800  0000012
 188 #define  B2400  0000013
 189 #define  B4800  0000014
 190 #define  B9600  0000015
 191 #define  B19200 0000016
 192 #define  B38400 0000017
 193 #define EXTA B19200
 194 #define EXTB B38400
 195 #define CSIZE   0000060
 196 #define   CS5   0000000
 197 #define   CS6   0000020
 198 #define   CS7   0000040
 199 #define   CS8   0000060
 200 #define CSTOPB  0000100
 201 #define CREAD   0000200
 202 #define PARENB  0000400
 203 #define PARODD  0001000
 204 #define HUPCL   0002000
 205 #define CLOCAL  0004000
 206 #define CBAUDEX 0010000
 207 #define  B57600  0010001
 208 #define  B115200 0010002
 209 #define  B230400 0010003
 210 #define CIBAUD    002003600000  /* input baud rate (not used) */
 211 #define CRTSCTS   020000000000          /* flow control */
 212 
 213 /* c_lflag bits */
 214 #define ISIG    0000001
 215 #define ICANON  0000002
 216 #define XCASE   0000004
 217 #define ECHO    0000010
 218 #define ECHOE   0000020
 219 #define ECHOK   0000040
 220 #define ECHONL  0000100
 221 #define NOFLSH  0000200
 222 #define TOSTOP  0000400
 223 #define ECHOCTL 0001000
 224 #define ECHOPRT 0002000
 225 #define ECHOKE  0004000
 226 #define FLUSHO  0010000
 227 #define PENDIN  0040000
 228 #define IEXTEN  0100000
 229 
 230 /* modem lines */
 231 #define TIOCM_LE        0x001
 232 #define TIOCM_DTR       0x002
 233 #define TIOCM_RTS       0x004
 234 #define TIOCM_ST        0x008
 235 #define TIOCM_SR        0x010
 236 #define TIOCM_CTS       0x020
 237 #define TIOCM_CAR       0x040
 238 #define TIOCM_RNG       0x080
 239 #define TIOCM_DSR       0x100
 240 #define TIOCM_CD        TIOCM_CAR
 241 #define TIOCM_RI        TIOCM_RNG
 242 
 243 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
 244 #define TIOCSER_TEMT    0x01    /* Transmitter physically empty */
 245 
 246 
 247 /* tcflow() and TCXONC use these */
 248 #define TCOOFF          0
 249 #define TCOON           1
 250 #define TCIOFF          2
 251 #define TCION           3
 252 
 253 /* tcflush() and TCFLSH use these */
 254 #define TCIFLUSH        0
 255 #define TCOFLUSH        1
 256 #define TCIOFLUSH       2
 257 
 258 /* tcsetattr uses these */
 259 #define TCSANOW         0
 260 #define TCSADRAIN       1
 261 #define TCSAFLUSH       2
 262 
 263 /* line disciplines */
 264 #define N_TTY           0
 265 #define N_SLIP          1
 266 #define N_MOUSE         2
 267 #define N_PPP           3
 268 
 269 #ifdef __KERNEL__
 270 
 271 #include <linux/string.h>
 272 
 273 /*
 274  * Translate a "termio" structure into a "termios". Ugh.
 275  */
 276 extern inline void trans_from_termio(struct termio * termio,
     /* [previous][next][first][last][top][bottom][index][help] */
 277         struct termios * termios)
 278 {
 279 #define SET_LOW_BITS(x,y)       ((x) = (0xffff0000 & (x)) | (y))
 280         SET_LOW_BITS(termios->c_iflag, termio->c_iflag);
 281         SET_LOW_BITS(termios->c_oflag, termio->c_oflag);
 282         SET_LOW_BITS(termios->c_cflag, termio->c_cflag);
 283         SET_LOW_BITS(termios->c_lflag, termio->c_lflag);
 284 #undef SET_LOW_BITS
 285         memcpy(termios->c_cc, termio->c_cc, NCC);
 286 }
 287 
 288 /*
 289  * Translate a "termios" structure into a "termio". Ugh.
 290  */
 291 extern inline void trans_to_termio(struct termios * termios,
     /* [previous][next][first][last][top][bottom][index][help] */
 292         struct termio * termio)
 293 {
 294         termio->c_iflag = termios->c_iflag;
 295         termio->c_oflag = termios->c_oflag;
 296         termio->c_cflag = termios->c_cflag;
 297         termio->c_lflag = termios->c_lflag;
 298         termio->c_line  = termios->c_line;
 299         memcpy(termio->c_cc, termios->c_cc, NCC);
 300 }
 301 
 302 #endif  /* __KERNEL__ */
 303 
 304 #endif  /* _I386_TERMIOS_H */

/* [previous][next][first][last][top][bottom][index][help] */