xref: /openbmc/linux/arch/mips/include/uapi/asm/termbits.h (revision 44e0b165)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
261730c53SDavid Howells /*
361730c53SDavid Howells  * This file is subject to the terms and conditions of the GNU General Public
461730c53SDavid Howells  * License.  See the file "COPYING" in the main directory of this archive
561730c53SDavid Howells  * for more details.
661730c53SDavid Howells  *
761730c53SDavid Howells  * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
861730c53SDavid Howells  * Copyright (C) 1999 Silicon Graphics, Inc.
961730c53SDavid Howells  * Copyright (C) 2001 MIPS Technologies, Inc.
1061730c53SDavid Howells  */
1161730c53SDavid Howells #ifndef _ASM_TERMBITS_H
1261730c53SDavid Howells #define _ASM_TERMBITS_H
1361730c53SDavid Howells 
140b46ac44SIlpo Järvinen #include <asm-generic/termbits-common.h>
150b46ac44SIlpo Järvinen 
1661730c53SDavid Howells typedef unsigned int	tcflag_t;
1761730c53SDavid Howells 
1861730c53SDavid Howells /*
1961730c53SDavid Howells  * The ABI says nothing about NCC but seems to use NCCS as
2061730c53SDavid Howells  * replacement for it in struct termio
2161730c53SDavid Howells  */
2261730c53SDavid Howells #define NCCS	23
2361730c53SDavid Howells struct termios {
2461730c53SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
2561730c53SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
2661730c53SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
2761730c53SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
2861730c53SDavid Howells 	cc_t c_line;			/* line discipline */
2961730c53SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
3061730c53SDavid Howells };
3161730c53SDavid Howells 
3261730c53SDavid Howells struct termios2 {
3361730c53SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
3461730c53SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
3561730c53SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
3661730c53SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
3761730c53SDavid Howells 	cc_t c_line;			/* line discipline */
3861730c53SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
3961730c53SDavid Howells 	speed_t c_ispeed;		/* input speed */
4061730c53SDavid Howells 	speed_t c_ospeed;		/* output speed */
4161730c53SDavid Howells };
4261730c53SDavid Howells 
4361730c53SDavid Howells struct ktermios {
4461730c53SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
4561730c53SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
4661730c53SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
4761730c53SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
4861730c53SDavid Howells 	cc_t c_line;			/* line discipline */
4961730c53SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
5061730c53SDavid Howells 	speed_t c_ispeed;		/* input speed */
5161730c53SDavid Howells 	speed_t c_ospeed;		/* output speed */
5261730c53SDavid Howells };
5361730c53SDavid Howells 
5461730c53SDavid Howells /* c_cc characters */
55*c9b34088SIlpo Järvinen #define VINTR		 0		/* Interrupt character [ISIG] */
56*c9b34088SIlpo Järvinen #define VQUIT		 1		/* Quit character [ISIG] */
57*c9b34088SIlpo Järvinen #define VERASE		 2		/* Erase character [ICANON] */
58*c9b34088SIlpo Järvinen #define VKILL		 3		/* Kill-line character [ICANON] */
59*c9b34088SIlpo Järvinen #define VMIN		 4		/* Minimum number of bytes read at once [!ICANON] */
60*c9b34088SIlpo Järvinen #define VTIME		 5		/* Time-out value (tenths of a second) [!ICANON] */
61*c9b34088SIlpo Järvinen #define VEOL2		 6		/* Second EOL character [ICANON] */
6261730c53SDavid Howells #define VSWTC		 7		/* ??? */
6361730c53SDavid Howells #define VSWTCH		VSWTC
64*c9b34088SIlpo Järvinen #define VSTART		 8		/* Start (X-ON) character [IXON, IXOFF] */
65*c9b34088SIlpo Järvinen #define VSTOP		 9		/* Stop (X-OFF) character [IXON, IXOFF] */
66*c9b34088SIlpo Järvinen #define VSUSP		10		/* Suspend character [ISIG] */
6761730c53SDavid Howells #if 0
6861730c53SDavid Howells /*
6961730c53SDavid Howells  * VDSUSP is not supported
7061730c53SDavid Howells  */
71*c9b34088SIlpo Järvinen #define VDSUSP		11		/* Delayed suspend character [ISIG] */
7261730c53SDavid Howells #endif
73*c9b34088SIlpo Järvinen #define VREPRINT	12		/* Reprint-line character [ICANON] */
74*c9b34088SIlpo Järvinen #define VDISCARD	13		/* Discard character [IEXTEN] */
75*c9b34088SIlpo Järvinen #define VWERASE		14		/* Word-erase character [ICANON] */
76*c9b34088SIlpo Järvinen #define VLNEXT		15		/* Literal-next character [IEXTEN] */
77*c9b34088SIlpo Järvinen #define VEOF		16		/* End-of-file character [ICANON] */
78*c9b34088SIlpo Järvinen #define VEOL		17		/* End-of-line character [ICANON] */
7961730c53SDavid Howells 
8061730c53SDavid Howells /* c_iflag bits */
81*c9b34088SIlpo Järvinen #define IUCLC	0x0200		/* Map upper case to lower case on input */
82*c9b34088SIlpo Järvinen #define IXON	0x0400		/* Enable start/stop output control */
83*c9b34088SIlpo Järvinen #define IXOFF	0x1000		/* Enable start/stop input control */
84*c9b34088SIlpo Järvinen #define IMAXBEL	0x2000		/* Ring bell when input queue is full */
85*c9b34088SIlpo Järvinen #define IUTF8	0x4000		/* Input is UTF-8 */
8661730c53SDavid Howells 
8761730c53SDavid Howells /* c_oflag bits */
88*c9b34088SIlpo Järvinen #define OLCUC	0x00002		/* Map lower case to upper case on output */
89*c9b34088SIlpo Järvinen #define ONLCR	0x00004		/* Map NL to CR-NL on output */
906808b7f5SIlpo Järvinen #define NLDLY	0x00100
916808b7f5SIlpo Järvinen #define   NL0	0x00000
926808b7f5SIlpo Järvinen #define   NL1	0x00100
936808b7f5SIlpo Järvinen #define CRDLY	0x00600
946808b7f5SIlpo Järvinen #define   CR0	0x00000
956808b7f5SIlpo Järvinen #define   CR1	0x00200
966808b7f5SIlpo Järvinen #define   CR2	0x00400
976808b7f5SIlpo Järvinen #define   CR3	0x00600
986808b7f5SIlpo Järvinen #define TABDLY	0x01800
996808b7f5SIlpo Järvinen #define   TAB0	0x00000
1006808b7f5SIlpo Järvinen #define   TAB1	0x00800
1016808b7f5SIlpo Järvinen #define   TAB2	0x01000
1026808b7f5SIlpo Järvinen #define   TAB3	0x01800
1036808b7f5SIlpo Järvinen #define   XTABS	0x01800
1046808b7f5SIlpo Järvinen #define BSDLY	0x02000
1056808b7f5SIlpo Järvinen #define   BS0	0x00000
1066808b7f5SIlpo Järvinen #define   BS1	0x02000
1076808b7f5SIlpo Järvinen #define VTDLY	0x04000
1086808b7f5SIlpo Järvinen #define   VT0	0x00000
1096808b7f5SIlpo Järvinen #define   VT1	0x04000
1106808b7f5SIlpo Järvinen #define FFDLY	0x08000
1116808b7f5SIlpo Järvinen #define   FF0	0x00000
1126808b7f5SIlpo Järvinen #define   FF1	0x08000
11361730c53SDavid Howells /*
11461730c53SDavid Howells #define PAGEOUT ???
11561730c53SDavid Howells #define WRAP	???
11661730c53SDavid Howells  */
11761730c53SDavid Howells 
11861730c53SDavid Howells /* c_cflag bit meaning */
1196808b7f5SIlpo Järvinen #define CBAUD		0x0000100f
1206808b7f5SIlpo Järvinen #define CSIZE		0x00000030	/* Number of bits per byte (mask) */
1216808b7f5SIlpo Järvinen #define   CS5		0x00000000	/* 5 bits per byte */
1226808b7f5SIlpo Järvinen #define   CS6		0x00000010	/* 6 bits per byte */
1236808b7f5SIlpo Järvinen #define   CS7		0x00000020	/* 7 bits per byte */
1246808b7f5SIlpo Järvinen #define   CS8		0x00000030	/* 8 bits per byte */
1256808b7f5SIlpo Järvinen #define CSTOPB		0x00000040	/* Two stop bits instead of one */
1266808b7f5SIlpo Järvinen #define CREAD		0x00000080	/* Enable receiver */
1276808b7f5SIlpo Järvinen #define PARENB		0x00000100	/* Parity enable */
1286808b7f5SIlpo Järvinen #define PARODD		0x00000200	/* Odd parity instead of even */
1296808b7f5SIlpo Järvinen #define HUPCL		0x00000400	/* Hang up on last close */
1306808b7f5SIlpo Järvinen #define CLOCAL		0x00000800	/* Ignore modem status lines */
1316808b7f5SIlpo Järvinen #define CBAUDEX		0x00001000
1326808b7f5SIlpo Järvinen #define BOTHER		0x00001000
1336808b7f5SIlpo Järvinen #define     B57600	0x00001001
1346808b7f5SIlpo Järvinen #define    B115200	0x00001002
1356808b7f5SIlpo Järvinen #define    B230400	0x00001003
1366808b7f5SIlpo Järvinen #define    B460800	0x00001004
1376808b7f5SIlpo Järvinen #define    B500000	0x00001005
1386808b7f5SIlpo Järvinen #define    B576000	0x00001006
1396808b7f5SIlpo Järvinen #define    B921600	0x00001007
1406808b7f5SIlpo Järvinen #define   B1000000	0x00001008
1416808b7f5SIlpo Järvinen #define   B1152000	0x00001009
1426808b7f5SIlpo Järvinen #define   B1500000	0x0000100a
1436808b7f5SIlpo Järvinen #define   B2000000	0x0000100b
1446808b7f5SIlpo Järvinen #define   B2500000	0x0000100c
1456808b7f5SIlpo Järvinen #define   B3000000	0x0000100d
1466808b7f5SIlpo Järvinen #define   B3500000	0x0000100e
1476808b7f5SIlpo Järvinen #define   B4000000	0x0000100f
1486808b7f5SIlpo Järvinen #define CIBAUD		0x100f0000	/* input baud rate */
14961730c53SDavid Howells 
15061730c53SDavid Howells /* c_lflag bits */
151*c9b34088SIlpo Järvinen #define ISIG	0x00001		/* Enable signals */
152*c9b34088SIlpo Järvinen #define ICANON	0x00002		/* Do erase and kill processing */
1536808b7f5SIlpo Järvinen #define XCASE	0x00004
154*c9b34088SIlpo Järvinen #define ECHO	0x00008		/* Enable echo */
155*c9b34088SIlpo Järvinen #define ECHOE	0x00010		/* Visual erase for ERASE */
156*c9b34088SIlpo Järvinen #define ECHOK	0x00020		/* Echo NL after KILL */
157*c9b34088SIlpo Järvinen #define ECHONL	0x00040		/* Echo NL even if ECHO is off */
158*c9b34088SIlpo Järvinen #define NOFLSH	0x00080		/* Disable flush after interrupt */
159*c9b34088SIlpo Järvinen #define IEXTEN	0x00100		/* Enable DISCARD and LNEXT */
160*c9b34088SIlpo Järvinen #define ECHOCTL	0x00200		/* Echo control characters as ^X */
161*c9b34088SIlpo Järvinen #define ECHOPRT	0x00400		/* Hardcopy visual erase */
162*c9b34088SIlpo Järvinen #define ECHOKE	0x00800		/* Visual erase for KILL */
1636808b7f5SIlpo Järvinen #define FLUSHO	0x02000
164*c9b34088SIlpo Järvinen #define PENDIN	0x04000		/* Retype pending input (state) */
165*c9b34088SIlpo Järvinen #define TOSTOP	0x08000		/* Send SIGTTOU for background output */
16661730c53SDavid Howells #define ITOSTOP	TOSTOP
1676808b7f5SIlpo Järvinen #define EXTPROC	0x10000		/* External processing on pty */
16861730c53SDavid Howells 
16961730c53SDavid Howells /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
17061730c53SDavid Howells #define TIOCSER_TEMT	0x01	/* Transmitter physically empty */
17161730c53SDavid Howells 
17261730c53SDavid Howells /* tcsetattr uses these */
173*c9b34088SIlpo Järvinen #define TCSANOW		TCSETS	/* Change immediately */
174*c9b34088SIlpo Järvinen #define TCSADRAIN	TCSETSW /* Change when pending output is written */
175*c9b34088SIlpo Järvinen #define TCSAFLUSH	TCSETSF /* Flush pending input before changing */
17661730c53SDavid Howells 
17761730c53SDavid Howells #endif /* _ASM_TERMBITS_H */
178