xref: /titanic_41/usr/src/uts/common/sys/ttcompat.h (revision d58fda4376e4bf67072ce2e69f6f47036f9dbb68)
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 1997 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 #ifndef	_SYS_TTCOMPAT_H
31 #define	_SYS_TTCOMPAT_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * BSD/XENIX/V7 ttcompat module header file
41  */
42 
43 /*
44  * Old-style terminal state.
45  */
46 typedef struct {
47 	int	t_flags;		/* flags */
48 	char	t_ispeed, t_ospeed;	/* speeds */
49 	char	t_erase;		/* erase last character */
50 	char	t_kill;			/* erase entire line */
51 	char	t_intrc;		/* interrupt */
52 	char	t_quitc;		/* quit */
53 	char	t_startc;		/* start output */
54 	char	t_stopc;		/* stop output */
55 	char	t_eofc;			/* end-of-file */
56 	char	t_brkc;			/* input delimiter (like nl) */
57 	char	t_suspc;		/* stop process signal */
58 	char	t_dsuspc;		/* delayed stop process signal */
59 	char	t_rprntc;		/* reprint line */
60 	char	t_flushc;		/* flush output (toggles) */
61 	char	t_werasc;		/* word erase */
62 	char	t_lnextc;		/* literal next character */
63 	int	t_xflags;		/* XXX extended flags */
64 } compat_state_t;
65 
66 /*
67  * Per-tty structure.
68  */
69 typedef struct {
70 	mblk_t	*t_iocpending;		/* ioctl pending successful */
71 					/* allocation */
72 	compat_state_t t_curstate;	/* current emulated state */
73 	struct sgttyb t_new_sgttyb;	/* new sgttyb from TIOCSET[PN] */
74 	struct tchars t_new_tchars;	/* new tchars from TIOCSETC */
75 	struct ltchars t_new_ltchars;	/* new ltchars from TIOCSLTC */
76 	int	t_new_lflags;		/* new lflags from TIOCLSET/LBIS/LBIC */
77 	int	t_state;		/* state bits */
78 	int	t_iocid;		/* ID of "ioctl" we handle specially */
79 	int	t_ioccmd;		/* ioctl code for that "ioctl" */
80 	bufcall_id_t t_bufcallid;	/* ID from qbufcall */
81 	intptr_t t_arg;			/* third argument to ioctl */
82 } ttcompat_state_t;
83 
84 
85 #define	TS_FREE	 0x00	/* not in use */
86 #define	TS_INUSE 0x01	/* allocated */
87 #define	TS_W_IN	 0x02	/* waiting for an M_IOCDATA response to an */
88 			/* M_COPYIN request */
89 #define	TS_W_OUT 0x04	/* waiting for an M_IOCDATA response to an */
90 			/* M_COPYOUT request */
91 #define	TS_IOCWAIT 0x08	/* waiting for an M_IOCACK/M_IOCNAK from downstream */
92 
93 #ifdef	__cplusplus
94 }
95 #endif
96 
97 #endif	/* _SYS_TTCOMPAT_H */
98