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