Deleted Added
full compact
ioctl_compat.h (169068) ioctl_compat.h (179784)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
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 * 4. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ioctl_compat.h 8.4 (Berkeley) 1/21/94
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
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 * 4. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ioctl_compat.h 8.4 (Berkeley) 1/21/94
35 * $FreeBSD: head/sys/sys/ioctl_compat.h 169068 2007-04-27 11:19:05Z benjsc $
35 * $FreeBSD: head/sys/sys/ioctl_compat.h 179784 2008-06-14 10:42:18Z ed $
36 */
37
38#ifndef _SYS_IOCTL_COMPAT_H_
39#define _SYS_IOCTL_COMPAT_H_
40
36 */
37
38#ifndef _SYS_IOCTL_COMPAT_H_
39#define _SYS_IOCTL_COMPAT_H_
40
41#include <sys/ttychars.h>
42#include <sys/ttydev.h>
41#ifdef _KERNEL
43
42
44#ifdef USE_OLD_TTY
45#warning "Old BSD tty API used and depends on COMPAT_43TTY. Use termios.h instead"
46#endif
47
48struct tchars {
49 char t_intrc; /* interrupt */
50 char t_quitc; /* quit */
51 char t_startc; /* start output */
52 char t_stopc; /* stop output */
53 char t_eofc; /* end-of-file */
54 char t_brkc; /* input delimiter (like nl) */
55};
56
57struct ltchars {
58 char t_suspc; /* stop process signal */
59 char t_dsuspc; /* delayed stop process signal */
60 char t_rprntc; /* reprint line */
61 char t_flushc; /* flush output (toggles) */
62 char t_werasc; /* word erase */
63 char t_lnextc; /* literal next character */
64};
65
66/*
67 * Structure for TIOCGETP and TIOCSETP ioctls.
68 */
69#ifndef _SGTTYB_
70#define _SGTTYB_
71struct sgttyb {
72 char sg_ispeed; /* input speed */
73 char sg_ospeed; /* output speed */
74 char sg_erase; /* erase character */
75 char sg_kill; /* kill character */
76 short sg_flags; /* mode flags */
77};
78#endif
79
43struct tchars {
44 char t_intrc; /* interrupt */
45 char t_quitc; /* quit */
46 char t_startc; /* start output */
47 char t_stopc; /* stop output */
48 char t_eofc; /* end-of-file */
49 char t_brkc; /* input delimiter (like nl) */
50};
51
52struct ltchars {
53 char t_suspc; /* stop process signal */
54 char t_dsuspc; /* delayed stop process signal */
55 char t_rprntc; /* reprint line */
56 char t_flushc; /* flush output (toggles) */
57 char t_werasc; /* word erase */
58 char t_lnextc; /* literal next character */
59};
60
61/*
62 * Structure for TIOCGETP and TIOCSETP ioctls.
63 */
64#ifndef _SGTTYB_
65#define _SGTTYB_
66struct sgttyb {
67 char sg_ispeed; /* input speed */
68 char sg_ospeed; /* output speed */
69 char sg_erase; /* erase character */
70 char sg_kill; /* kill character */
71 short sg_flags; /* mode flags */
72};
73#endif
74
80#ifdef USE_OLD_TTY
81# undef TIOCGETD
82# define TIOCGETD _IOR('t', 0, int) /* get line discipline */
83# undef TIOCSETD
84# define TIOCSETD _IOW('t', 1, int) /* set line discipline */
85#else
86# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */
87# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */
88#endif
75#define OTIOCGETD _IOR('t', 0, int) /* get line discipline */
76#define OTIOCSETD _IOW('t', 1, int) /* set line discipline */
89#define TIOCHPCL _IO('t', 2) /* hang up on last close */
90#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
91#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */
92#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
93#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */
94#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */
95#define TANDEM 0x00000001 /* send stopc on out q full */
96#define CBREAK 0x00000002 /* half-cooked mode */
97#define LCASE 0x00000004 /* simulate lower case */
98#define ECHO 0x00000008 /* echo input */
99#define CRMOD 0x00000010 /* map \r to \r\n on output */
100#define RAW 0x00000020 /* no i/o processing */
101#define ODDP 0x00000040 /* get/send odd parity */
102#define EVENP 0x00000080 /* get/send even parity */
103#define ANYP 0x000000c0 /* get any parity/send none */
104#define NLDELAY 0x00000300 /* \n delay */
105#define NL0 0x00000000
106#define NL1 0x00000100 /* tty 37 */
107#define NL2 0x00000200 /* vt05 */
108#define NL3 0x00000300
109#define TBDELAY 0x00000c00 /* horizontal tab delay */
110#define TAB0 0x00000000
111#define TAB1 0x00000400 /* tty 37 */
112#define TAB2 0x00000800
113#define XTABS 0x00000c00 /* expand tabs on output */
114#define CRDELAY 0x00003000 /* \r delay */
115#define CR0 0x00000000
116#define CR1 0x00001000 /* tn 300 */
117#define CR2 0x00002000 /* tty 37 */
118#define CR3 0x00003000 /* concept 100 */
119#define VTDELAY 0x00004000 /* vertical tab delay */
120#define FF0 0x00000000
121#define FF1 0x00004000 /* tty 37 */
122#define BSDELAY 0x00008000 /* \b delay */
123#define BS0 0x00000000
124#define BS1 0x00008000
125#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
126#define CRTBS 0x00010000 /* do backspacing for crt */
127#define PRTERA 0x00020000 /* \ ... / erase */
128#define CRTERA 0x00040000 /* " \b " to wipe out char */
129#define TILDE 0x00080000 /* hazeltine tilde kludge */
130#define MDMBUF 0x00100000 /*start/stop output on carrier*/
131#define LITOUT 0x00200000 /* literal output */
132#define TOSTOP 0x00400000 /*SIGSTOP on background output*/
133#define FLUSHO 0x00800000 /* flush output to terminal */
134#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */
135#define L001000 0x02000000
136#define CRTKIL 0x04000000 /* kill line with " \b " */
137#define PASS8 0x08000000
138#define CTLECH 0x10000000 /* echo control chars as ^X */
139#define PENDIN 0x20000000 /* tp->t_rawq needs reread */
140#define DECCTQ 0x40000000 /* only ^Q starts after ^S */
141#define NOFLSH 0x80000000 /* no output flush on signal */
142#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */
143#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */
144#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */
145#define TIOCLGET _IOR('t', 124, int) /* get local modes */
146#define LCRTBS (CRTBS>>16)
147#define LPRTERA (PRTERA>>16)
148#define LCRTERA (CRTERA>>16)
149#define LTILDE (TILDE>>16)
150#define LMDMBUF (MDMBUF>>16)
151#define LLITOUT (LITOUT>>16)
152#define LTOSTOP (TOSTOP>>16)
153#define LFLUSHO (FLUSHO>>16)
154#define LNOHANG (NOHANG>>16)
155#define LCRTKIL (CRTKIL>>16)
156#define LPASS8 (PASS8>>16)
157#define LCTLECH (CTLECH>>16)
158#define LPENDIN (PENDIN>>16)
159#define LDECCTQ (DECCTQ>>16)
160#define LNOFLSH (NOFLSH>>16)
161#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/
162#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/
163#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */
77#define TIOCHPCL _IO('t', 2) /* hang up on last close */
78#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
79#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */
80#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
81#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */
82#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */
83#define TANDEM 0x00000001 /* send stopc on out q full */
84#define CBREAK 0x00000002 /* half-cooked mode */
85#define LCASE 0x00000004 /* simulate lower case */
86#define ECHO 0x00000008 /* echo input */
87#define CRMOD 0x00000010 /* map \r to \r\n on output */
88#define RAW 0x00000020 /* no i/o processing */
89#define ODDP 0x00000040 /* get/send odd parity */
90#define EVENP 0x00000080 /* get/send even parity */
91#define ANYP 0x000000c0 /* get any parity/send none */
92#define NLDELAY 0x00000300 /* \n delay */
93#define NL0 0x00000000
94#define NL1 0x00000100 /* tty 37 */
95#define NL2 0x00000200 /* vt05 */
96#define NL3 0x00000300
97#define TBDELAY 0x00000c00 /* horizontal tab delay */
98#define TAB0 0x00000000
99#define TAB1 0x00000400 /* tty 37 */
100#define TAB2 0x00000800
101#define XTABS 0x00000c00 /* expand tabs on output */
102#define CRDELAY 0x00003000 /* \r delay */
103#define CR0 0x00000000
104#define CR1 0x00001000 /* tn 300 */
105#define CR2 0x00002000 /* tty 37 */
106#define CR3 0x00003000 /* concept 100 */
107#define VTDELAY 0x00004000 /* vertical tab delay */
108#define FF0 0x00000000
109#define FF1 0x00004000 /* tty 37 */
110#define BSDELAY 0x00008000 /* \b delay */
111#define BS0 0x00000000
112#define BS1 0x00008000
113#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
114#define CRTBS 0x00010000 /* do backspacing for crt */
115#define PRTERA 0x00020000 /* \ ... / erase */
116#define CRTERA 0x00040000 /* " \b " to wipe out char */
117#define TILDE 0x00080000 /* hazeltine tilde kludge */
118#define MDMBUF 0x00100000 /*start/stop output on carrier*/
119#define LITOUT 0x00200000 /* literal output */
120#define TOSTOP 0x00400000 /*SIGSTOP on background output*/
121#define FLUSHO 0x00800000 /* flush output to terminal */
122#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */
123#define L001000 0x02000000
124#define CRTKIL 0x04000000 /* kill line with " \b " */
125#define PASS8 0x08000000
126#define CTLECH 0x10000000 /* echo control chars as ^X */
127#define PENDIN 0x20000000 /* tp->t_rawq needs reread */
128#define DECCTQ 0x40000000 /* only ^Q starts after ^S */
129#define NOFLSH 0x80000000 /* no output flush on signal */
130#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */
131#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */
132#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */
133#define TIOCLGET _IOR('t', 124, int) /* get local modes */
134#define LCRTBS (CRTBS>>16)
135#define LPRTERA (PRTERA>>16)
136#define LCRTERA (CRTERA>>16)
137#define LTILDE (TILDE>>16)
138#define LMDMBUF (MDMBUF>>16)
139#define LLITOUT (LITOUT>>16)
140#define LTOSTOP (TOSTOP>>16)
141#define LFLUSHO (FLUSHO>>16)
142#define LNOHANG (NOHANG>>16)
143#define LCRTKIL (CRTKIL>>16)
144#define LPASS8 (PASS8>>16)
145#define LCTLECH (CTLECH>>16)
146#define LPENDIN (PENDIN>>16)
147#define LDECCTQ (DECCTQ>>16)
148#define LNOFLSH (NOFLSH>>16)
149#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/
150#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/
151#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */
152
153#endif /* _KERNEL */
154
155/* XXX publish these so stty(1) can still report them */
164#define OTTYDISC 0
165#define NETLDISC 1
166#define NTTYDISC 2
167
168#endif /* !_SYS_IOCTL_COMPAT_H_ */
156#define OTTYDISC 0
157#define NETLDISC 1
158#define NTTYDISC 2
159
160#endif /* !_SYS_IOCTL_COMPAT_H_ */