]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/ttycom.h
xnu-2782.20.48.tar.gz
[apple/xnu.git] / bsd / sys / ttycom.h
1 /*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */
29 /*-
30 * Copyright (c) 1982, 1986, 1990, 1993, 1994
31 * The Regents of the University of California. All rights reserved.
32 * (c) UNIX System Laboratories, Inc.
33 * All or some portions of this file are derived from material licensed
34 * to the University of California by American Telephone and Telegraph
35 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
36 * the permission of UNIX System Laboratories, Inc.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 * @(#)ttycom.h 8.1 (Berkeley) 3/28/94
67 */
68
69 #ifndef _SYS_TTYCOM_H_
70 #define _SYS_TTYCOM_H_
71
72 #include <sys/ioccom.h>
73
74 /*
75 * Tty ioctl's except for those supported only for backwards compatibility
76 * with the old tty driver.
77 */
78
79 /*
80 * Window/terminal size structure. This information is stored by the kernel
81 * in order to provide a consistent interface, but is not used by the kernel.
82 */
83 struct winsize {
84 unsigned short ws_row; /* rows, in characters */
85 unsigned short ws_col; /* columns, in characters */
86 unsigned short ws_xpixel; /* horizontal size, pixels */
87 unsigned short ws_ypixel; /* vertical size, pixels */
88 };
89
90 #define TIOCMODG _IOR('t', 3, int) /* get modem control state */
91 #define TIOCMODS _IOW('t', 4, int) /* set modem control state */
92 #define TIOCM_LE 0001 /* line enable */
93 #define TIOCM_DTR 0002 /* data terminal ready */
94 #define TIOCM_RTS 0004 /* request to send */
95 #define TIOCM_ST 0010 /* secondary transmit */
96 #define TIOCM_SR 0020 /* secondary receive */
97 #define TIOCM_CTS 0040 /* clear to send */
98 #define TIOCM_CAR 0100 /* carrier detect */
99 #define TIOCM_CD TIOCM_CAR
100 #define TIOCM_RNG 0200 /* ring */
101 #define TIOCM_RI TIOCM_RNG
102 #define TIOCM_DSR 0400 /* data set ready */
103 /* 8-10 compat */
104 #define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
105 #define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
106 /* 15 unused */
107 #define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */
108 /* 17-18 compat */
109 #define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */
110 #define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */
111 #define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */
112 #define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */
113 #ifdef KERNEL
114 #define TIOCGETA_32 _IOR('t', 19, struct termios32) /* get termios struct */
115 #define TIOCSETA_32 _IOW('t', 20, struct termios32) /* set termios struct */
116 #define TIOCSETAW_32 _IOW('t', 21, struct termios32) /* drain output, set */
117 #define TIOCSETAF_32 _IOW('t', 22, struct termios32) /* drn out, fls in, set */
118 #define TIOCGETA_64 _IOR('t', 19, struct user_termios)
119 #define TIOCSETA_64 _IOW('t', 20, struct user_termios)
120 #define TIOCSETAW_64 _IOW('t', 21, struct user_termios)
121 #define TIOCSETAF_64 _IOW('t', 22, struct user_termios)
122 #endif /* KERNEL */
123 #define TIOCGETD _IOR('t', 26, int) /* get line discipline */
124 #define TIOCSETD _IOW('t', 27, int) /* set line discipline */
125 #define TIOCIXON _IO('t', 129) /* internal input VSTART */
126 #define TIOCIXOFF _IO('t', 128) /* internal input VSTOP */
127 /* 127-124 compat */
128 #define TIOCSBRK _IO('t', 123) /* set break bit */
129 #define TIOCCBRK _IO('t', 122) /* clear break bit */
130 #define TIOCSDTR _IO('t', 121) /* set data terminal ready */
131 #define TIOCCDTR _IO('t', 120) /* clear data terminal ready */
132 #define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
133 #define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
134 /* 117-116 compat */
135 #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
136 #define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */
137 #define TIOCNOTTY _IO('t', 113) /* void tty association */
138 #define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */
139 #define TIOCPKT_DATA 0x00 /* data packet */
140 #define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
141 #define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
142 #define TIOCPKT_STOP 0x04 /* stop output */
143 #define TIOCPKT_START 0x08 /* start output */
144 #define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
145 #define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
146 #define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
147 #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
148 #define TIOCSTART _IO('t', 110) /* start output, like ^Q */
149 #define TIOCMSET _IOW('t', 109, int) /* set all modem bits */
150 #define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */
151 #define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */
152 #define TIOCMGET _IOR('t', 106, int) /* get all modem bits */
153 #define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */
154 #define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
155 #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
156 #define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */
157 #define TIOCSTAT _IO('t', 101) /* simulate ^T status message */
158 #define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */
159 #define TIOCSCONS _IO('t', 99) /* 4.2 compatibility */
160 #define TIOCCONS _IOW('t', 98, int) /* become virtual console */
161 #define TIOCSCTTY _IO('t', 97) /* become controlling tty */
162 #define TIOCEXT _IOW('t', 96, int) /* pty: external processing */
163 #define TIOCSIG _IO('t', 95) /* pty: generate signal */
164 #define TIOCDRAIN _IO('t', 94) /* wait till output drained */
165 #define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */
166 #define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */
167 #define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp
168 * of last input event */
169 #define TIOCDCDTIMESTAMP _IOR('t', 88, struct timeval) /* enable/get timestamp
170 * of last DCd rise */
171 #ifdef KERNEL
172 #define TIOCTIMESTAMP_32 _IOR('t', 89, struct user32_timeval)
173 #define TIOCDCDTIMESTAMP_32 _IOR('t', 88, struct user32_timeval)
174 #define TIOCTIMESTAMP_64 _IOR('t', 89, struct user64_timeval)
175 #define TIOCDCDTIMESTAMP_64 _IOR('t', 88, struct user64_timeval)
176 #endif
177 #define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
178 #define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
179 #define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to
180 * DSI Softmodem */
181 #define TIOCPTYGRANT _IO('t', 84) /* grantpt(3) */
182 #define TIOCPTYGNAME _IOC(IOC_OUT, 't', 83, 128) /* ptsname(3) */
183 #define TIOCPTYUNLK _IO('t', 82) /* unlockpt(3) */
184
185 #define TTYDISC 0 /* termios tty line discipline */
186 #define TABLDISC 3 /* tablet discipline */
187 #define SLIPDISC 4 /* serial IP discipline */
188 #define PPPDISC 5 /* PPP discipline */
189
190 #endif /* !_SYS_TTYCOM_H_ */