16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28a1ab315SDavid Howells #ifndef __ASM_GENERIC_TERMBITS_H
38a1ab315SDavid Howells #define __ASM_GENERIC_TERMBITS_H
48a1ab315SDavid Howells 
50b46ac44SIlpo Järvinen #include <asm-generic/termbits-common.h>
60b46ac44SIlpo Järvinen 
78a1ab315SDavid Howells typedef unsigned int	tcflag_t;
88a1ab315SDavid Howells 
98a1ab315SDavid Howells #define NCCS 19
108a1ab315SDavid Howells struct termios {
118a1ab315SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
128a1ab315SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
138a1ab315SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
148a1ab315SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
158a1ab315SDavid Howells 	cc_t c_line;			/* line discipline */
168a1ab315SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
178a1ab315SDavid Howells };
188a1ab315SDavid Howells 
198a1ab315SDavid Howells struct termios2 {
208a1ab315SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
218a1ab315SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
228a1ab315SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
238a1ab315SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
248a1ab315SDavid Howells 	cc_t c_line;			/* line discipline */
258a1ab315SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
268a1ab315SDavid Howells 	speed_t c_ispeed;		/* input speed */
278a1ab315SDavid Howells 	speed_t c_ospeed;		/* output speed */
288a1ab315SDavid Howells };
298a1ab315SDavid Howells 
308a1ab315SDavid Howells struct ktermios {
318a1ab315SDavid Howells 	tcflag_t c_iflag;		/* input mode flags */
328a1ab315SDavid Howells 	tcflag_t c_oflag;		/* output mode flags */
338a1ab315SDavid Howells 	tcflag_t c_cflag;		/* control mode flags */
348a1ab315SDavid Howells 	tcflag_t c_lflag;		/* local mode flags */
358a1ab315SDavid Howells 	cc_t c_line;			/* line discipline */
368a1ab315SDavid Howells 	cc_t c_cc[NCCS];		/* control characters */
378a1ab315SDavid Howells 	speed_t c_ispeed;		/* input speed */
388a1ab315SDavid Howells 	speed_t c_ospeed;		/* output speed */
398a1ab315SDavid Howells };
408a1ab315SDavid Howells 
418a1ab315SDavid Howells /* c_cc characters */
428a1ab315SDavid Howells #define VINTR		 0
438a1ab315SDavid Howells #define VQUIT		 1
448a1ab315SDavid Howells #define VERASE		 2
458a1ab315SDavid Howells #define VKILL		 3
468a1ab315SDavid Howells #define VEOF		 4
478a1ab315SDavid Howells #define VTIME		 5
488a1ab315SDavid Howells #define VMIN		 6
498a1ab315SDavid Howells #define VSWTC		 7
508a1ab315SDavid Howells #define VSTART		 8
518a1ab315SDavid Howells #define VSTOP		 9
528a1ab315SDavid Howells #define VSUSP		10
538a1ab315SDavid Howells #define VEOL		11
548a1ab315SDavid Howells #define VREPRINT	12
558a1ab315SDavid Howells #define VDISCARD	13
568a1ab315SDavid Howells #define VWERASE		14
578a1ab315SDavid Howells #define VLNEXT		15
588a1ab315SDavid Howells #define VEOL2		16
598a1ab315SDavid Howells 
608a1ab315SDavid Howells /* c_iflag bits */
61*c9b34088SIlpo Järvinen #define IUCLC	0x0200
62*c9b34088SIlpo Järvinen #define IXON	0x0400
63*c9b34088SIlpo Järvinen #define IXOFF	0x1000
64*c9b34088SIlpo Järvinen #define IMAXBEL	0x2000
65*c9b34088SIlpo Järvinen #define IUTF8	0x4000
668a1ab315SDavid Howells 
678a1ab315SDavid Howells /* c_oflag bits */
686808b7f5SIlpo Järvinen #define OLCUC	0x00002
696808b7f5SIlpo Järvinen #define ONLCR	0x00004
706808b7f5SIlpo Järvinen #define NLDLY	0x00100
716808b7f5SIlpo Järvinen #define   NL0	0x00000
726808b7f5SIlpo Järvinen #define   NL1	0x00100
736808b7f5SIlpo Järvinen #define CRDLY	0x00600
746808b7f5SIlpo Järvinen #define   CR0	0x00000
756808b7f5SIlpo Järvinen #define   CR1	0x00200
766808b7f5SIlpo Järvinen #define   CR2	0x00400
776808b7f5SIlpo Järvinen #define   CR3	0x00600
786808b7f5SIlpo Järvinen #define TABDLY	0x01800
796808b7f5SIlpo Järvinen #define   TAB0	0x00000
806808b7f5SIlpo Järvinen #define   TAB1	0x00800
816808b7f5SIlpo Järvinen #define   TAB2	0x01000
826808b7f5SIlpo Järvinen #define   TAB3	0x01800
836808b7f5SIlpo Järvinen #define   XTABS	0x01800
846808b7f5SIlpo Järvinen #define BSDLY	0x02000
856808b7f5SIlpo Järvinen #define   BS0	0x00000
866808b7f5SIlpo Järvinen #define   BS1	0x02000
876808b7f5SIlpo Järvinen #define VTDLY	0x04000
886808b7f5SIlpo Järvinen #define   VT0	0x00000
896808b7f5SIlpo Järvinen #define   VT1	0x04000
906808b7f5SIlpo Järvinen #define FFDLY	0x08000
916808b7f5SIlpo Järvinen #define   FF0	0x00000
926808b7f5SIlpo Järvinen #define   FF1	0x08000
938a1ab315SDavid Howells 
948a1ab315SDavid Howells /* c_cflag bit meaning */
956808b7f5SIlpo Järvinen #define CBAUD		0x0000100f
966808b7f5SIlpo Järvinen #define CSIZE		0x00000030
976808b7f5SIlpo Järvinen #define   CS5		0x00000000
986808b7f5SIlpo Järvinen #define   CS6		0x00000010
996808b7f5SIlpo Järvinen #define   CS7		0x00000020
1006808b7f5SIlpo Järvinen #define   CS8		0x00000030
1016808b7f5SIlpo Järvinen #define CSTOPB		0x00000040
1026808b7f5SIlpo Järvinen #define CREAD		0x00000080
1036808b7f5SIlpo Järvinen #define PARENB		0x00000100
1046808b7f5SIlpo Järvinen #define PARODD		0x00000200
1056808b7f5SIlpo Järvinen #define HUPCL		0x00000400
1066808b7f5SIlpo Järvinen #define CLOCAL		0x00000800
1076808b7f5SIlpo Järvinen #define CBAUDEX		0x00001000
1086808b7f5SIlpo Järvinen #define BOTHER		0x00001000
1096808b7f5SIlpo Järvinen #define     B57600	0x00001001
1106808b7f5SIlpo Järvinen #define    B115200	0x00001002
1116808b7f5SIlpo Järvinen #define    B230400	0x00001003
1126808b7f5SIlpo Järvinen #define    B460800	0x00001004
1136808b7f5SIlpo Järvinen #define    B500000	0x00001005
1146808b7f5SIlpo Järvinen #define    B576000	0x00001006
1156808b7f5SIlpo Järvinen #define    B921600	0x00001007
1166808b7f5SIlpo Järvinen #define   B1000000	0x00001008
1176808b7f5SIlpo Järvinen #define   B1152000	0x00001009
1186808b7f5SIlpo Järvinen #define   B1500000	0x0000100a
1196808b7f5SIlpo Järvinen #define   B2000000	0x0000100b
1206808b7f5SIlpo Järvinen #define   B2500000	0x0000100c
1216808b7f5SIlpo Järvinen #define   B3000000	0x0000100d
1226808b7f5SIlpo Järvinen #define   B3500000	0x0000100e
1236808b7f5SIlpo Järvinen #define   B4000000	0x0000100f
1246808b7f5SIlpo Järvinen #define CIBAUD		0x100f0000	/* input baud rate */
1258a1ab315SDavid Howells 
1268a1ab315SDavid Howells /* c_lflag bits */
1276808b7f5SIlpo Järvinen #define ISIG	0x00001
1286808b7f5SIlpo Järvinen #define ICANON	0x00002
1296808b7f5SIlpo Järvinen #define XCASE	0x00004
1306808b7f5SIlpo Järvinen #define ECHO	0x00008
1316808b7f5SIlpo Järvinen #define ECHOE	0x00010
1326808b7f5SIlpo Järvinen #define ECHOK	0x00020
1336808b7f5SIlpo Järvinen #define ECHONL	0x00040
1346808b7f5SIlpo Järvinen #define NOFLSH	0x00080
1356808b7f5SIlpo Järvinen #define TOSTOP	0x00100
1366808b7f5SIlpo Järvinen #define ECHOCTL	0x00200
1376808b7f5SIlpo Järvinen #define ECHOPRT	0x00400
1386808b7f5SIlpo Järvinen #define ECHOKE	0x00800
1396808b7f5SIlpo Järvinen #define FLUSHO	0x01000
1406808b7f5SIlpo Järvinen #define PENDIN	0x04000
1416808b7f5SIlpo Järvinen #define IEXTEN	0x08000
1426808b7f5SIlpo Järvinen #define EXTPROC	0x10000
1438a1ab315SDavid Howells 
1448a1ab315SDavid Howells /* tcsetattr uses these */
1458a1ab315SDavid Howells #define	TCSANOW		0
1468a1ab315SDavid Howells #define	TCSADRAIN	1
1478a1ab315SDavid Howells #define	TCSAFLUSH	2
1488a1ab315SDavid Howells 
1498a1ab315SDavid Howells #endif /* __ASM_GENERIC_TERMBITS_H */
150