xref: /original-bsd/sys/sys/ioctl_compat.h (revision 333da485)
1 /*
2  * Copyright (c) 1990, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * (c) UNIX System Laboratories, Inc.
5  * All or some portions of this file are derived from material licensed
6  * to the University of California by American Telephone and Telegraph
7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8  * the permission of UNIX System Laboratories, Inc.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)ioctl_compat.h	8.4 (Berkeley) 01/21/94
13  */
14 
15 #ifndef _SYS_IOCTL_COMPAT_H_
16 #define	_SYS_IOCTL_COMPAT_H_
17 
18 #include <sys/ttychars.h>
19 #include <sys/ttydev.h>
20 
21 struct tchars {
22 	char	t_intrc;	/* interrupt */
23 	char	t_quitc;	/* quit */
24 	char	t_startc;	/* start output */
25 	char	t_stopc;	/* stop output */
26 	char	t_eofc;		/* end-of-file */
27 	char	t_brkc;		/* input delimiter (like nl) */
28 };
29 
30 struct ltchars {
31 	char	t_suspc;	/* stop process signal */
32 	char	t_dsuspc;	/* delayed stop process signal */
33 	char	t_rprntc;	/* reprint line */
34 	char	t_flushc;	/* flush output (toggles) */
35 	char	t_werasc;	/* word erase */
36 	char	t_lnextc;	/* literal next character */
37 };
38 
39 /*
40  * Structure for TIOCGETP and TIOCSETP ioctls.
41  */
42 #ifndef _SGTTYB_
43 #define	_SGTTYB_
44 struct sgttyb {
45 	char	sg_ispeed;		/* input speed */
46 	char	sg_ospeed;		/* output speed */
47 	char	sg_erase;		/* erase character */
48 	char	sg_kill;		/* kill character */
49 	short	sg_flags;		/* mode flags */
50 };
51 #endif
52 
53 #ifdef USE_OLD_TTY
54 # undef  TIOCGETD
55 # define TIOCGETD	_IOR('t', 0, int)	/* get line discipline */
56 # undef  TIOCSETD
57 # define TIOCSETD	_IOW('t', 1, int)	/* set line discipline */
58 #else
59 # define OTIOCGETD	_IOR('t', 0, int)	/* get line discipline */
60 # define OTIOCSETD	_IOW('t', 1, int)	/* set line discipline */
61 #endif
62 #define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
63 #define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
64 #define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
65 #define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
66 #define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
67 #define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
68 #define		TANDEM		0x00000001	/* send stopc on out q full */
69 #define		CBREAK		0x00000002	/* half-cooked mode */
70 #define		LCASE		0x00000004	/* simulate lower case */
71 #define		ECHO		0x00000008	/* echo input */
72 #define		CRMOD		0x00000010	/* map \r to \r\n on output */
73 #define		RAW		0x00000020	/* no i/o processing */
74 #define		ODDP		0x00000040	/* get/send odd parity */
75 #define		EVENP		0x00000080	/* get/send even parity */
76 #define		ANYP		0x000000c0	/* get any parity/send none */
77 #define		NLDELAY		0x00000300	/* \n delay */
78 #define			NL0	0x00000000
79 #define			NL1	0x00000100	/* tty 37 */
80 #define			NL2	0x00000200	/* vt05 */
81 #define			NL3	0x00000300
82 #define		TBDELAY		0x00000c00	/* horizontal tab delay */
83 #define			TAB0	0x00000000
84 #define			TAB1	0x00000400	/* tty 37 */
85 #define			TAB2	0x00000800
86 #define		XTABS		0x00000c00	/* expand tabs on output */
87 #define		CRDELAY		0x00003000	/* \r delay */
88 #define			CR0	0x00000000
89 #define			CR1	0x00001000	/* tn 300 */
90 #define			CR2	0x00002000	/* tty 37 */
91 #define			CR3	0x00003000	/* concept 100 */
92 #define		VTDELAY		0x00004000	/* vertical tab delay */
93 #define			FF0	0x00000000
94 #define			FF1	0x00004000	/* tty 37 */
95 #define		BSDELAY		0x00008000	/* \b delay */
96 #define			BS0	0x00000000
97 #define			BS1	0x00008000
98 #define		ALLDELAY	(NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
99 #define		CRTBS		0x00010000	/* do backspacing for crt */
100 #define		PRTERA		0x00020000	/* \ ... / erase */
101 #define		CRTERA		0x00040000	/* " \b " to wipe out char */
102 #define		TILDE		0x00080000	/* hazeltine tilde kludge */
103 #define		MDMBUF		0x00100000	/*start/stop output on carrier*/
104 #define		LITOUT		0x00200000	/* literal output */
105 #define		TOSTOP		0x00400000	/*SIGSTOP on background output*/
106 #define		FLUSHO		0x00800000	/* flush output to terminal */
107 #define		NOHANG		0x01000000	/* (no-op) was no SIGHUP on carrier drop */
108 #define		L001000		0x02000000
109 #define		CRTKIL		0x04000000	/* kill line with " \b " */
110 #define		PASS8		0x08000000
111 #define		CTLECH		0x10000000	/* echo control chars as ^X */
112 #define		PENDIN		0x20000000	/* tp->t_rawq needs reread */
113 #define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
114 #define		NOFLSH		0x80000000	/* no output flush on signal */
115 #define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
116 #define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
117 #define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
118 #define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
119 #define		LCRTBS		(CRTBS>>16)
120 #define		LPRTERA		(PRTERA>>16)
121 #define		LCRTERA		(CRTERA>>16)
122 #define		LTILDE		(TILDE>>16)
123 #define		LMDMBUF		(MDMBUF>>16)
124 #define		LLITOUT		(LITOUT>>16)
125 #define		LTOSTOP		(TOSTOP>>16)
126 #define		LFLUSHO		(FLUSHO>>16)
127 #define		LNOHANG		(NOHANG>>16)
128 #define		LCRTKIL		(CRTKIL>>16)
129 #define		LPASS8		(PASS8>>16)
130 #define		LCTLECH		(CTLECH>>16)
131 #define		LPENDIN		(PENDIN>>16)
132 #define		LDECCTQ		(DECCTQ>>16)
133 #define		LNOFLSH		(NOFLSH>>16)
134 #define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars*/
135 #define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars*/
136 #define OTIOCCONS	_IO('t', 98)	/* for hp300 -- sans int arg */
137 #define	OTTYDISC	0
138 #define	NETLDISC	1
139 #define	NTTYDISC	2
140 
141 #endif /* !_SYS_IOCTL_COMPAT_H_ */
142