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