xref: /titanic_51/usr/src/lib/libbc/inc/include/sys/ttold.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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 /*      Copyright (c) 1984 AT&T */
28 /*        All Rights Reserved   */
29 
30 #ifndef _sys_ttold_h
31 #define	_sys_ttold_h
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 struct tchars {
36 	char	t_intrc;	/* interrupt */
37 	char	t_quitc;	/* quit */
38 	char	t_startc;	/* start output */
39 	char	t_stopc;	/* stop output */
40 	char	t_eofc;		/* end-of-file */
41 	char	t_brkc;		/* input delimiter (like nl) */
42 };
43 
44 struct ltchars {
45 	char	t_suspc;	/* stop process signal */
46 	char	t_dsuspc;	/* delayed stop process signal */
47 	char	t_rprntc;	/* reprint line */
48 	char	t_flushc;	/* flush output (toggles) */
49 	char	t_werasc;	/* word erase */
50 	char	t_lnextc;	/* literal next character */
51 };
52 
53 /*
54  * Structure for TIOCGETP and TIOCSETP ioctls.
55  */
56 
57 #ifndef _SGTTYB_
58 #define _SGTTYB_
59 struct	sgttyb {
60 	char	sg_ispeed;		/* input speed */
61 	char	sg_ospeed;		/* output speed */
62 	char	sg_erase;		/* erase character */
63 	char	sg_kill;		/* kill character */
64 	short	sg_flags;		/* mode flags */
65 };
66 #endif
67 
68 #include <sys/ioccom.h>
69 
70 /*
71  * 4.3BSD tty ioctl commands that are either:
72  *  1) deprecated
73  *  2) not implemented (and never were implemented)
74  *  3) implemented on top of new-style "ioctl"s.
75  */
76 #define	TIOCGETD	_IOR('t', 0, int)		/* get line discipline */
77 #define	TIOCSETD	_IOW('t', 1, int)		/* set line discipline */
78 #define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
79 #define	TIOCMODG	_IOR('t', 3, int)		/* get modem state - OBSOLETE */
80 #define	TIOCMODS	_IOW('t', 4, int)		/* set modem state - OBSOLETE */
81 #define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
82 #define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
83 #define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty */
84 #define	TIOCEXCL	_IO('t', 13)		/* set exclusive use of tty */
85 #define	TIOCNXCL	_IO('t', 14)		/* reset exclusive use of tty */
86 #define	TIOCFLUSH	_IOW('t', 16, int)	/* flush buffers */
87 #define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
88 #define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
89 #define		O_TANDEM	0x00000001	/* send stopc on out q full */
90 #define		O_CBREAK	0x00000002	/* half-cooked mode */
91 #define		O_LCASE		0x00000004	/* simulate lower case */
92 #define		O_ECHO		0x00000008	/* echo input */
93 #define		O_CRMOD		0x00000010	/* map \r to \r\n on output */
94 #define		O_RAW		0x00000020	/* no i/o processing */
95 #define		O_ODDP		0x00000040	/* get/send odd parity */
96 #define		O_EVENP		0x00000080	/* get/send even parity */
97 #define		O_ANYP		0x000000c0	/* get any parity/send none */
98 #define		O_NLDELAY	0x00000300	/* \n delay */
99 #define			O_NL0	0x00000000
100 #define			O_NL1	0x00000100	/* tty 37 */
101 #define			O_NL2	0x00000200	/* vt05 */
102 #define			O_NL3	0x00000300
103 #define		O_TBDELAY	0x00000c00	/* horizontal tab delay */
104 #define			O_TAB0	0x00000000
105 #define			O_TAB1	0x00000400	/* tty 37 */
106 #define			O_TAB2	0x00000800
107 #define		O_XTABS		0x00000c00	/* expand tabs on output */
108 #define		O_CRDELAY	0x00003000	/* \r delay */
109 #define			O_CR0	0x00000000
110 #define			O_CR1	0x00001000	/* tn 300 */
111 #define			O_CR2	0x00002000	/* tty 37 */
112 #define			O_CR3	0x00003000	/* concept 100 */
113 #define		O_VTDELAY	0x00004000	/* vertical tab delay */
114 #define			O_FF0	0x00000000
115 #define			O_FF1	0x00004000	/* tty 37 */
116 #define		O_BSDELAY	0x00008000	/* \b delay */
117 #define			O_BS0	0x00000000
118 #define			O_BS1	0x00008000
119 #define 	O_ALLDELAY	(O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY)
120 #define		O_CRTBS		0x00010000	/* do backspacing for crt */
121 #define		O_PRTERA	0x00020000	/* \ ... / erase */
122 #define		O_CRTERA	0x00040000	/* " \b " to wipe out char */
123 #define		O_TILDE		0x00080000	/* hazeltine tilde kludge */
124 #define		O_MDMBUF	0x00100000	/* start/stop output on carrier intr */
125 #define		O_LITOUT	0x00200000	/* literal output */
126 #define		O_TOSTOP	0x00400000	/* SIGSTOP on background output */
127 #define		O_FLUSHO	0x00800000	/* flush output to terminal */
128 #define		O_NOHANG	0x01000000	/* no SIGHUP on carrier drop */
129 #define		O_L001000	0x02000000
130 #define		O_CRTKIL	0x04000000	/* kill line with " \b " */
131 #define		O_PASS8		0x08000000
132 #define		O_CTLECH	0x10000000	/* echo control chars as ^X */
133 #define		O_PENDIN	0x20000000	/* tp->t_rawq needs reread */
134 #define		O_DECCTQ	0x40000000	/* only ^Q starts after ^S */
135 #define		O_NOFLSH	0x80000000	/* no output flush on signal */
136 /* locals, from 127 down */
137 #define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
138 #define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
139 #define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
140 #define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
141 #define		LCRTBS		(O_CRTBS>>16)
142 #define		LPRTERA		(O_PRTERA>>16)
143 #define		LCRTERA		(O_CRTERA>>16)
144 #define		LTILDE		(O_TILDE>>16)
145 #define		LMDMBUF		(O_MDMBUF>>16)
146 #define		LLITOUT		(O_LITOUT>>16)
147 #define		LTOSTOP		(O_TOSTOP>>16)
148 #define		LFLUSHO		(O_FLUSHO>>16)
149 #define		LNOHANG		(O_NOHANG>>16)
150 #define		LCRTKIL		(O_CRTKIL>>16)
151 #define		LPASS8		(O_PASS8>>16)
152 #define		LCTLECH		(O_CTLECH>>16)
153 #define		LPENDIN		(O_PENDIN>>16)
154 #define		LDECCTQ		(O_DECCTQ>>16)
155 #define		LNOFLSH		(O_NOFLSH>>16)
156 #define	TIOCSBRK	_IO('t', 123)		/* set break bit */
157 #define	TIOCCBRK	_IO('t', 122)		/* clear break bit */
158 #define	TIOCSDTR	_IO('t', 121)		/* set data terminal ready */
159 #define	TIOCCDTR	_IO('t', 120)		/* clear data terminal ready */
160 #define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars */
161 #define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars */
162 #define	TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */
163 #define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
164 
165 /*
166  * Sun-specific ioctls, which have been moved to the Sun-specific range.
167  * The old codes will be kept around for binary compatibility; the
168  * codes for TIOCCONS and TIOCGSIZE don't collide with the 4.3BSD codes
169  * because the structure size and copy direction fields are different.
170  * Unfortunately, the old TIOCSSIZE code does collide with TIOCSWINSZ,
171  * but they can be disambiguated by checking whether a "struct ttysize"
172  * structure's "ts_lines" field is greater than 64K or not.  If so,
173  * it's almost certainly a "struct winsize" instead.
174  */
175 #define	_O_TIOCCONS	_IO('t', 104)		/* get console I/O */
176 #define	_O_TIOCSSIZE	_IOW('t',103,struct ttysize)/* get tty size */
177 #define	_O_TIOCGSIZE	_IOR('t',102,struct ttysize)/* get tty size */
178 
179 /*
180  * Sun-specific ioctls.
181  */
182 #define	TIOCSETX	_IOW('t', 34, int)	/* set extra modes for S5 compatibility */
183 #define	TIOCGETX	_IOR('t', 35, int)	/* get extra modes for S5 compatibility */
184 #define		NOPOST		0x00000001	/* no processing on output (LITOUT with 7 bits + parity) */
185 #define		NOISIG		0x00000002	/* disable all signal-generating characters */
186 #define		STOPB		0x00000004	/* two stop bits */
187 
188 #define	OTTYDISC	0		/* old, v7 std tty driver */
189 #define	NETLDISC	1		/* line discip for berk net */
190 #define	NTTYDISC	2		/* new tty discipline */
191 #define	TABLDISC	3		/* hitachi tablet discipline */
192 #define	NTABLDISC	4		/* gtco tablet discipline */
193 #define	MOUSELDISC	5		/* mouse discipline */
194 #define	KBDLDISC	6		/* up/down keyboard trans (console) */
195 
196 #include <sys/ttycom.h>
197 
198 #endif /* !_sys_ttold_h */
199