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