xref: /titanic_51/usr/src/lib/libbc/inc/include/sys/ttold.h (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*5d54f3d8Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*      Copyright (c) 1984 AT&T */
287c478bd9Sstevel@tonic-gate /*        All Rights Reserved   */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _sys_ttold_h
317c478bd9Sstevel@tonic-gate #define	_sys_ttold_h
327c478bd9Sstevel@tonic-gate 
33*5d54f3d8Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*5d54f3d8Smuffin 
357c478bd9Sstevel@tonic-gate struct tchars {
367c478bd9Sstevel@tonic-gate 	char	t_intrc;	/* interrupt */
377c478bd9Sstevel@tonic-gate 	char	t_quitc;	/* quit */
387c478bd9Sstevel@tonic-gate 	char	t_startc;	/* start output */
397c478bd9Sstevel@tonic-gate 	char	t_stopc;	/* stop output */
407c478bd9Sstevel@tonic-gate 	char	t_eofc;		/* end-of-file */
417c478bd9Sstevel@tonic-gate 	char	t_brkc;		/* input delimiter (like nl) */
427c478bd9Sstevel@tonic-gate };
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate struct ltchars {
457c478bd9Sstevel@tonic-gate 	char	t_suspc;	/* stop process signal */
467c478bd9Sstevel@tonic-gate 	char	t_dsuspc;	/* delayed stop process signal */
477c478bd9Sstevel@tonic-gate 	char	t_rprntc;	/* reprint line */
487c478bd9Sstevel@tonic-gate 	char	t_flushc;	/* flush output (toggles) */
497c478bd9Sstevel@tonic-gate 	char	t_werasc;	/* word erase */
507c478bd9Sstevel@tonic-gate 	char	t_lnextc;	/* literal next character */
517c478bd9Sstevel@tonic-gate };
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * Structure for TIOCGETP and TIOCSETP ioctls.
557c478bd9Sstevel@tonic-gate  */
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate #ifndef _SGTTYB_
587c478bd9Sstevel@tonic-gate #define _SGTTYB_
597c478bd9Sstevel@tonic-gate struct	sgttyb {
607c478bd9Sstevel@tonic-gate 	char	sg_ispeed;		/* input speed */
617c478bd9Sstevel@tonic-gate 	char	sg_ospeed;		/* output speed */
627c478bd9Sstevel@tonic-gate 	char	sg_erase;		/* erase character */
637c478bd9Sstevel@tonic-gate 	char	sg_kill;		/* kill character */
647c478bd9Sstevel@tonic-gate 	short	sg_flags;		/* mode flags */
657c478bd9Sstevel@tonic-gate };
667c478bd9Sstevel@tonic-gate #endif
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #include <sys/ioccom.h>
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * 4.3BSD tty ioctl commands that are either:
727c478bd9Sstevel@tonic-gate  *  1) deprecated
737c478bd9Sstevel@tonic-gate  *  2) not implemented (and never were implemented)
747c478bd9Sstevel@tonic-gate  *  3) implemented on top of new-style "ioctl"s.
757c478bd9Sstevel@tonic-gate  */
76*5d54f3d8Smuffin #define	TIOCGETD	_IOR('t', 0, int)		/* get line discipline */
77*5d54f3d8Smuffin #define	TIOCSETD	_IOW('t', 1, int)		/* set line discipline */
78*5d54f3d8Smuffin #define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
79*5d54f3d8Smuffin #define	TIOCMODG	_IOR('t', 3, int)		/* get modem state - OBSOLETE */
80*5d54f3d8Smuffin #define	TIOCMODS	_IOW('t', 4, int)		/* set modem state - OBSOLETE */
81*5d54f3d8Smuffin #define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
82*5d54f3d8Smuffin #define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
83*5d54f3d8Smuffin #define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty */
84*5d54f3d8Smuffin #define	TIOCEXCL	_IO('t', 13)		/* set exclusive use of tty */
85*5d54f3d8Smuffin #define	TIOCNXCL	_IO('t', 14)		/* reset exclusive use of tty */
86*5d54f3d8Smuffin #define	TIOCFLUSH	_IOW('t', 16, int)	/* flush buffers */
87*5d54f3d8Smuffin #define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
88*5d54f3d8Smuffin #define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
897c478bd9Sstevel@tonic-gate #define		O_TANDEM	0x00000001	/* send stopc on out q full */
907c478bd9Sstevel@tonic-gate #define		O_CBREAK	0x00000002	/* half-cooked mode */
917c478bd9Sstevel@tonic-gate #define		O_LCASE		0x00000004	/* simulate lower case */
927c478bd9Sstevel@tonic-gate #define		O_ECHO		0x00000008	/* echo input */
937c478bd9Sstevel@tonic-gate #define		O_CRMOD		0x00000010	/* map \r to \r\n on output */
947c478bd9Sstevel@tonic-gate #define		O_RAW		0x00000020	/* no i/o processing */
957c478bd9Sstevel@tonic-gate #define		O_ODDP		0x00000040	/* get/send odd parity */
967c478bd9Sstevel@tonic-gate #define		O_EVENP		0x00000080	/* get/send even parity */
977c478bd9Sstevel@tonic-gate #define		O_ANYP		0x000000c0	/* get any parity/send none */
987c478bd9Sstevel@tonic-gate #define		O_NLDELAY	0x00000300	/* \n delay */
997c478bd9Sstevel@tonic-gate #define			O_NL0	0x00000000
1007c478bd9Sstevel@tonic-gate #define			O_NL1	0x00000100	/* tty 37 */
1017c478bd9Sstevel@tonic-gate #define			O_NL2	0x00000200	/* vt05 */
1027c478bd9Sstevel@tonic-gate #define			O_NL3	0x00000300
1037c478bd9Sstevel@tonic-gate #define		O_TBDELAY	0x00000c00	/* horizontal tab delay */
1047c478bd9Sstevel@tonic-gate #define			O_TAB0	0x00000000
1057c478bd9Sstevel@tonic-gate #define			O_TAB1	0x00000400	/* tty 37 */
1067c478bd9Sstevel@tonic-gate #define			O_TAB2	0x00000800
1077c478bd9Sstevel@tonic-gate #define		O_XTABS		0x00000c00	/* expand tabs on output */
1087c478bd9Sstevel@tonic-gate #define		O_CRDELAY	0x00003000	/* \r delay */
1097c478bd9Sstevel@tonic-gate #define			O_CR0	0x00000000
1107c478bd9Sstevel@tonic-gate #define			O_CR1	0x00001000	/* tn 300 */
1117c478bd9Sstevel@tonic-gate #define			O_CR2	0x00002000	/* tty 37 */
1127c478bd9Sstevel@tonic-gate #define			O_CR3	0x00003000	/* concept 100 */
1137c478bd9Sstevel@tonic-gate #define		O_VTDELAY	0x00004000	/* vertical tab delay */
1147c478bd9Sstevel@tonic-gate #define			O_FF0	0x00000000
1157c478bd9Sstevel@tonic-gate #define			O_FF1	0x00004000	/* tty 37 */
1167c478bd9Sstevel@tonic-gate #define		O_BSDELAY	0x00008000	/* \b delay */
1177c478bd9Sstevel@tonic-gate #define			O_BS0	0x00000000
1187c478bd9Sstevel@tonic-gate #define			O_BS1	0x00008000
1197c478bd9Sstevel@tonic-gate #define 	O_ALLDELAY	(O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY)
1207c478bd9Sstevel@tonic-gate #define		O_CRTBS		0x00010000	/* do backspacing for crt */
1217c478bd9Sstevel@tonic-gate #define		O_PRTERA	0x00020000	/* \ ... / erase */
1227c478bd9Sstevel@tonic-gate #define		O_CRTERA	0x00040000	/* " \b " to wipe out char */
1237c478bd9Sstevel@tonic-gate #define		O_TILDE		0x00080000	/* hazeltine tilde kludge */
1247c478bd9Sstevel@tonic-gate #define		O_MDMBUF	0x00100000	/* start/stop output on carrier intr */
1257c478bd9Sstevel@tonic-gate #define		O_LITOUT	0x00200000	/* literal output */
1267c478bd9Sstevel@tonic-gate #define		O_TOSTOP	0x00400000	/* SIGSTOP on background output */
1277c478bd9Sstevel@tonic-gate #define		O_FLUSHO	0x00800000	/* flush output to terminal */
1287c478bd9Sstevel@tonic-gate #define		O_NOHANG	0x01000000	/* no SIGHUP on carrier drop */
1297c478bd9Sstevel@tonic-gate #define		O_L001000	0x02000000
1307c478bd9Sstevel@tonic-gate #define		O_CRTKIL	0x04000000	/* kill line with " \b " */
1317c478bd9Sstevel@tonic-gate #define		O_PASS8		0x08000000
1327c478bd9Sstevel@tonic-gate #define		O_CTLECH	0x10000000	/* echo control chars as ^X */
1337c478bd9Sstevel@tonic-gate #define		O_PENDIN	0x20000000	/* tp->t_rawq needs reread */
1347c478bd9Sstevel@tonic-gate #define		O_DECCTQ	0x40000000	/* only ^Q starts after ^S */
1357c478bd9Sstevel@tonic-gate #define		O_NOFLSH	0x80000000	/* no output flush on signal */
1367c478bd9Sstevel@tonic-gate /* locals, from 127 down */
137*5d54f3d8Smuffin #define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
138*5d54f3d8Smuffin #define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
139*5d54f3d8Smuffin #define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
140*5d54f3d8Smuffin #define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
1417c478bd9Sstevel@tonic-gate #define		LCRTBS		(O_CRTBS>>16)
1427c478bd9Sstevel@tonic-gate #define		LPRTERA		(O_PRTERA>>16)
1437c478bd9Sstevel@tonic-gate #define		LCRTERA		(O_CRTERA>>16)
1447c478bd9Sstevel@tonic-gate #define		LTILDE		(O_TILDE>>16)
1457c478bd9Sstevel@tonic-gate #define		LMDMBUF		(O_MDMBUF>>16)
1467c478bd9Sstevel@tonic-gate #define		LLITOUT		(O_LITOUT>>16)
1477c478bd9Sstevel@tonic-gate #define		LTOSTOP		(O_TOSTOP>>16)
1487c478bd9Sstevel@tonic-gate #define		LFLUSHO		(O_FLUSHO>>16)
1497c478bd9Sstevel@tonic-gate #define		LNOHANG		(O_NOHANG>>16)
1507c478bd9Sstevel@tonic-gate #define		LCRTKIL		(O_CRTKIL>>16)
1517c478bd9Sstevel@tonic-gate #define		LPASS8		(O_PASS8>>16)
1527c478bd9Sstevel@tonic-gate #define		LCTLECH		(O_CTLECH>>16)
1537c478bd9Sstevel@tonic-gate #define		LPENDIN		(O_PENDIN>>16)
1547c478bd9Sstevel@tonic-gate #define		LDECCTQ		(O_DECCTQ>>16)
1557c478bd9Sstevel@tonic-gate #define		LNOFLSH		(O_NOFLSH>>16)
156*5d54f3d8Smuffin #define	TIOCSBRK	_IO('t', 123)		/* set break bit */
157*5d54f3d8Smuffin #define	TIOCCBRK	_IO('t', 122)		/* clear break bit */
158*5d54f3d8Smuffin #define	TIOCSDTR	_IO('t', 121)		/* set data terminal ready */
159*5d54f3d8Smuffin #define	TIOCCDTR	_IO('t', 120)		/* clear data terminal ready */
160*5d54f3d8Smuffin #define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars */
161*5d54f3d8Smuffin #define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars */
162*5d54f3d8Smuffin #define	TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */
163*5d54f3d8Smuffin #define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate /*
1667c478bd9Sstevel@tonic-gate  * Sun-specific ioctls, which have been moved to the Sun-specific range.
1677c478bd9Sstevel@tonic-gate  * The old codes will be kept around for binary compatibility; the
1687c478bd9Sstevel@tonic-gate  * codes for TIOCCONS and TIOCGSIZE don't collide with the 4.3BSD codes
1697c478bd9Sstevel@tonic-gate  * because the structure size and copy direction fields are different.
1707c478bd9Sstevel@tonic-gate  * Unfortunately, the old TIOCSSIZE code does collide with TIOCSWINSZ,
1717c478bd9Sstevel@tonic-gate  * but they can be disambiguated by checking whether a "struct ttysize"
1727c478bd9Sstevel@tonic-gate  * structure's "ts_lines" field is greater than 64K or not.  If so,
1737c478bd9Sstevel@tonic-gate  * it's almost certainly a "struct winsize" instead.
1747c478bd9Sstevel@tonic-gate  */
175*5d54f3d8Smuffin #define	_O_TIOCCONS	_IO('t', 104)		/* get console I/O */
176*5d54f3d8Smuffin #define	_O_TIOCSSIZE	_IOW('t',103,struct ttysize)/* get tty size */
177*5d54f3d8Smuffin #define	_O_TIOCGSIZE	_IOR('t',102,struct ttysize)/* get tty size */
1787c478bd9Sstevel@tonic-gate 
1797c478bd9Sstevel@tonic-gate /*
1807c478bd9Sstevel@tonic-gate  * Sun-specific ioctls.
1817c478bd9Sstevel@tonic-gate  */
182*5d54f3d8Smuffin #define	TIOCSETX	_IOW('t', 34, int)	/* set extra modes for S5 compatibility */
183*5d54f3d8Smuffin #define	TIOCGETX	_IOR('t', 35, int)	/* get extra modes for S5 compatibility */
1847c478bd9Sstevel@tonic-gate #define		NOPOST		0x00000001	/* no processing on output (LITOUT with 7 bits + parity) */
1857c478bd9Sstevel@tonic-gate #define		NOISIG		0x00000002	/* disable all signal-generating characters */
1867c478bd9Sstevel@tonic-gate #define		STOPB		0x00000004	/* two stop bits */
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate #define	OTTYDISC	0		/* old, v7 std tty driver */
1897c478bd9Sstevel@tonic-gate #define	NETLDISC	1		/* line discip for berk net */
1907c478bd9Sstevel@tonic-gate #define	NTTYDISC	2		/* new tty discipline */
1917c478bd9Sstevel@tonic-gate #define	TABLDISC	3		/* hitachi tablet discipline */
1927c478bd9Sstevel@tonic-gate #define	NTABLDISC	4		/* gtco tablet discipline */
1937c478bd9Sstevel@tonic-gate #define	MOUSELDISC	5		/* mouse discipline */
1947c478bd9Sstevel@tonic-gate #define	KBDLDISC	6		/* up/down keyboard trans (console) */
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate #include <sys/ttycom.h>
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate #endif /* !_sys_ttold_h */
199