xref: /illumos-gate/usr/src/uts/common/sys/jioctl.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 #ifndef _SYS_JIOCTL_H
27 #define	_SYS_JIOCTL_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * jioctl.h
35  *
36  * Low level control codes for communication between the host and a
37  * windowing terminal. See windows.h for additional messages used by
38  * libwindows.
39  *
40  * In case you are wondering what the "j" in jioctl stands for,
41  * the "j" stands for jerq which was the first windowing terminal.
42  * The jerq became the Blit which begot the 5620 DMD which begot
43  * the 615, the 620 and the 630 MTG.
44  */
45 
46 
47 /*
48  * Ioctl requests sent to the xt driver. The types JMPX, JWINSIZE,
49  * and JTRUN are processed locally by xt. The others involve sending
50  * a control message to the terminal on channel 0 (the control
51  * channel). In the control message, the lower bytes of these defines
52  * are used as the first byte of the control message.
53  *
54  * Note that packets sent from the host to the terminal on channels
55  * other than 0 are implicitly data packets.
56  */
57 
58 #define	JTYPE		('j'<<8)
59 #define	JBOOT		(JTYPE|1)  /* start a download in a window */
60 #define	JTERM		(JTYPE|2)  /* return to default terminal emulator */
61 #define	JMPX		(JTYPE|3)  /* currently running layers? */
62 
63 /*
64  * Timeout in seconds. Not supported by streams xt, but reserve
65  * this number to avoid confusion.
66  * #define	JTIMO		(JTYPE|4)
67  */
68 
69 #define	JWINSIZE	(JTYPE|5)  /* inquire window size */
70 #define	JTIMOM		(JTYPE|6)  /* timeouts in millisecs */
71 #define	JZOMBOOT	(JTYPE|7)  /* JBOOT but wait for debugger to run */
72 #define	JAGENT		(JTYPE|9)  /* control for both directions */
73 #define	JTRUN		(JTYPE|10) /* send runlayer command to layers cmd */
74 #define	JXTPROTO	(JTYPE|11) /* set xt protocol type */
75 
76 /*
77  * jwinsize structure used by JWINSIZE message.
78  */
79 
80 struct jwinsize
81 {
82 	char	bytesx, bytesy;	/* Window size in characters */
83 	short	bitsx, bitsy;	/* Window size in bits */
84 };
85 
86 /*
87  * Channel 0 control message format.
88  */
89 
90 struct jerqmesg
91 {
92 	char	cmd;		/* A control code above */
93 	char	chan;		/* Channel it refers to */
94 };
95 
96 /*
97  * The first byte of every xt packet from the terminal to the host
98  * is one of these control codes. Data packets start with either
99  * C_SENDCHAR or C_SENDNCHARS.
100  *
101  * The usual format is: [command][data]
102  */
103 
104 #define	C_SENDCHAR	1	/* Send character to layer process */
105 #define	C_NEW		2	/* Create a new layer */
106 #define	C_UNBLK		3	/* Unblock layer process */
107 #define	C_DELETE	4	/* Delete layer process group */
108 #define	C_EXIT		5	/* Exit layers */
109 #define	C_DEFUNCT	6	/* Send terminate signal to proc. group */
110 #define	C_SENDNCHARS	7	/* Send several characters to layer proc. */
111 #define	C_RESHAPE	8	/* Layer has been reshaped */
112 #define	C_RUN		9	/* Run command in layer (local to xt/layers) */
113 #define	C_NOFLOW	10	/* Disable network xt flow control */
114 #define	C_YESFLOW	11	/* Enable network xt flow control */
115 
116 /*
117  * Format of JAGENT packets.
118  */
119 
120 struct bagent {
121 	int size;	/* size of src string going in and dest string out */
122 	char * src;	/* address of the source byte string */
123 	char * dest;	/* address of the destination byte string */
124 };
125 
126 #ifdef	__cplusplus
127 }
128 #endif
129 
130 #endif	/* _SYS_JIOCTL_H */
131