xref: /titanic_44/usr/src/lib/libbc/inc/include/sys/ttycom.h (revision ea8dc4b6d2251b437950c0056bc626b311c73c27)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	__sys_ttycom_h
28 #define	__sys_ttycom_h
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifndef	_POSIX_SOURCE
33 
34 /*
35  * Window/terminal size structure.
36  * This information is stored by the kernel
37  * in order to provide a consistent interface,
38  * but is not used by the kernel.
39  *
40  * Type must be "unsigned short" so that types.h not required.
41  */
42 struct winsize {
43 	unsigned short	ws_row;		/* rows, in characters */
44 	unsigned short	ws_col;		/* columns, in characters */
45 	unsigned short	ws_xpixel;	/* horizontal size, pixels - not used */
46 	unsigned short	ws_ypixel;	/* vertical size, pixels - not used */
47 };
48 
49 #define	TIOCGWINSZ	_IOR('t', 104, struct winsize)	/* get window size */
50 #define	TIOCSWINSZ	_IOW('t', 103, struct winsize)	/* set window size */
51 
52 /*
53  * Sun version of same.
54  */
55 struct ttysize {
56 	int	ts_lines;	/* number of lines on terminal */
57 	int	ts_cols;	/* number of columns on terminal */
58 };
59 
60 #define	TIOCSSIZE	_IOW('t',37,struct ttysize)/* set tty size */
61 #define	TIOCGSIZE	_IOR('t',38,struct ttysize)/* get tty size */
62 
63 /*
64  * 4.3BSD and SunOS terminal "ioctl"s with no "termios" equivalents.
65  * This file is included by <sys/termios.h> and indirectly by <sys/ioctl.h>
66  * so that programs that include either one have these "ioctl"s defined.
67  */
68 #define	TIOCSCTTY	_IO('t', 132)		/* get a ctty */
69 #define	TIOCGPGRP	_IOR('t', 119, int)	/* get pgrp of tty */
70 #define	TIOCGETPGRP	_IOR('t', 131, int)	/* get pgrp of tty (posix) */
71 #define	TIOCSPGRP	_IOW('t', 118, int)	/* set pgrp of tty */
72 #define	TIOCSETPGRP	_IOW('t', 130, int)	/* set pgrp of tty (posix) */
73 #define	TIOCOUTQ	_IOR('t', 115, int)	/* output queue size */
74 #define	TIOCSTI		_IOW('t', 114, char)	/* simulate terminal input */
75 #define	TIOCNOTTY	_IO('t', 113)		/* void tty association */
76 #define	TIOCPKT		_IOW('t', 112, int)	/* pty: set/clear packet mode */
77 #define		TIOCPKT_DATA		0x00	/* data packet */
78 #define		TIOCPKT_FLUSHREAD	0x01	/* flush data not yet written to controller */
79 #define		TIOCPKT_FLUSHWRITE	0x02	/* flush data read from controller but not yet processed */
80 #define		TIOCPKT_STOP		0x04	/* stop output */
81 #define		TIOCPKT_START		0x08	/* start output */
82 #define		TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
83 #define		TIOCPKT_DOSTOP		0x20	/* now do ^S, ^Q */
84 #define		TIOCPKT_IOCTL		0x40	/* "ioctl" packet */
85 #define	TIOCMSET	_IOW('t', 109, int)	/* set all modem bits */
86 #define	TIOCMBIS	_IOW('t', 108, int)	/* bis modem bits */
87 #define	TIOCMBIC	_IOW('t', 107, int)	/* bic modem bits */
88 #define	TIOCMGET	_IOR('t', 106, int)	/* get all modem bits */
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 
101 #define	TIOCREMOTE	_IOW('t', 105, int)	/* remote input editing */
102 #define	TIOCUCNTL	_IOW('t', 102, int)	/* pty: set/clr usr cntl mode */
103 
104 /*
105  * Sun-specific ioctls with no "termios" equivalents.
106  */
107 #define	TIOCTCNTL	_IOW('t', 32, int)	/* pty: set/clr intercept ioctl mode */
108 #define	TIOCSIGNAL	_IOW('t', 33, int)	/* pty: send signal to slave */
109 #define	TIOCCONS	_IO('t', 36)		/* get console I/O */
110 #define	TIOCSSOFTCAR	_IOW('t', 101, int)	/* set soft carrier flag */
111 #define	TIOCGSOFTCAR	_IOR('t', 100, int)	/* get soft carrier flag */
112 #define	TIOCISPACE	_IOR('t', 128, int)	/* space left in input queue */
113 #define	TIOCISIZE	_IOR('t', 129, int)	/* size of input queue */
114 
115 #endif	/* !_POSIX_SOURCE */
116 #endif	/* !__sys_ttycom_h */
117