xref: /onnv-gate/usr/src/lib/libbc/inc/include/sys/ttold.h (revision 722:636b850d4ee9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*722Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*      Copyright (c) 1984 AT&T */
280Sstevel@tonic-gate /*        All Rights Reserved   */
290Sstevel@tonic-gate 
30*722Smuffin #ifndef _sys_ttold_h
31*722Smuffin #define	_sys_ttold_h
320Sstevel@tonic-gate 
33*722Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
340Sstevel@tonic-gate 
350Sstevel@tonic-gate struct tchars {
360Sstevel@tonic-gate 	char	t_intrc;	/* interrupt */
370Sstevel@tonic-gate 	char	t_quitc;	/* quit */
380Sstevel@tonic-gate 	char	t_startc;	/* start output */
390Sstevel@tonic-gate 	char	t_stopc;	/* stop output */
400Sstevel@tonic-gate 	char	t_eofc;		/* end-of-file */
410Sstevel@tonic-gate 	char	t_brkc;		/* input delimiter (like nl) */
420Sstevel@tonic-gate };
430Sstevel@tonic-gate 
440Sstevel@tonic-gate struct ltchars {
450Sstevel@tonic-gate 	char	t_suspc;	/* stop process signal */
460Sstevel@tonic-gate 	char	t_dsuspc;	/* delayed stop process signal */
470Sstevel@tonic-gate 	char	t_rprntc;	/* reprint line */
480Sstevel@tonic-gate 	char	t_flushc;	/* flush output (toggles) */
490Sstevel@tonic-gate 	char	t_werasc;	/* word erase */
500Sstevel@tonic-gate 	char	t_lnextc;	/* literal next character */
510Sstevel@tonic-gate };
520Sstevel@tonic-gate 
530Sstevel@tonic-gate /*
540Sstevel@tonic-gate  * Structure for TIOCGETP and TIOCSETP ioctls.
550Sstevel@tonic-gate  */
560Sstevel@tonic-gate 
570Sstevel@tonic-gate #ifndef _SGTTYB_
580Sstevel@tonic-gate #define _SGTTYB_
590Sstevel@tonic-gate struct	sgttyb {
600Sstevel@tonic-gate 	char	sg_ispeed;		/* input speed */
610Sstevel@tonic-gate 	char	sg_ospeed;		/* output speed */
620Sstevel@tonic-gate 	char	sg_erase;		/* erase character */
630Sstevel@tonic-gate 	char	sg_kill;		/* kill character */
640Sstevel@tonic-gate 	short	sg_flags;		/* mode flags */
650Sstevel@tonic-gate };
660Sstevel@tonic-gate #endif
670Sstevel@tonic-gate 
680Sstevel@tonic-gate #include <sys/ioccom.h>
690Sstevel@tonic-gate 
700Sstevel@tonic-gate /*
710Sstevel@tonic-gate  * 4.3BSD tty ioctl commands that are either:
720Sstevel@tonic-gate  *  1) deprecated
730Sstevel@tonic-gate  *  2) not implemented (and never were implemented)
740Sstevel@tonic-gate  *  3) implemented on top of new-style "ioctl"s.
750Sstevel@tonic-gate  */
76*722Smuffin #define	TIOCGETD	_IOR('t', 0, int)		/* get line discipline */
77*722Smuffin #define	TIOCSETD	_IOW('t', 1, int)		/* set line discipline */
78*722Smuffin #define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
79*722Smuffin #define	TIOCMODG	_IOR('t', 3, int)		/* get modem state - OBSOLETE */
80*722Smuffin #define	TIOCMODS	_IOW('t', 4, int)		/* set modem state - OBSOLETE */
81*722Smuffin #define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
82*722Smuffin #define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
83*722Smuffin #define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty */
84*722Smuffin #define	TIOCEXCL	_IO('t', 13)		/* set exclusive use of tty */
85*722Smuffin #define	TIOCNXCL	_IO('t', 14)		/* reset exclusive use of tty */
86*722Smuffin #define	TIOCFLUSH	_IOW('t', 16, int)	/* flush buffers */
87*722Smuffin #define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
88*722Smuffin #define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
890Sstevel@tonic-gate #define		O_TANDEM	0x00000001	/* send stopc on out q full */
900Sstevel@tonic-gate #define		O_CBREAK	0x00000002	/* half-cooked mode */
910Sstevel@tonic-gate #define		O_LCASE		0x00000004	/* simulate lower case */
920Sstevel@tonic-gate #define		O_ECHO		0x00000008	/* echo input */
930Sstevel@tonic-gate #define		O_CRMOD		0x00000010	/* map \r to \r\n on output */
940Sstevel@tonic-gate #define		O_RAW		0x00000020	/* no i/o processing */
950Sstevel@tonic-gate #define		O_ODDP		0x00000040	/* get/send odd parity */
960Sstevel@tonic-gate #define		O_EVENP		0x00000080	/* get/send even parity */
970Sstevel@tonic-gate #define		O_ANYP		0x000000c0	/* get any parity/send none */
980Sstevel@tonic-gate #define		O_NLDELAY	0x00000300	/* \n delay */
990Sstevel@tonic-gate #define			O_NL0	0x00000000
1000Sstevel@tonic-gate #define			O_NL1	0x00000100	/* tty 37 */
1010Sstevel@tonic-gate #define			O_NL2	0x00000200	/* vt05 */
1020Sstevel@tonic-gate #define			O_NL3	0x00000300
1030Sstevel@tonic-gate #define		O_TBDELAY	0x00000c00	/* horizontal tab delay */
1040Sstevel@tonic-gate #define			O_TAB0	0x00000000
1050Sstevel@tonic-gate #define			O_TAB1	0x00000400	/* tty 37 */
1060Sstevel@tonic-gate #define			O_TAB2	0x00000800
1070Sstevel@tonic-gate #define		O_XTABS		0x00000c00	/* expand tabs on output */
1080Sstevel@tonic-gate #define		O_CRDELAY	0x00003000	/* \r delay */
1090Sstevel@tonic-gate #define			O_CR0	0x00000000
1100Sstevel@tonic-gate #define			O_CR1	0x00001000	/* tn 300 */
1110Sstevel@tonic-gate #define			O_CR2	0x00002000	/* tty 37 */
1120Sstevel@tonic-gate #define			O_CR3	0x00003000	/* concept 100 */
1130Sstevel@tonic-gate #define		O_VTDELAY	0x00004000	/* vertical tab delay */
1140Sstevel@tonic-gate #define			O_FF0	0x00000000
1150Sstevel@tonic-gate #define			O_FF1	0x00004000	/* tty 37 */
1160Sstevel@tonic-gate #define		O_BSDELAY	0x00008000	/* \b delay */
1170Sstevel@tonic-gate #define			O_BS0	0x00000000
1180Sstevel@tonic-gate #define			O_BS1	0x00008000
1190Sstevel@tonic-gate #define 	O_ALLDELAY	(O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY)
1200Sstevel@tonic-gate #define		O_CRTBS		0x00010000	/* do backspacing for crt */
1210Sstevel@tonic-gate #define		O_PRTERA	0x00020000	/* \ ... / erase */
1220Sstevel@tonic-gate #define		O_CRTERA	0x00040000	/* " \b " to wipe out char */
1230Sstevel@tonic-gate #define		O_TILDE		0x00080000	/* hazeltine tilde kludge */
1240Sstevel@tonic-gate #define		O_MDMBUF	0x00100000	/* start/stop output on carrier intr */
1250Sstevel@tonic-gate #define		O_LITOUT	0x00200000	/* literal output */
1260Sstevel@tonic-gate #define		O_TOSTOP	0x00400000	/* SIGSTOP on background output */
1270Sstevel@tonic-gate #define		O_FLUSHO	0x00800000	/* flush output to terminal */
1280Sstevel@tonic-gate #define		O_NOHANG	0x01000000	/* no SIGHUP on carrier drop */
1290Sstevel@tonic-gate #define		O_L001000	0x02000000
1300Sstevel@tonic-gate #define		O_CRTKIL	0x04000000	/* kill line with " \b " */
1310Sstevel@tonic-gate #define		O_PASS8		0x08000000
1320Sstevel@tonic-gate #define		O_CTLECH	0x10000000	/* echo control chars as ^X */
1330Sstevel@tonic-gate #define		O_PENDIN	0x20000000	/* tp->t_rawq needs reread */
1340Sstevel@tonic-gate #define		O_DECCTQ	0x40000000	/* only ^Q starts after ^S */
1350Sstevel@tonic-gate #define		O_NOFLSH	0x80000000	/* no output flush on signal */
1360Sstevel@tonic-gate /* locals, from 127 down */
137*722Smuffin #define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
138*722Smuffin #define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
139*722Smuffin #define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
140*722Smuffin #define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
1410Sstevel@tonic-gate #define		LCRTBS		(O_CRTBS>>16)
1420Sstevel@tonic-gate #define		LPRTERA		(O_PRTERA>>16)
1430Sstevel@tonic-gate #define		LCRTERA		(O_CRTERA>>16)
1440Sstevel@tonic-gate #define		LTILDE		(O_TILDE>>16)
1450Sstevel@tonic-gate #define		LMDMBUF		(O_MDMBUF>>16)
1460Sstevel@tonic-gate #define		LLITOUT		(O_LITOUT>>16)
1470Sstevel@tonic-gate #define		LTOSTOP		(O_TOSTOP>>16)
1480Sstevel@tonic-gate #define		LFLUSHO		(O_FLUSHO>>16)
1490Sstevel@tonic-gate #define		LNOHANG		(O_NOHANG>>16)
1500Sstevel@tonic-gate #define		LCRTKIL		(O_CRTKIL>>16)
1510Sstevel@tonic-gate #define		LPASS8		(O_PASS8>>16)
1520Sstevel@tonic-gate #define		LCTLECH		(O_CTLECH>>16)
1530Sstevel@tonic-gate #define		LPENDIN		(O_PENDIN>>16)
1540Sstevel@tonic-gate #define		LDECCTQ		(O_DECCTQ>>16)
1550Sstevel@tonic-gate #define		LNOFLSH		(O_NOFLSH>>16)
156*722Smuffin #define	TIOCSBRK	_IO('t', 123)		/* set break bit */
157*722Smuffin #define	TIOCCBRK	_IO('t', 122)		/* clear break bit */
158*722Smuffin #define	TIOCSDTR	_IO('t', 121)		/* set data terminal ready */
159*722Smuffin #define	TIOCCDTR	_IO('t', 120)		/* clear data terminal ready */
160*722Smuffin #define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars */
161*722Smuffin #define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars */
162*722Smuffin #define	TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */
163*722Smuffin #define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
1640Sstevel@tonic-gate 
1650Sstevel@tonic-gate /*
1660Sstevel@tonic-gate  * Sun-specific ioctls, which have been moved to the Sun-specific range.
1670Sstevel@tonic-gate  * The old codes will be kept around for binary compatibility; the
1680Sstevel@tonic-gate  * codes for TIOCCONS and TIOCGSIZE don't collide with the 4.3BSD codes
1690Sstevel@tonic-gate  * because the structure size and copy direction fields are different.
1700Sstevel@tonic-gate  * Unfortunately, the old TIOCSSIZE code does collide with TIOCSWINSZ,
1710Sstevel@tonic-gate  * but they can be disambiguated by checking whether a "struct ttysize"
1720Sstevel@tonic-gate  * structure's "ts_lines" field is greater than 64K or not.  If so,
1730Sstevel@tonic-gate  * it's almost certainly a "struct winsize" instead.
1740Sstevel@tonic-gate  */
175*722Smuffin #define	_O_TIOCCONS	_IO('t', 104)		/* get console I/O */
176*722Smuffin #define	_O_TIOCSSIZE	_IOW('t',103,struct ttysize)/* get tty size */
177*722Smuffin #define	_O_TIOCGSIZE	_IOR('t',102,struct ttysize)/* get tty size */
1780Sstevel@tonic-gate 
1790Sstevel@tonic-gate /*
1800Sstevel@tonic-gate  * Sun-specific ioctls.
1810Sstevel@tonic-gate  */
182*722Smuffin #define	TIOCSETX	_IOW('t', 34, int)	/* set extra modes for S5 compatibility */
183*722Smuffin #define	TIOCGETX	_IOR('t', 35, int)	/* get extra modes for S5 compatibility */
1840Sstevel@tonic-gate #define		NOPOST		0x00000001	/* no processing on output (LITOUT with 7 bits + parity) */
1850Sstevel@tonic-gate #define		NOISIG		0x00000002	/* disable all signal-generating characters */
1860Sstevel@tonic-gate #define		STOPB		0x00000004	/* two stop bits */
1870Sstevel@tonic-gate 
1880Sstevel@tonic-gate #define	OTTYDISC	0		/* old, v7 std tty driver */
1890Sstevel@tonic-gate #define	NETLDISC	1		/* line discip for berk net */
1900Sstevel@tonic-gate #define	NTTYDISC	2		/* new tty discipline */
1910Sstevel@tonic-gate #define	TABLDISC	3		/* hitachi tablet discipline */
1920Sstevel@tonic-gate #define	NTABLDISC	4		/* gtco tablet discipline */
1930Sstevel@tonic-gate #define	MOUSELDISC	5		/* mouse discipline */
1940Sstevel@tonic-gate #define	KBDLDISC	6		/* up/down keyboard trans (console) */
1950Sstevel@tonic-gate 
1960Sstevel@tonic-gate #include <sys/ttycom.h>
1970Sstevel@tonic-gate 
198*722Smuffin #endif /* !_sys_ttold_h */
199