xref: /titanic_44/usr/src/uts/common/sys/strtty.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #ifndef _SYS_STRTTY_H
31*7c478bd9Sstevel@tonic-gate #define	_SYS_STRTTY_H
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
36*7c478bd9Sstevel@tonic-gate extern "C" {
37*7c478bd9Sstevel@tonic-gate #endif
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate /*
40*7c478bd9Sstevel@tonic-gate  * header file for STREAMS TTY subsystem
41*7c478bd9Sstevel@tonic-gate  */
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate /*
44*7c478bd9Sstevel@tonic-gate  * The t_buf data structure holds information about a message
45*7c478bd9Sstevel@tonic-gate  * block and its associated data buffer.  One is used for received
46*7c478bd9Sstevel@tonic-gate  * blocks, and another is used for blocks to be transmitted to
47*7c478bd9Sstevel@tonic-gate  * a user terminal or a printer.
48*7c478bd9Sstevel@tonic-gate  */
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate struct t_buf
51*7c478bd9Sstevel@tonic-gate {
52*7c478bd9Sstevel@tonic-gate 	mblk_t *bu_bp;	/* message block pointer */
53*7c478bd9Sstevel@tonic-gate 	unsigned char *bu_ptr;	/* data buffer pointer */
54*7c478bd9Sstevel@tonic-gate 	ushort_t bu_cnt;	/* data buffer character count */
55*7c478bd9Sstevel@tonic-gate };
56*7c478bd9Sstevel@tonic-gate 
57*7c478bd9Sstevel@tonic-gate /*
58*7c478bd9Sstevel@tonic-gate  * A tty structure is needed for each character device used for normal
59*7c478bd9Sstevel@tonic-gate  * tty I/O.  Each PORTS board supports 4 user terminals and 1 CENTRONICS-
60*7c478bd9Sstevel@tonic-gate  * TYPE printer.
61*7c478bd9Sstevel@tonic-gate  */
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate struct strtty
64*7c478bd9Sstevel@tonic-gate {
65*7c478bd9Sstevel@tonic-gate 	struct t_buf t_in;	/* input buffer info */
66*7c478bd9Sstevel@tonic-gate 	struct t_buf t_out;	/* output buffer info */
67*7c478bd9Sstevel@tonic-gate 	queue_t *t_rdqp;	/* pointer to tty read queue */
68*7c478bd9Sstevel@tonic-gate 	mblk_t  *t_ioctlp;	/* ioctl block pointer */
69*7c478bd9Sstevel@tonic-gate 	mblk_t  *t_lbuf;	/* pointer to a large data buffer */
70*7c478bd9Sstevel@tonic-gate 	int	t_dev;		/* tty minor device number */
71*7c478bd9Sstevel@tonic-gate 	int	t_iflag;	/* input setting  flags */
72*7c478bd9Sstevel@tonic-gate 	int	t_oflag;	/* output setting flags */
73*7c478bd9Sstevel@tonic-gate 	int	t_cflag;	/* physical setting flags */
74*7c478bd9Sstevel@tonic-gate 	int	t_lflag;	/* "line discipline" flags */
75*7c478bd9Sstevel@tonic-gate 	short	t_state;	/* internal state */
76*7c478bd9Sstevel@tonic-gate 	char	t_line;		/* active line discipline */
77*7c478bd9Sstevel@tonic-gate 	char	t_dstat;	/* more internal state flags */
78*7c478bd9Sstevel@tonic-gate 	unsigned char t_cc[NCCS]; /* settable control chars */
79*7c478bd9Sstevel@tonic-gate };
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate /*
82*7c478bd9Sstevel@tonic-gate  * Size of internal ports data buffer, one per port
83*7c478bd9Sstevel@tonic-gate  */
84*7c478bd9Sstevel@tonic-gate #define	LARGEBUFSZ	512
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate #define	TTIPRI	28
87*7c478bd9Sstevel@tonic-gate #define	TTOPRI	29
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate /* Internal state */
90*7c478bd9Sstevel@tonic-gate #define	TIMEOUT	01		/* Delay timeout in progress */
91*7c478bd9Sstevel@tonic-gate #define	WOPEN	02		/* Waiting for open to complete */
92*7c478bd9Sstevel@tonic-gate #define	ISOPEN	04		/* Device is open */
93*7c478bd9Sstevel@tonic-gate #define	TBLOCK	010
94*7c478bd9Sstevel@tonic-gate #define	CARR_ON	020		/* Software copy of carrier-present */
95*7c478bd9Sstevel@tonic-gate #define	BUSY	040		/* Output in progress */
96*7c478bd9Sstevel@tonic-gate #define	WIOC	0100		/* Wait for ioctl to complete */
97*7c478bd9Sstevel@tonic-gate #define	WGETTY	0200		/* opened by supergetty, waiting for getty */
98*7c478bd9Sstevel@tonic-gate #define	TTSTOP	0400		/* Output stopped by ctl-s */
99*7c478bd9Sstevel@tonic-gate #define	EXTPROC	01000		/* External processing */
100*7c478bd9Sstevel@tonic-gate #define	TACT	02000
101*7c478bd9Sstevel@tonic-gate #define	CLESC	04000		/* Last char escape */
102*7c478bd9Sstevel@tonic-gate #define	RTO	010000		/* Raw Timeout */
103*7c478bd9Sstevel@tonic-gate #define	TTIOW	020000
104*7c478bd9Sstevel@tonic-gate #define	TTXON	040000
105*7c478bd9Sstevel@tonic-gate #define	TTXOFF	0100000
106*7c478bd9Sstevel@tonic-gate 
107*7c478bd9Sstevel@tonic-gate /* l_output status */
108*7c478bd9Sstevel@tonic-gate #define	CPRES	0100000
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate /* device commands */
111*7c478bd9Sstevel@tonic-gate #define	T_OUTPUT	0
112*7c478bd9Sstevel@tonic-gate #define	T_TIME		1
113*7c478bd9Sstevel@tonic-gate #define	T_SUSPEND	2
114*7c478bd9Sstevel@tonic-gate #define	T_RESUME	3
115*7c478bd9Sstevel@tonic-gate #define	T_BLOCK		4
116*7c478bd9Sstevel@tonic-gate #define	T_UNBLOCK	5
117*7c478bd9Sstevel@tonic-gate #define	T_RFLUSH	6
118*7c478bd9Sstevel@tonic-gate #define	T_WFLUSH	7
119*7c478bd9Sstevel@tonic-gate #define	T_BREAK		8
120*7c478bd9Sstevel@tonic-gate #define	T_INPUT		9
121*7c478bd9Sstevel@tonic-gate #define	T_DISCONNECT	10
122*7c478bd9Sstevel@tonic-gate #define	T_PARM		11
123*7c478bd9Sstevel@tonic-gate #define	T_SWTCH		12
124*7c478bd9Sstevel@tonic-gate /*
125*7c478bd9Sstevel@tonic-gate  * M_CTL message types.
126*7c478bd9Sstevel@tonic-gate  */
127*7c478bd9Sstevel@tonic-gate #define	MC_NO_CANON	0	/* module below saying it will canonicalize */
128*7c478bd9Sstevel@tonic-gate #define	MC_DO_CANON	1	/* module below saying it won't canonicalize */
129*7c478bd9Sstevel@tonic-gate #define	MC_CANONQUERY	2	/* module above asking whether module below */
130*7c478bd9Sstevel@tonic-gate 				/* canonicalizes */
131*7c478bd9Sstevel@tonic-gate #define	MC_PART_CANON	3	/* tell line discipline to do some */
132*7c478bd9Sstevel@tonic-gate 				/* canonicalization */
133*7c478bd9Sstevel@tonic-gate /* XXX - These seem pretty device dependent... */
134*7c478bd9Sstevel@tonic-gate #define	MC_SERVICEIMM	3	/* tell the ZS driver to return input */
135*7c478bd9Sstevel@tonic-gate 				/* immediately */
136*7c478bd9Sstevel@tonic-gate #define	MC_SERVICEDEF	4	/* tell the ZS driver it can wait */
137*7c478bd9Sstevel@tonic-gate #define	MC_POSIXQUERY	5	/* check if driver has POSIX close semantics */
138*7c478bd9Sstevel@tonic-gate #define	MC_HAS_POSIX	6	/* driver does support POSIX */
139*7c478bd9Sstevel@tonic-gate 
140*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
141*7c478bd9Sstevel@tonic-gate }
142*7c478bd9Sstevel@tonic-gate #endif
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_STRTTY_H */
145