18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_GENERIC_TERMBITS_H 38c2ecf20Sopenharmony_ci#define __ASM_GENERIC_TERMBITS_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <linux/posix_types.h> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_citypedef unsigned char cc_t; 88c2ecf20Sopenharmony_citypedef unsigned int speed_t; 98c2ecf20Sopenharmony_citypedef unsigned int tcflag_t; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define NCCS 19 128c2ecf20Sopenharmony_cistruct termios { 138c2ecf20Sopenharmony_ci tcflag_t c_iflag; /* input mode flags */ 148c2ecf20Sopenharmony_ci tcflag_t c_oflag; /* output mode flags */ 158c2ecf20Sopenharmony_ci tcflag_t c_cflag; /* control mode flags */ 168c2ecf20Sopenharmony_ci tcflag_t c_lflag; /* local mode flags */ 178c2ecf20Sopenharmony_ci cc_t c_line; /* line discipline */ 188c2ecf20Sopenharmony_ci cc_t c_cc[NCCS]; /* control characters */ 198c2ecf20Sopenharmony_ci}; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_cistruct termios2 { 228c2ecf20Sopenharmony_ci tcflag_t c_iflag; /* input mode flags */ 238c2ecf20Sopenharmony_ci tcflag_t c_oflag; /* output mode flags */ 248c2ecf20Sopenharmony_ci tcflag_t c_cflag; /* control mode flags */ 258c2ecf20Sopenharmony_ci tcflag_t c_lflag; /* local mode flags */ 268c2ecf20Sopenharmony_ci cc_t c_line; /* line discipline */ 278c2ecf20Sopenharmony_ci cc_t c_cc[NCCS]; /* control characters */ 288c2ecf20Sopenharmony_ci speed_t c_ispeed; /* input speed */ 298c2ecf20Sopenharmony_ci speed_t c_ospeed; /* output speed */ 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistruct ktermios { 338c2ecf20Sopenharmony_ci tcflag_t c_iflag; /* input mode flags */ 348c2ecf20Sopenharmony_ci tcflag_t c_oflag; /* output mode flags */ 358c2ecf20Sopenharmony_ci tcflag_t c_cflag; /* control mode flags */ 368c2ecf20Sopenharmony_ci tcflag_t c_lflag; /* local mode flags */ 378c2ecf20Sopenharmony_ci cc_t c_line; /* line discipline */ 388c2ecf20Sopenharmony_ci cc_t c_cc[NCCS]; /* control characters */ 398c2ecf20Sopenharmony_ci speed_t c_ispeed; /* input speed */ 408c2ecf20Sopenharmony_ci speed_t c_ospeed; /* output speed */ 418c2ecf20Sopenharmony_ci}; 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* c_cc characters */ 448c2ecf20Sopenharmony_ci#define VINTR 0 458c2ecf20Sopenharmony_ci#define VQUIT 1 468c2ecf20Sopenharmony_ci#define VERASE 2 478c2ecf20Sopenharmony_ci#define VKILL 3 488c2ecf20Sopenharmony_ci#define VEOF 4 498c2ecf20Sopenharmony_ci#define VTIME 5 508c2ecf20Sopenharmony_ci#define VMIN 6 518c2ecf20Sopenharmony_ci#define VSWTC 7 528c2ecf20Sopenharmony_ci#define VSTART 8 538c2ecf20Sopenharmony_ci#define VSTOP 9 548c2ecf20Sopenharmony_ci#define VSUSP 10 558c2ecf20Sopenharmony_ci#define VEOL 11 568c2ecf20Sopenharmony_ci#define VREPRINT 12 578c2ecf20Sopenharmony_ci#define VDISCARD 13 588c2ecf20Sopenharmony_ci#define VWERASE 14 598c2ecf20Sopenharmony_ci#define VLNEXT 15 608c2ecf20Sopenharmony_ci#define VEOL2 16 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci/* c_iflag bits */ 638c2ecf20Sopenharmony_ci#define IGNBRK 0000001 648c2ecf20Sopenharmony_ci#define BRKINT 0000002 658c2ecf20Sopenharmony_ci#define IGNPAR 0000004 668c2ecf20Sopenharmony_ci#define PARMRK 0000010 678c2ecf20Sopenharmony_ci#define INPCK 0000020 688c2ecf20Sopenharmony_ci#define ISTRIP 0000040 698c2ecf20Sopenharmony_ci#define INLCR 0000100 708c2ecf20Sopenharmony_ci#define IGNCR 0000200 718c2ecf20Sopenharmony_ci#define ICRNL 0000400 728c2ecf20Sopenharmony_ci#define IUCLC 0001000 738c2ecf20Sopenharmony_ci#define IXON 0002000 748c2ecf20Sopenharmony_ci#define IXANY 0004000 758c2ecf20Sopenharmony_ci#define IXOFF 0010000 768c2ecf20Sopenharmony_ci#define IMAXBEL 0020000 778c2ecf20Sopenharmony_ci#define IUTF8 0040000 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci/* c_oflag bits */ 808c2ecf20Sopenharmony_ci#define OPOST 0000001 818c2ecf20Sopenharmony_ci#define OLCUC 0000002 828c2ecf20Sopenharmony_ci#define ONLCR 0000004 838c2ecf20Sopenharmony_ci#define OCRNL 0000010 848c2ecf20Sopenharmony_ci#define ONOCR 0000020 858c2ecf20Sopenharmony_ci#define ONLRET 0000040 868c2ecf20Sopenharmony_ci#define OFILL 0000100 878c2ecf20Sopenharmony_ci#define OFDEL 0000200 888c2ecf20Sopenharmony_ci#define NLDLY 0000400 898c2ecf20Sopenharmony_ci#define NL0 0000000 908c2ecf20Sopenharmony_ci#define NL1 0000400 918c2ecf20Sopenharmony_ci#define CRDLY 0003000 928c2ecf20Sopenharmony_ci#define CR0 0000000 938c2ecf20Sopenharmony_ci#define CR1 0001000 948c2ecf20Sopenharmony_ci#define CR2 0002000 958c2ecf20Sopenharmony_ci#define CR3 0003000 968c2ecf20Sopenharmony_ci#define TABDLY 0014000 978c2ecf20Sopenharmony_ci#define TAB0 0000000 988c2ecf20Sopenharmony_ci#define TAB1 0004000 998c2ecf20Sopenharmony_ci#define TAB2 0010000 1008c2ecf20Sopenharmony_ci#define TAB3 0014000 1018c2ecf20Sopenharmony_ci#define XTABS 0014000 1028c2ecf20Sopenharmony_ci#define BSDLY 0020000 1038c2ecf20Sopenharmony_ci#define BS0 0000000 1048c2ecf20Sopenharmony_ci#define BS1 0020000 1058c2ecf20Sopenharmony_ci#define VTDLY 0040000 1068c2ecf20Sopenharmony_ci#define VT0 0000000 1078c2ecf20Sopenharmony_ci#define VT1 0040000 1088c2ecf20Sopenharmony_ci#define FFDLY 0100000 1098c2ecf20Sopenharmony_ci#define FF0 0000000 1108c2ecf20Sopenharmony_ci#define FF1 0100000 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci/* c_cflag bit meaning */ 1138c2ecf20Sopenharmony_ci#define CBAUD 0010017 1148c2ecf20Sopenharmony_ci#define B0 0000000 /* hang up */ 1158c2ecf20Sopenharmony_ci#define B50 0000001 1168c2ecf20Sopenharmony_ci#define B75 0000002 1178c2ecf20Sopenharmony_ci#define B110 0000003 1188c2ecf20Sopenharmony_ci#define B134 0000004 1198c2ecf20Sopenharmony_ci#define B150 0000005 1208c2ecf20Sopenharmony_ci#define B200 0000006 1218c2ecf20Sopenharmony_ci#define B300 0000007 1228c2ecf20Sopenharmony_ci#define B600 0000010 1238c2ecf20Sopenharmony_ci#define B1200 0000011 1248c2ecf20Sopenharmony_ci#define B1800 0000012 1258c2ecf20Sopenharmony_ci#define B2400 0000013 1268c2ecf20Sopenharmony_ci#define B4800 0000014 1278c2ecf20Sopenharmony_ci#define B9600 0000015 1288c2ecf20Sopenharmony_ci#define B19200 0000016 1298c2ecf20Sopenharmony_ci#define B38400 0000017 1308c2ecf20Sopenharmony_ci#define EXTA B19200 1318c2ecf20Sopenharmony_ci#define EXTB B38400 1328c2ecf20Sopenharmony_ci#define CSIZE 0000060 1338c2ecf20Sopenharmony_ci#define CS5 0000000 1348c2ecf20Sopenharmony_ci#define CS6 0000020 1358c2ecf20Sopenharmony_ci#define CS7 0000040 1368c2ecf20Sopenharmony_ci#define CS8 0000060 1378c2ecf20Sopenharmony_ci#define CSTOPB 0000100 1388c2ecf20Sopenharmony_ci#define CREAD 0000200 1398c2ecf20Sopenharmony_ci#define PARENB 0000400 1408c2ecf20Sopenharmony_ci#define PARODD 0001000 1418c2ecf20Sopenharmony_ci#define HUPCL 0002000 1428c2ecf20Sopenharmony_ci#define CLOCAL 0004000 1438c2ecf20Sopenharmony_ci#define CBAUDEX 0010000 1448c2ecf20Sopenharmony_ci#define BOTHER 0010000 1458c2ecf20Sopenharmony_ci#define B57600 0010001 1468c2ecf20Sopenharmony_ci#define B115200 0010002 1478c2ecf20Sopenharmony_ci#define B230400 0010003 1488c2ecf20Sopenharmony_ci#define B460800 0010004 1498c2ecf20Sopenharmony_ci#define B500000 0010005 1508c2ecf20Sopenharmony_ci#define B576000 0010006 1518c2ecf20Sopenharmony_ci#define B921600 0010007 1528c2ecf20Sopenharmony_ci#define B1000000 0010010 1538c2ecf20Sopenharmony_ci#define B1152000 0010011 1548c2ecf20Sopenharmony_ci#define B1500000 0010012 1558c2ecf20Sopenharmony_ci#define B2000000 0010013 1568c2ecf20Sopenharmony_ci#define B2500000 0010014 1578c2ecf20Sopenharmony_ci#define B3000000 0010015 1588c2ecf20Sopenharmony_ci#define B3500000 0010016 1598c2ecf20Sopenharmony_ci#define B4000000 0010017 1608c2ecf20Sopenharmony_ci#define CIBAUD 002003600000 /* input baud rate */ 1618c2ecf20Sopenharmony_ci#define CMSPAR 010000000000 /* mark or space (stick) parity */ 1628c2ecf20Sopenharmony_ci#define CRTSCTS 020000000000 /* flow control */ 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci/* c_lflag bits */ 1678c2ecf20Sopenharmony_ci#define ISIG 0000001 1688c2ecf20Sopenharmony_ci#define ICANON 0000002 1698c2ecf20Sopenharmony_ci#define XCASE 0000004 1708c2ecf20Sopenharmony_ci#define ECHO 0000010 1718c2ecf20Sopenharmony_ci#define ECHOE 0000020 1728c2ecf20Sopenharmony_ci#define ECHOK 0000040 1738c2ecf20Sopenharmony_ci#define ECHONL 0000100 1748c2ecf20Sopenharmony_ci#define NOFLSH 0000200 1758c2ecf20Sopenharmony_ci#define TOSTOP 0000400 1768c2ecf20Sopenharmony_ci#define ECHOCTL 0001000 1778c2ecf20Sopenharmony_ci#define ECHOPRT 0002000 1788c2ecf20Sopenharmony_ci#define ECHOKE 0004000 1798c2ecf20Sopenharmony_ci#define FLUSHO 0010000 1808c2ecf20Sopenharmony_ci#define PENDIN 0040000 1818c2ecf20Sopenharmony_ci#define IEXTEN 0100000 1828c2ecf20Sopenharmony_ci#define EXTPROC 0200000 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci/* tcflow() and TCXONC use these */ 1858c2ecf20Sopenharmony_ci#define TCOOFF 0 1868c2ecf20Sopenharmony_ci#define TCOON 1 1878c2ecf20Sopenharmony_ci#define TCIOFF 2 1888c2ecf20Sopenharmony_ci#define TCION 3 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci/* tcflush() and TCFLSH use these */ 1918c2ecf20Sopenharmony_ci#define TCIFLUSH 0 1928c2ecf20Sopenharmony_ci#define TCOFLUSH 1 1938c2ecf20Sopenharmony_ci#define TCIOFLUSH 2 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci/* tcsetattr uses these */ 1968c2ecf20Sopenharmony_ci#define TCSANOW 0 1978c2ecf20Sopenharmony_ci#define TCSADRAIN 1 1988c2ecf20Sopenharmony_ci#define TCSAFLUSH 2 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci#endif /* __ASM_GENERIC_TERMBITS_H */ 201