blob: 90cf2210118b809e19818d8334941c31252951ab [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _SPARC_TERMBITS_H
2#define _SPARC_TERMBITS_H
3
4#include <linux/posix_types.h>
5
6typedef unsigned char cc_t;
7typedef unsigned int speed_t;
8typedef unsigned long tcflag_t;
9
10#define NCC 8
11struct termio {
12 unsigned short c_iflag; /* input mode flags */
13 unsigned short c_oflag; /* output mode flags */
14 unsigned short c_cflag; /* control mode flags */
15 unsigned short c_lflag; /* local mode flags */
16 unsigned char c_line; /* line discipline */
17 unsigned char c_cc[NCC]; /* control characters */
18};
19
20#define NCCS 17
21struct termios {
22 tcflag_t c_iflag; /* input mode flags */
23 tcflag_t c_oflag; /* output mode flags */
24 tcflag_t c_cflag; /* control mode flags */
25 tcflag_t c_lflag; /* local mode flags */
26 cc_t c_line; /* line discipline */
27 cc_t c_cc[NCCS]; /* control characters */
28#ifdef __KERNEL__
29#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
30 cc_t _x_cc[2]; /* We need them to hold vmin/vtime */
31#endif
32};
33
David Miller6050afb2007-10-17 19:38:10 -070034struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t _x_cc[2]; /* padding to match ktermios */
42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */
44};
45
Alan Coxbe900382006-12-08 02:38:43 -080046struct ktermios {
47 tcflag_t c_iflag; /* input mode flags */
48 tcflag_t c_oflag; /* output mode flags */
49 tcflag_t c_cflag; /* control mode flags */
50 tcflag_t c_lflag; /* local mode flags */
51 cc_t c_line; /* line discipline */
52 cc_t c_cc[NCCS]; /* control characters */
53 cc_t _x_cc[2]; /* We need them to hold vmin/vtime */
54 speed_t c_ispeed; /* input speed */
55 speed_t c_ospeed; /* output speed */
56};
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058/* c_cc characters */
59#define VINTR 0
60#define VQUIT 1
61#define VERASE 2
62#define VKILL 3
63#define VEOF 4
64#define VEOL 5
65#define VEOL2 6
66#define VSWTC 7
67#define VSTART 8
68#define VSTOP 9
69
70
71
72#define VSUSP 10
73#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
74#define VREPRINT 12
75#define VDISCARD 13
76#define VWERASE 14
77#define VLNEXT 15
78
79/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
80 * shared with eof/eol
81 */
82#ifdef __KERNEL__
83#define VMIN 16
84#define VTIME 17
85#else
86#define VMIN VEOF
87#define VTIME VEOL
88#endif
89
90/* c_iflag bits */
91#define IGNBRK 0x00000001
92#define BRKINT 0x00000002
93#define IGNPAR 0x00000004
94#define PARMRK 0x00000008
95#define INPCK 0x00000010
96#define ISTRIP 0x00000020
97#define INLCR 0x00000040
98#define IGNCR 0x00000080
99#define ICRNL 0x00000100
100#define IUCLC 0x00000200
101#define IXON 0x00000400
102#define IXANY 0x00000800
103#define IXOFF 0x00001000
104#define IMAXBEL 0x00002000
105#define IUTF8 0x00004000
106
107/* c_oflag bits */
108#define OPOST 0x00000001
109#define OLCUC 0x00000002
110#define ONLCR 0x00000004
111#define OCRNL 0x00000008
112#define ONOCR 0x00000010
113#define ONLRET 0x00000020
114#define OFILL 0x00000040
115#define OFDEL 0x00000080
116#define NLDLY 0x00000100
117#define NL0 0x00000000
118#define NL1 0x00000100
119#define CRDLY 0x00000600
120#define CR0 0x00000000
121#define CR1 0x00000200
122#define CR2 0x00000400
123#define CR3 0x00000600
124#define TABDLY 0x00001800
125#define TAB0 0x00000000
126#define TAB1 0x00000800
127#define TAB2 0x00001000
128#define TAB3 0x00001800
129#define XTABS 0x00001800
130#define BSDLY 0x00002000
131#define BS0 0x00000000
132#define BS1 0x00002000
133#define VTDLY 0x00004000
134#define VT0 0x00000000
135#define VT1 0x00004000
136#define FFDLY 0x00008000
137#define FF0 0x00000000
138#define FF1 0x00008000
139#define PAGEOUT 0x00010000 /* SUNOS specific */
140#define WRAP 0x00020000 /* SUNOS specific */
141
142/* c_cflag bit meaning */
143#define CBAUD 0x0000100f
144#define B0 0x00000000 /* hang up */
145#define B50 0x00000001
146#define B75 0x00000002
147#define B110 0x00000003
148#define B134 0x00000004
149#define B150 0x00000005
150#define B200 0x00000006
151#define B300 0x00000007
152#define B600 0x00000008
153#define B1200 0x00000009
154#define B1800 0x0000000a
155#define B2400 0x0000000b
156#define B4800 0x0000000c
157#define B9600 0x0000000d
158#define B19200 0x0000000e
159#define B38400 0x0000000f
160#define EXTA B19200
161#define EXTB B38400
162#define CSIZE 0x00000030
163#define CS5 0x00000000
164#define CS6 0x00000010
165#define CS7 0x00000020
166#define CS8 0x00000030
167#define CSTOPB 0x00000040
168#define CREAD 0x00000080
169#define PARENB 0x00000100
170#define PARODD 0x00000200
171#define HUPCL 0x00000400
172#define CLOCAL 0x00000800
173#define CBAUDEX 0x00001000
174/* We'll never see these speeds with the Zilogs, but for completeness... */
David Miller6050afb2007-10-17 19:38:10 -0700175#define BOTHER 0x00001000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176#define B57600 0x00001001
177#define B115200 0x00001002
178#define B230400 0x00001003
179#define B460800 0x00001004
180/* This is what we can do with the Zilogs. */
181#define B76800 0x00001005
182/* This is what we can do with the SAB82532. */
183#define B153600 0x00001006
184#define B307200 0x00001007
185#define B614400 0x00001008
186#define B921600 0x00001009
187/* And these are the rest... */
188#define B500000 0x0000100a
189#define B576000 0x0000100b
190#define B1000000 0x0000100c
191#define B1152000 0x0000100d
192#define B1500000 0x0000100e
193#define B2000000 0x0000100f
194/* These have totally bogus values and nobody uses them
195 so far. Later on we'd have to use say 0x10000x and
196 adjust CBAUD constant and drivers accordingly.
197#define B2500000 0x00001010
198#define B3000000 0x00001011
199#define B3500000 0x00001012
200#define B4000000 0x00001013 */
201#define CIBAUD 0x100f0000 /* input baud rate (not used) */
202#define CMSPAR 0x40000000 /* mark or space (stick) parity */
203#define CRTSCTS 0x80000000 /* flow control */
204
David Miller6050afb2007-10-17 19:38:10 -0700205#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
206
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207/* c_lflag bits */
208#define ISIG 0x00000001
209#define ICANON 0x00000002
210#define XCASE 0x00000004
211#define ECHO 0x00000008
212#define ECHOE 0x00000010
213#define ECHOK 0x00000020
214#define ECHONL 0x00000040
215#define NOFLSH 0x00000080
216#define TOSTOP 0x00000100
217#define ECHOCTL 0x00000200
218#define ECHOPRT 0x00000400
219#define ECHOKE 0x00000800
220#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
221#define FLUSHO 0x00002000
222#define PENDIN 0x00004000
223#define IEXTEN 0x00008000
224
225/* modem lines */
226#define TIOCM_LE 0x001
227#define TIOCM_DTR 0x002
228#define TIOCM_RTS 0x004
229#define TIOCM_ST 0x008
230#define TIOCM_SR 0x010
231#define TIOCM_CTS 0x020
232#define TIOCM_CAR 0x040
233#define TIOCM_RNG 0x080
234#define TIOCM_DSR 0x100
235#define TIOCM_CD TIOCM_CAR
236#define TIOCM_RI TIOCM_RNG
237#define TIOCM_OUT1 0x2000
238#define TIOCM_OUT2 0x4000
239#define TIOCM_LOOP 0x8000
240
241/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
242#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
243
244
245/* tcflow() and TCXONC use these */
246#define TCOOFF 0
247#define TCOON 1
248#define TCIOFF 2
249#define TCION 3
250
251/* tcflush() and TCFLSH use these */
252#define TCIFLUSH 0
253#define TCOFLUSH 1
254#define TCIOFLUSH 2
255
256/* tcsetattr uses these */
257#define TCSANOW 0
258#define TCSADRAIN 1
259#define TCSAFLUSH 2
260
261#endif /* !(_SPARC_TERMBITS_H) */