linux_termios.h revision 1.8 1 1.8 manu /* $NetBSD: linux_termios.h,v 1.8 2001/01/20 18:56:43 manu 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.8 manu #else
51 1.8 manu #error Undefined linux_termios.h machine type.
52 1.8 manu #endif
53 1.8 manu
54 1.3 erh struct linux_winsize {
55 1.3 erh unsigned short ws_row;
56 1.3 erh unsigned short ws_col;
57 1.3 erh unsigned short ws_xpixel;
58 1.3 erh unsigned short ws_ypixel;
59 1.3 erh };
60 1.1 mycroft
61 1.8 manu /*
62 1.8 manu * LINUX_NCC is architecture dependent. It is now
63 1.8 manu * defined in sys/compat/linux/<arch>/linux_termios.h
64 1.8 manu */
65 1.1 mycroft struct linux_termio {
66 1.1 mycroft unsigned short c_iflag;
67 1.1 mycroft unsigned short c_oflag;
68 1.1 mycroft unsigned short c_cflag;
69 1.1 mycroft unsigned short c_lflag;
70 1.1 mycroft unsigned char c_line;
71 1.1 mycroft unsigned char c_cc[LINUX_NCC];
72 1.1 mycroft };
73 1.1 mycroft
74 1.1 mycroft #define LINUX_NCCS 19
75 1.1 mycroft struct linux_termios {
76 1.3 erh linux_tcflag_t c_iflag;
77 1.3 erh linux_tcflag_t c_oflag;
78 1.3 erh linux_tcflag_t c_cflag;
79 1.3 erh linux_tcflag_t c_lflag;
80 1.3 erh linux_cc_t c_line;
81 1.3 erh linux_cc_t c_cc[LINUX_NCCS];
82 1.8 manu #ifdef LINUX_LARGE_STRUCT_TERMIOS
83 1.8 manu /*
84 1.8 manu * Present on some linux ports but unused:
85 1.8 manu * However we must enable it, else it breaks ioctl
86 1.8 manu * definitions (the size does not match anymore)
87 1.8 manu */
88 1.3 erh linux_speed_t c_ispeed;
89 1.3 erh linux_speed_t c_ospeed;
90 1.3 erh #endif
91 1.1 mycroft };
92 1.1 mycroft
93 1.1 mycroft /* Linux modem line defines.. not sure if they'll be used */
94 1.1 mycroft #define LINUX_TIOCM_LE 0x0001
95 1.1 mycroft #define LINUX_TIOCM_DTR 0x0002
96 1.1 mycroft #define LINUX_TIOCM_RTS 0x0004
97 1.1 mycroft #define LINUX_TIOCM_ST 0x0008
98 1.1 mycroft #define LINUX_TIOCM_SR 0x0010
99 1.1 mycroft #define LINUX_TIOCM_CTS 0x0020
100 1.1 mycroft #define LINUX_TIOCM_CAR 0x0040
101 1.1 mycroft #define LINUX_TIOCM_RNG 0x0080
102 1.1 mycroft #define LINUX_TIOCM_DSR 0x0100
103 1.1 mycroft #define LINUX_TIOCM_CD LINUX_TIOCM_CAR
104 1.1 mycroft #define LINUX_TIOCM_RI LINUX_TIOCM_RNG
105 1.1 mycroft
106 1.1 mycroft #define LINUX_TCIFLUSH 0
107 1.1 mycroft #define LINUX_TCOFLUSH 1
108 1.1 mycroft #define LINUX_TCIOFLUSH 2
109 1.1 mycroft
110 1.1 mycroft #define LINUX_TCOOFF 0
111 1.1 mycroft #define LINUX_TCOON 1
112 1.1 mycroft #define LINUX_TCIOFF 2
113 1.1 mycroft #define LINUX_TCION 3
114 1.1 mycroft
115 1.1 mycroft #define LINUX_TCSANOW 0
116 1.1 mycroft #define LINUX_TCSADRAIN 1
117 1.1 mycroft #define LINUX_TCSAFLUSH 2
118 1.1 mycroft
119 1.1 mycroft /* Linux line disciplines */
120 1.1 mycroft #define LINUX_N_TTY 0
121 1.1 mycroft #define LINUX_N_SLIP 1
122 1.1 mycroft #define LINUX_N_MOUSE 2
123 1.1 mycroft #define LINUX_N_PPP 3
124 1.3 erh #define LINUX_N_STRIP 4
125 1.3 erh
126 1.3 erh /* currently unused: */
127 1.3 erh #define LINUX_N_AX25 5
128 1.3 erh #define LINUX_N_X25 6
129 1.3 erh #define LINUX_N_6PACK 7
130 1.6 fvdl
131 1.6 fvdl /* values passed to TIOCLINUX ioctl */
132 1.6 fvdl #define LINUX_TIOCLINUX_COPY 2
133 1.6 fvdl #define LINUX_TIOCLINUX_PASTE 3
134 1.6 fvdl #define LINUX_TIOCLINUX_UNBLANK 4
135 1.6 fvdl #define LINUX_TIOCLINUX_LOADLUT 5
136 1.6 fvdl #define LINUX_TIOCLINUX_READSHIFT 6
137 1.6 fvdl #define LINUX_TIOCLINUX_READMOUSE 7
138 1.6 fvdl #define LINUX_TIOCLINUX_VESABLANK 10
139 1.6 fvdl #define LINUX_TIOCLINUX_KERNMSG 11
140 1.6 fvdl #define LINUX_TIOCLINUX_CURCONS 12
141 1.3 erh
142 1.4 christos #endif /* !_LINUX_TERMIOS_H */
143