linux_termios.h revision 1.5 1 /* $NetBSD: linux_termios.h,v 1.5 2001/08/26 17:26:31 manu Exp $ */
2
3 /*-
4 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Eric Haszlakiewicz and Emmanuel Dreyfus.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _POWERPC_LINUX_TERMIOS_H
40 #define _POWERPC_LINUX_TERMIOS_H
41
42 #define LINUX_NCC 10
43 #define LINUX_NCCS 19
44
45 /*
46 * Enable optional part of struct termios
47 * in sys/compat/linux/common/linux_termios.h
48 */
49 #define LINUX_LARGE_STRUCT_TERMIOS
50
51 /*
52 * From Linux's include/asm-ppc/termios.h
53 */
54 #define LINUX_TCGETS _LINUX_IOR('t', 19, struct linux_termios)
55 #define LINUX_TCSETS _LINUX_IOW('t', 20, struct linux_termios)
56 #define LINUX_TCSETSW _LINUX_IOW('t', 21, struct linux_termios)
57 #define LINUX_TCSETSF _LINUX_IOW('t', 22, struct linux_termios)
58 #define LINUX_TCGETA _LINUX_IOR('t', 23, struct linux_termio)
59 #define LINUX_TCSETA _LINUX_IOW('t', 24, struct linux_termio)
60 #define LINUX_TCSETAW _LINUX_IOW('t', 25, struct linux_termio)
61 #define LINUX_TCSETAF _LINUX_IOW('t', 28, struct linux_termio)
62 #define LINUX_TCSBRK _LINUX_IO('t', 29)
63 #define LINUX_TCXONC _LINUX_IO('t', 30)
64 #define LINUX_TCFLSH _LINUX_IO('t', 31)
65 #define LINUX_TIOCEXCL 0x540c
66 #define LINUX_TIOCNXCL 0x540d
67 #define LINUX_TIOCSCTTY 0x540e
68 #define LINUX_TIOCGPGRP _LINUX_IOR('t', 119, int)
69 #define LINUX_TIOCSPGRP _LINUX_IOW('t', 118, int)
70 #define LINUX_TIOCOUTQ _LINUX_IOR('t', 115, int)
71 #define LINUX_TIOCSTI 0x5412
72 #define LINUX_TIOCGWINSZ _LINUX_IOR('t', 104, struct linux_winsize)
73 #define LINUX_TIOCSWINSZ _LINUX_IOW('t', 103, struct linux_winsize)
74 #define LINUX_TIOCMGET 0x5415
75 #define LINUX_TIOCMBIS 0x5416
76 #define LINUX_TIOCMBIC 0x5417
77 #define LINUX_TIOCMSET 0x5418
78 #define LINUX_TIOCGSOFTCAR 0x5419
79 #define LINUX_TIOCSSOFTCAR 0x541a
80 #define LINUX_FIONREAD _LINUX_IOR('f', 127, int)
81 #define LINUX_TIOCINQ LINUX_FIONREAD
82 #define LINUX_TIOCLINUX 0x541c
83 #define LINUX_TIOCCONS 0x541d
84 #define LINUX_TIOCGSERIAL 0x541e
85 #define LINUX_TIOCSSERIAL 0x541f
86 #define LINUX_TIOCPKT 0x5420
87 #define LINUX_FIONBIO _LINUX_IOW('f', 126, int)
88 #define LINUX_TIOCNOTTY 0x5422
89 #define LINUX_TIOCSETD 0x5423
90 #define LINUX_TIOCGETD 0x5424
91 #define LINUX_TCSBRKP 0x5425
92 #define LINUX_TIOCTTYGSTRUCT 0x5426
93
94 #define LINUX_FIONCLEX _LINUX_IO('f', 2)
95 #define LINUX_FIOCLEX _LINUX_IO('f', 1)
96 #define LINUX_FIOASYNC _LINUX_IOW('f', 125, int)
97 #define LINUX_TIOCSERCONFIG 0x5453
98 #define LINUX_TIOCSERGWILD 0x5454
99 #define LINUX_TIOCSERSWILD 0x5455
100 #define LINUX_TIOCGLCKTRMIOS 0x5456
101 #define LINUX_TIOCSLCKTRMIOS 0x5457
102 #define LINUX_TIOCSERGSTRUCT 0x5458
103 #define LINUX_TIOCSERGETLSR 0x5459
104 #define LINUX_TIOCSERGETMULTI 0x545a
105 #define LINUX_TIOCSERSETMULTI 0x545b
106
107 /*
108 * linux_termios c_cc chars:
109 * From Linux include/asm-ppc/termios.h AND include/asm-ppc/termbits.h
110 */
111 #define LINUX_VINTR 0
112 #define LINUX_VQUIT 1
113 #define LINUX_VERASE 2
114 #define LINUX_VKILL 3
115 #define LINUX_VEOF 4
116 #define LINUX_VMIN 5
117 #define LINUX_VEOL 6
118 #define LINUX_VTIME 7
119 #define LINUX_VEOL2 8
120 #define LINUX_VSWTC 9
121
122 /*
123 * The following is from include/asm-ppc/termbits.h only
124 */
125 #define LINUX_VWERASE 10
126 #define LINUX_VREPRINT 11
127 #define LINUX_VSUSP 12
128 #define LINUX_VSTART 13
129 #define LINUX_VSTOP 14
130 #define LINUX_VLNEXT 15
131 #define LINUX_VDISCARD 16
132
133 /*
134 * Old style linux_termio
135 * XXX Not found anywhere in Linux
136 */
137 #define LINUX_OLD_VINTR LINUX_VINTR
138 #define LINUX_OLD_VQUIT LINUX_VQUIT
139 #define LINUX_OLD_VERASE LINUX_VERASE
140 #define LINUX_OLD_VKILL LINUX_VKILL
141 #define LINUX_OLD_VEOF LINUX_VEOF
142 #define LINUX_OLD_VMIN LINUX_VMIN
143 #define LINUX_OLD_VEOL LINUX_VEOL
144 #define LINUX_OLD_VTIME LINUX_VTIME
145 #define LINUX_OLD_VEOL2 LINUX_VEOL2
146 #define LINUX_OLD_VSWTC LINUX_VSWTC
147
148 /*
149 * All the remaining stuff is from Linux's include/asm-ppc/termbits.h
150 * Linux c_iflag masks
151 */
152 #define LINUX_IGNBRK 0x0000001
153 #define LINUX_BRKINT 0x0000002
154 #define LINUX_IGNPAR 0x0000004
155 #define LINUX_PARMRK 0x0000010
156 #define LINUX_INPCK 0x0000020
157 #define LINUX_ISTRIP 0x0000040
158 #define LINUX_INLCR 0x0000100
159 #define LINUX_IGNCR 0x0000200
160 #define LINUX_ICRNL 0x0000400
161 #define LINUX_IXON 0x0001000
162 #define LINUX_IXOFF 0x0002000
163 #define LINUX_IXANY 0x0004000
164 #define LINUX_IUCLC 0x0010000
165 #define LINUX_IMAXBEL 0x0002000
166
167 /*
168 * Linux c_oflag masks
169 */
170 #define LINUX_OPOST 0x0000001
171 #define LINUX_ONLCR 0x0000002
172 #define LINUX_OLCUC 0x0000004
173 #define LINUX_OCRNL 0x0000010
174 #define LINUX_ONOCR 0x0000020
175 #define LINUX_ONLRET 0x0000040
176
177 #define LINUX_OFILL 0x00000100
178 #define LINUX_OFDEL 0x00000200
179 #define LINUX_NLDLY 0x00001400
180 #define LINUX_NL0 0x00000000
181 #define LINUX_NL1 0x00000400
182 #define LINUX_NL2 0x00001000
183 #define LINUX_NL3 0x00001400
184 #define LINUX_TABDLY 0x00006000
185 #define LINUX_TAB0 0x00000000
186 #define LINUX_TAB1 0x00002000
187 #define LINUX_TAB2 0x00004000
188 #define LINUX_TAB3 0x00006000
189 #define LINUX_CRDLY 0x00030000
190 #define LINUX_CR0 0x00000000
191 #define LINUX_CR1 0x00010000
192 #define LINUX_CR2 0x00020000
193 #define LINUX_CR3 0x00030000
194 #define LINUX_FFDLY 0x00040000
195 #define LINUX_FF0 0x00000000
196 #define LINUX_FF1 0x00040000
197 #define LINUX_BSDLY 0x00100000
198 #define LINUX_BS0 0x00000000
199 #define LINUX_BS1 0x00100000
200 #define LINUX_VTDLY 0x00200000
201 #define LINUX_VT0 0x00000000
202 #define LINUX_VT1 0x00200000
203 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
204 #define LINUX_XTABS 0x01000000
205
206 /*
207 * Linux c_cflag bit masks
208 * XXX not found in Linux, but it is needed to build
209 */
210 #define LINUX_NSPEEDS 16
211
212 #define LINUX_CBAUD 0x0000377
213 #define LINUX_B0 0x0000000 /* hang up */
214 #define LINUX_B50 0x0000001
215 #define LINUX_B75 0x0000002
216 #define LINUX_B110 0x0000003
217 #define LINUX_B134 0x0000004
218 #define LINUX_B150 0x0000005
219 #define LINUX_B200 0x0000006
220 #define LINUX_B300 0x0000007
221 #define LINUX_B600 0x0000010
222 #define LINUX_B1200 0x0000011
223 #define LINUX_B1800 0x0000012
224 #define LINUX_B2400 0x0000013
225 #define LINUX_B4800 0x0000014
226 #define LINUX_B9600 0x0000015
227 #define LINUX_B19200 0x0000016
228 #define LINUX_B38400 0x0000017
229 #define LINUX_EXTA B19200
230 #define LINUX_EXTB B38400
231 #define LINUX_CBAUDEX 0x0000000
232 #define LINUX_B57600 0x00020
233 #define LINUX_B115200 0x00021
234 #define LINUX_B230400 0x00022
235 #define LINUX_B460800 0x00023
236 #define LINUX_B500000 0x00024
237 #define LINUX_B576000 0x00025
238 #define LINUX_B921600 0x00026
239 #define LINUX_B1000000 0x00027
240 #define LINUX_B1152000 0x00030
241 #define LINUX_B1500000 0x00031
242 #define LINUX_B2000000 0x00032
243 #define LINUX_B2500000 0x00033
244 #define LINUX_B3000000 0x00034
245 #define LINUX_B3500000 0x00035
246 #define LINUX_B4000000 0x00036
247
248 #define LINUX_CSIZE 0x00001400
249 #define LINUX_CS5 0x00000000
250 #define LINUX_CS6 0x00000400
251 #define LINUX_CS7 0x00001000
252 #define LINUX_CS8 0x00001400
253
254 #define LINUX_CSTOPB 0x00002000
255 #define LINUX_CREAD 0x00004000
256 #define LINUX_PARENB 0x00010000
257 #define LINUX_PARODD 0x00020000
258 #define LINUX_HUPCL 0x00040000
259
260 #define LINUX_CLOCAL 0x00100000
261 #define LINUX_CRTSCTS 0x020000000000 /* flow control */
262
263 /*
264 * Linux c_lflag masks
265 */
266 #define LINUX_ISIG 0x00000080
267 #define LINUX_ICANON 0x00000100
268 #define LINUX_XCASE 0x00004000
269 #define LINUX_ECHO 0x00000008
270 #define LINUX_ECHOE 0x00000002
271 #define LINUX_ECHOK 0x00000004
272 #define LINUX_ECHONL 0x00000010
273 #define LINUX_NOFLSH 0x80000000
274 #define LINUX_TOSTOP 0x00400000
275 #define LINUX_ECHOCTL 0x00000040
276 #define LINUX_ECHOPRT 0x00000020
277 #define LINUX_ECHOKE 0x00000001
278 #define LINUX_FLUSHO 0x00800000
279 #define LINUX_PENDIN 0x20000000
280 #define LINUX_IEXTEN 0x00000400
281
282 #endif /* !_POWERPC_LINUX_TERMIOS_H */
283