xref: /original-bsd/sys/sys/ttycom.h (revision e66e06db)
1 /*-
2  * Copyright (c) 1982, 1986, 1990, 1993, 1994
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  *	@(#)ttycom.h	8.1 (Berkeley) 03/28/94
13  */
14 
15 #ifndef	_SYS_TTYCOM_H_
16 #define	_SYS_TTYCOM_H_
17 
18 #include <sys/ioccom.h>
19 
20 /*
21  * Tty ioctl's except for those supported only for backwards compatibility
22  * with the old tty driver.
23  */
24 
25 /*
26  * Window/terminal size structure.  This information is stored by the kernel
27  * in order to provide a consistent interface, but is not used by the kernel.
28  */
29 struct winsize {
30 	unsigned short	ws_row;		/* rows, in characters */
31 	unsigned short	ws_col;		/* columns, in characters */
32 	unsigned short	ws_xpixel;	/* horizontal size, pixels */
33 	unsigned short	ws_ypixel;	/* vertical size, pixels */
34 };
35 
36 #define	TIOCMODG	_IOR('t', 3, int)	/* get modem control state */
37 #define	TIOCMODS	_IOW('t', 4, int)	/* set modem control state */
38 #define		TIOCM_LE	0001		/* line enable */
39 #define		TIOCM_DTR	0002		/* data terminal ready */
40 #define		TIOCM_RTS	0004		/* request to send */
41 #define		TIOCM_ST	0010		/* secondary transmit */
42 #define		TIOCM_SR	0020		/* secondary receive */
43 #define		TIOCM_CTS	0040		/* clear to send */
44 #define		TIOCM_CAR	0100		/* carrier detect */
45 #define		TIOCM_CD	TIOCM_CAR
46 #define		TIOCM_RNG	0200		/* ring */
47 #define		TIOCM_RI	TIOCM_RNG
48 #define		TIOCM_DSR	0400		/* data set ready */
49 						/* 8-10 compat */
50 #define	TIOCEXCL	 _IO('t', 13)		/* set exclusive use of tty */
51 #define	TIOCNXCL	 _IO('t', 14)		/* reset exclusive use of tty */
52 						/* 15 unused */
53 #define	TIOCFLUSH	_IOW('t', 16, int)	/* flush buffers */
54 						/* 17-18 compat */
55 #define	TIOCGETA	_IOR('t', 19, struct termios) /* get termios struct */
56 #define	TIOCSETA	_IOW('t', 20, struct termios) /* set termios struct */
57 #define	TIOCSETAW	_IOW('t', 21, struct termios) /* drain output, set */
58 #define	TIOCSETAF	_IOW('t', 22, struct termios) /* drn out, fls in, set */
59 #define	TIOCGETD	_IOR('t', 26, int)	/* get line discipline */
60 #define	TIOCSETD	_IOW('t', 27, int)	/* set line discipline */
61 						/* 127-124 compat */
62 #define	TIOCSBRK	 _IO('t', 123)		/* set break bit */
63 #define	TIOCCBRK	 _IO('t', 122)		/* clear break bit */
64 #define	TIOCSDTR	 _IO('t', 121)		/* set data terminal ready */
65 #define	TIOCCDTR	 _IO('t', 120)		/* clear data terminal ready */
66 #define	TIOCGPGRP	_IOR('t', 119, int)	/* get pgrp of tty */
67 #define	TIOCSPGRP	_IOW('t', 118, int)	/* set pgrp of tty */
68 						/* 117-116 compat */
69 #define	TIOCOUTQ	_IOR('t', 115, int)	/* output queue size */
70 #define	TIOCSTI		_IOW('t', 114, char)	/* simulate terminal input */
71 #define	TIOCNOTTY	 _IO('t', 113)		/* void tty association */
72 #define	TIOCPKT		_IOW('t', 112, int)	/* pty: set/clear packet mode */
73 #define		TIOCPKT_DATA		0x00	/* data packet */
74 #define		TIOCPKT_FLUSHREAD	0x01	/* flush packet */
75 #define		TIOCPKT_FLUSHWRITE	0x02	/* flush packet */
76 #define		TIOCPKT_STOP		0x04	/* stop output */
77 #define		TIOCPKT_START		0x08	/* start output */
78 #define		TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
79 #define		TIOCPKT_DOSTOP		0x20	/* now do ^S ^Q */
80 #define		TIOCPKT_IOCTL		0x40	/* state change of pty driver */
81 #define	TIOCSTOP	 _IO('t', 111)		/* stop output, like ^S */
82 #define	TIOCSTART	 _IO('t', 110)		/* start output, like ^Q */
83 #define	TIOCMSET	_IOW('t', 109, int)	/* set all modem bits */
84 #define	TIOCMBIS	_IOW('t', 108, int)	/* bis modem bits */
85 #define	TIOCMBIC	_IOW('t', 107, int)	/* bic modem bits */
86 #define	TIOCMGET	_IOR('t', 106, int)	/* get all modem bits */
87 #define	TIOCREMOTE	_IOW('t', 105, int)	/* remote input editing */
88 #define	TIOCGWINSZ	_IOR('t', 104, struct winsize)	/* get window size */
89 #define	TIOCSWINSZ	_IOW('t', 103, struct winsize)	/* set window size */
90 #define	TIOCUCNTL	_IOW('t', 102, int)	/* pty: set/clr usr cntl mode */
91 #define		UIOCCMD(n)	_IO('u', n)	/* usr cntl op "n" */
92 #define	TIOCCONS	_IOW('t', 98, int)	/* become virtual console */
93 #define	TIOCSCTTY	 _IO('t', 97)		/* become controlling tty */
94 #define	TIOCEXT		_IOW('t', 96, int)	/* pty: external processing */
95 #define	TIOCSIG		 _IO('t', 95)		/* pty: generate signal */
96 #define	TIOCDRAIN	 _IO('t', 94)		/* wait till output drained */
97 
98 #define	TTYDISC		0		/* termios tty line discipline */
99 #define	TABLDISC	3		/* tablet discipline */
100 #define	SLIPDISC	4		/* serial IP discipline */
101 
102 #endif /* !_SYS_TTYCOM_H_ */
103