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 13#include <linux/posix_types.h> 14 15typedef unsigned char cc_t; 16#if _MIPS_SZLONG == 32 17typedef unsigned long speed_t; 18typedef unsigned long tcflag_t; 19#endif 20#if _MIPS_SZLONG == 64 21typedef __u32 speed_t; 22typedef __u32 tcflag_t; 23#endif 24 25/* 26 * The ABI says nothing about NCC but seems to use NCCS as 27 * replacement for it in struct termio 28 */ 29#define NCCS 23 30struct termios { 31 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_cflag; /* control mode flags */ 34 tcflag_t c_lflag; /* local mode flags */ 35 cc_t c_line; /* line discipline */ 36 cc_t c_cc[NCCS]; /* control characters */ 37}; 38 39/* c_cc characters */ 40#define VINTR 0 /* Interrupt character [ISIG]. */ 41#define VQUIT 1 /* Quit character [ISIG]. */ 42#define VERASE 2 /* Erase character [ICANON]. */ 43#define VKILL 3 /* Kill-line character [ICANON]. */ 44#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ 45#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ 46#define VEOL2 6 /* Second EOL character [ICANON]. */ 47#define VSWTC 7 /* ??? */ 48#define VSWTCH VSWTC 49#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ 50#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ 51#define VSUSP 10 /* Suspend character [ISIG]. */ 52#define VREPRINT 12 /* Reprint-line character [ICANON]. */ 53#define VDISCARD 13 /* Discard character [IEXTEN]. */ 54#define VWERASE 14 /* Word-erase character [ICANON]. */ 55#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ 56#define VEOF 16 /* End-of-file character [ICANON]. */ 57#define VEOL 17 /* End-of-line character [ICANON]. */ 58 59/* c_iflag bits */ 60#define IGNBRK 0000001 /* Ignore break condition. */ 61#define BRKINT 0000002 /* Signal interrupt on break. */ 62#define IGNPAR 0000004 /* Ignore characters with parity errors. */ 63#define PARMRK 0000010 /* Mark parity and framing errors. */ 64#define INPCK 0000020 /* Enable input parity check. */ 65#define ISTRIP 0000040 /* Strip 8th bit off characters. */ 66#define INLCR 0000100 /* Map NL to CR on input. */ 67#define IGNCR 0000200 /* Ignore CR. */ 68#define ICRNL 0000400 /* Map CR to NL on input. */ 69#define IUCLC 0001000 /* Map upper case to lower case on input. */ 70#define IXON 0002000 /* Enable start/stop output control. */ 71#define IXANY 0004000 /* Any character will restart after stop. */ 72#define IXOFF 0010000 /* Enable start/stop input control. */ 73#define IMAXBEL 0020000 /* Ring bell when input queue is full. */ 74 75/* c_oflag bits */ 76#define OPOST 0000001 /* Perform output processing. */ 77#define OLCUC 0000002 /* Map lower case to upper case on output. */ 78#define ONLCR 0000004 /* Map NL to CR-NL on output. */ 79#define OCRNL 0000010 80#define ONOCR 0000020 81#define ONLRET 0000040 82#define OFILL 0000100 83#define OFDEL 0000200 84#define NLDLY 0000400 85#define NL0 0000000 86#define NL1 0000400 87#define CRDLY 0003000 88#define CR0 0000000 89#define CR1 0001000 90#define CR2 0002000 91#define CR3 0003000 92#define TABDLY 0014000 93#define TAB0 0000000 94#define TAB1 0004000 95#define TAB2 0010000 96#define TAB3 0014000 97#define XTABS 0014000 98#define BSDLY 0020000 99#define BS0 0000000 100#define BS1 0020000 101#define VTDLY 0040000 102#define VT0 0000000 103#define VT1 0040000 104#define FFDLY 0100000 105#define FF0 0000000 106#define FF1 0100000 107/* 108#define PAGEOUT ??? 109#define WRAP ??? 110 */ 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 163/* c_lflag bits */ 164#define ISIG 0000001 /* Enable signals. */ 165#define ICANON 0000002 /* Do erase and kill processing. */ 166#define XCASE 0000004 167#define ECHO 0000010 /* Enable echo. */ 168#define ECHOE 0000020 /* Visual erase for ERASE. */ 169#define ECHOK 0000040 /* Echo NL after KILL. */ 170#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ 171#define NOFLSH 0000200 /* Disable flush after interrupt. */ 172#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ 173#define ECHOCTL 0001000 /* Echo control characters as ^X. */ 174#define ECHOPRT 0002000 /* Hardcopy visual erase. */ 175#define ECHOKE 0004000 /* Visual erase for KILL. */ 176#define FLUSHO 0020000 177#define PENDIN 0040000 /* Retype pending input (state). */ 178#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ 179#define ITOSTOP TOSTOP 180 181/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 182#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 183 184/* tcflow() and TCXONC use these */ 185#define TCOOFF 0 /* Suspend output. */ 186#define TCOON 1 /* Restart suspended output. */ 187#define TCIOFF 2 /* Send a STOP character. */ 188#define TCION 3 /* Send a START character. */ 189 190/* tcflush() and TCFLSH use these */ 191#define TCIFLUSH 0 /* Discard data received but not yet read. */ 192#define TCOFLUSH 1 /* Discard data written but not yet sent. */ 193#define TCIOFLUSH 2 /* Discard all pending data. */ 194 195/* tcsetattr uses these */ 196#define TCSANOW TCSETS /* Change immediately. */ 197#define TCSADRAIN TCSETSW /* Change when pending output is written. */ 198#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */ 199 200#endif /* _ASM_TERMBITS_H */ 201