linux_termios.h revision 1.11 1 1.11 bjh21 /* $NetBSD: linux_termios.h,v 1.11 2002/01/14 23:14:43 bjh21 Exp $ */
2 1.1 mycroft
3 1.3 erh /*-
4 1.3 erh * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 1.3 erh * All rights reserved.
6 1.3 erh *
7 1.3 erh * This code is derived from software contributed to The NetBSD Foundation
8 1.3 erh * by Eric Haszlakiewicz.
9 1.3 erh *
10 1.3 erh * Redistribution and use in source and binary forms, with or without
11 1.3 erh * modification, are permitted provided that the following conditions
12 1.3 erh * are met:
13 1.3 erh * 1. Redistributions of source code must retain the above copyright
14 1.3 erh * notice, this list of conditions and the following disclaimer.
15 1.3 erh * 2. Redistributions in binary form must reproduce the above copyright
16 1.3 erh * notice, this list of conditions and the following disclaimer in the
17 1.3 erh * documentation and/or other materials provided with the distribution.
18 1.3 erh * 3. All advertising materials mentioning features or use of this software
19 1.3 erh * must display the following acknowledgement:
20 1.3 erh * This product includes software developed by the NetBSD
21 1.3 erh * Foundation, Inc. and its contributors.
22 1.3 erh * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.3 erh * contributors may be used to endorse or promote products derived
24 1.3 erh * from this software without specific prior written permission.
25 1.3 erh *
26 1.3 erh * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.3 erh * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.3 erh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.3 erh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.3 erh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.3 erh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.3 erh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.3 erh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.3 erh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.3 erh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.3 erh * POSSIBILITY OF SUCH DAMAGE.
37 1.3 erh */
38 1.3 erh
39 1.4 christos #ifndef _LINUX_TERMIOS_H
40 1.4 christos #define _LINUX_TERMIOS_H
41 1.3 erh
42 1.8 manu #if defined(__i386__)
43 1.8 manu #include <compat/linux/arch/i386/linux_termios.h>
44 1.8 manu #elif defined(__m68k__)
45 1.8 manu #include <compat/linux/arch/m68k/linux_termios.h>
46 1.8 manu #elif defined(__alpha__)
47 1.8 manu #include <compat/linux/arch/alpha/linux_termios.h>
48 1.8 manu #elif defined(__powerpc__)
49 1.8 manu #include <compat/linux/arch/powerpc/linux_termios.h>
50 1.10 manu #elif defined(__mips__)
51 1.10 manu #include <compat/linux/arch/mips/linux_termios.h>
52 1.11 bjh21 #elif defined(__arm__)
53 1.11 bjh21 #include <compat/linux/arch/arm/linux_termios.h>
54 1.8 manu #else
55 1.8 manu #error Undefined linux_termios.h machine type.
56 1.8 manu #endif
57 1.8 manu
58 1.3 erh struct linux_winsize {
59 1.3 erh unsigned short ws_row;
60 1.3 erh unsigned short ws_col;
61 1.3 erh unsigned short ws_xpixel;
62 1.3 erh unsigned short ws_ypixel;
63 1.3 erh };
64 1.1 mycroft
65 1.8 manu /*
66 1.8 manu * LINUX_NCC is architecture dependent. It is now
67 1.8 manu * defined in sys/compat/linux/<arch>/linux_termios.h
68 1.8 manu */
69 1.1 mycroft struct linux_termio {
70 1.1 mycroft unsigned short c_iflag;
71 1.1 mycroft unsigned short c_oflag;
72 1.1 mycroft unsigned short c_cflag;
73 1.1 mycroft unsigned short c_lflag;
74 1.1 mycroft unsigned char c_line;
75 1.1 mycroft unsigned char c_cc[LINUX_NCC];
76 1.1 mycroft };
77 1.1 mycroft
78 1.1 mycroft struct linux_termios {
79 1.3 erh linux_tcflag_t c_iflag;
80 1.3 erh linux_tcflag_t c_oflag;
81 1.3 erh linux_tcflag_t c_cflag;
82 1.3 erh linux_tcflag_t c_lflag;
83 1.3 erh linux_cc_t c_line;
84 1.3 erh linux_cc_t c_cc[LINUX_NCCS];
85 1.8 manu #ifdef LINUX_LARGE_STRUCT_TERMIOS
86 1.8 manu /*
87 1.8 manu * Present on some linux ports but unused:
88 1.8 manu * However we must enable it, else it breaks ioctl
89 1.8 manu * definitions (the size does not match anymore)
90 1.8 manu */
91 1.3 erh linux_speed_t c_ispeed;
92 1.3 erh linux_speed_t c_ospeed;
93 1.3 erh #endif
94 1.1 mycroft };
95 1.1 mycroft
96 1.1 mycroft /* Linux modem line defines.. not sure if they'll be used */
97 1.1 mycroft #define LINUX_TIOCM_LE 0x0001
98 1.1 mycroft #define LINUX_TIOCM_DTR 0x0002
99 1.1 mycroft #define LINUX_TIOCM_RTS 0x0004
100 1.1 mycroft #define LINUX_TIOCM_ST 0x0008
101 1.1 mycroft #define LINUX_TIOCM_SR 0x0010
102 1.1 mycroft #define LINUX_TIOCM_CTS 0x0020
103 1.1 mycroft #define LINUX_TIOCM_CAR 0x0040
104 1.1 mycroft #define LINUX_TIOCM_RNG 0x0080
105 1.1 mycroft #define LINUX_TIOCM_DSR 0x0100
106 1.1 mycroft #define LINUX_TIOCM_CD LINUX_TIOCM_CAR
107 1.1 mycroft #define LINUX_TIOCM_RI LINUX_TIOCM_RNG
108 1.1 mycroft
109 1.1 mycroft #define LINUX_TCIFLUSH 0
110 1.1 mycroft #define LINUX_TCOFLUSH 1
111 1.1 mycroft #define LINUX_TCIOFLUSH 2
112 1.1 mycroft
113 1.1 mycroft #define LINUX_TCOOFF 0
114 1.1 mycroft #define LINUX_TCOON 1
115 1.1 mycroft #define LINUX_TCIOFF 2
116 1.1 mycroft #define LINUX_TCION 3
117 1.1 mycroft
118 1.1 mycroft #define LINUX_TCSANOW 0
119 1.1 mycroft #define LINUX_TCSADRAIN 1
120 1.1 mycroft #define LINUX_TCSAFLUSH 2
121 1.1 mycroft
122 1.1 mycroft /* Linux line disciplines */
123 1.1 mycroft #define LINUX_N_TTY 0
124 1.1 mycroft #define LINUX_N_SLIP 1
125 1.1 mycroft #define LINUX_N_MOUSE 2
126 1.1 mycroft #define LINUX_N_PPP 3
127 1.3 erh #define LINUX_N_STRIP 4
128 1.3 erh
129 1.3 erh /* currently unused: */
130 1.3 erh #define LINUX_N_AX25 5
131 1.3 erh #define LINUX_N_X25 6
132 1.3 erh #define LINUX_N_6PACK 7
133 1.6 fvdl
134 1.6 fvdl /* values passed to TIOCLINUX ioctl */
135 1.6 fvdl #define LINUX_TIOCLINUX_COPY 2
136 1.6 fvdl #define LINUX_TIOCLINUX_PASTE 3
137 1.6 fvdl #define LINUX_TIOCLINUX_UNBLANK 4
138 1.6 fvdl #define LINUX_TIOCLINUX_LOADLUT 5
139 1.6 fvdl #define LINUX_TIOCLINUX_READSHIFT 6
140 1.6 fvdl #define LINUX_TIOCLINUX_READMOUSE 7
141 1.6 fvdl #define LINUX_TIOCLINUX_VESABLANK 10
142 1.6 fvdl #define LINUX_TIOCLINUX_KERNMSG 11
143 1.6 fvdl #define LINUX_TIOCLINUX_CURCONS 12
144 1.3 erh
145 1.4 christos #endif /* !_LINUX_TERMIOS_H */
146