1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3 
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8 
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17 
18 #ifndef _KERNEL_TERMIOS_H
19 #define _KERNEL_TERMIOS_H 1
20 
21 /* We need the definition of tcflag_t, cc_t, and speed_t.  */
22 #include <termios.h>
23 
24 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
25 
26 
27 
28 
29 #if defined( __sparc__ )
30 
31 
32 #define __KERNEL_NCCS 17
33 struct __kernel_termios
34 {
35     tcflag_t c_iflag;		/* input mode flags */
36     tcflag_t c_oflag;		/* output mode flags */
37     tcflag_t c_cflag;		/* control mode flags */
38     tcflag_t c_lflag;		/* local mode flags */
39     cc_t c_line;		/* line discipline */
40     cc_t c_cc[__KERNEL_NCCS];	/* control characters */
41 };
42 
43 
44 
45 #elif defined(__powerpc__)
46 
47 
48 
49 #define __KERNEL_NCCS 19
50 struct __kernel_termios
51   {
52     tcflag_t c_iflag;		/* input mode flags */
53     tcflag_t c_oflag;		/* output mode flags */
54     tcflag_t c_cflag;		/* control mode flags */
55     tcflag_t c_lflag;		/* local mode flags */
56     cc_t c_cc[__KERNEL_NCCS];	/* control characters */
57     cc_t c_line;		/* line discipline */
58     speed_t c_ispeed;           /* input speed */
59     speed_t c_ospeed;           /* output speed */
60   };
61 
62 #define _HAVE_C_ISPEED 1
63 #define _HAVE_C_OSPEED 1
64 
65 /* We have the kernel termios structure, so we can presume this code knows
66    what it's doing...  */
67 #undef  TCGETS
68 #undef  TCSETS
69 #undef  TCSETSW
70 #undef  TCSETSF
71 #define TCGETS	_IOR ('t', 19, struct __kernel_termios)
72 #define TCSETS	_IOW ('t', 20, struct __kernel_termios)
73 #define TCSETSW	_IOW ('t', 21, struct __kernel_termios)
74 #define TCSETSF	_IOW ('t', 22, struct __kernel_termios)
75 
76 
77 
78 #elif defined(__mips__)
79 
80 
81 
82 #define __KERNEL_NCCS 23
83 struct __kernel_termios
84 {
85     tcflag_t c_iflag;		/* input mode flags */
86     tcflag_t c_oflag;		/* output mode flags */
87     tcflag_t c_cflag;		/* control mode flags */
88     tcflag_t c_lflag;		/* local mode flags */
89     cc_t c_line;		/* line discipline */
90     cc_t c_cc[__KERNEL_NCCS];	/* control characters */
91 };
92 
93 
94 
95 #elif defined(__alpha__)
96 
97 
98 
99 #define __KERNEL_NCCS 19
100 struct __kernel_termios
101 {
102     tcflag_t c_iflag;		/* input mode flags */
103     tcflag_t c_oflag;		/* output mode flags */
104     tcflag_t c_cflag;		/* control mode flags */
105     tcflag_t c_lflag;		/* local mode flags */
106     cc_t c_cc[__KERNEL_NCCS];	/* control characters */
107     cc_t c_line;		/* line discipline */
108     speed_t c_ispeed;		/* input speed */
109     speed_t c_ospeed;		/* output speed */
110 };
111 
112 #define _HAVE_C_ISPEED 1
113 #define _HAVE_C_OSPEED 1
114 
115 
116 
117 #else /* None of the above */
118 
119 
120 
121 #define __KERNEL_NCCS 19
122 struct __kernel_termios
123 {
124     tcflag_t c_iflag;		/* input mode flags */
125     tcflag_t c_oflag;		/* output mode flags */
126     tcflag_t c_cflag;		/* control mode flags */
127     tcflag_t c_lflag;		/* local mode flags */
128     cc_t c_line;		/* line discipline */
129     cc_t c_cc[__KERNEL_NCCS];	/* control characters */
130 };
131 
132 #endif
133 
134 
135 
136 
137 #endif /* kernel_termios.h */
138 
139