xref: /titanic_41/usr/src/uts/common/sys/jioctl.h (revision ed5289f91b9bf164dccd6c75398362be77a4478d)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 11.5	*/
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * jioctl.h
37  *
38  * Low level control codes for communication between the host and a
39  * windowing terminal. See windows.h for additional messages used by
40  * libwindows.
41  *
42  * In case you are wondering what the "j" in jioctl stands for,
43  * the "j" stands for jerq which was the first windowing terminal.
44  * The jerq became the Blit which begot the 5620 DMD which begot
45  * the 615, the 620 and the 630 MTG.
46  */
47 
48 
49 /*
50  * Ioctl requests sent to the xt driver. The types JMPX, JWINSIZE,
51  * and JTRUN are processed locally by xt. The others involve sending
52  * a control message to the terminal on channel 0 (the control
53  * channel). In the control message, the lower bytes of these defines
54  * are used as the first byte of the control message.
55  *
56  * Note that packets sent from the host to the terminal on channels
57  * other than 0 are implicitly data packets.
58  */
59 
60 #define	JTYPE		('j'<<8)
61 #define	JBOOT		(JTYPE|1)  /* start a download in a window */
62 #define	JTERM		(JTYPE|2)  /* return to default terminal emulator */
63 #define	JMPX		(JTYPE|3)  /* currently running layers? */
64 
65 /*
66  * Timeout in seconds. Not supported by streams xt, but reserve
67  * this number to avoid confusion.
68  * #define	JTIMO		(JTYPE|4)
69  */
70 
71 #define	JWINSIZE	(JTYPE|5)  /* inquire window size */
72 #define	JTIMOM		(JTYPE|6)  /* timeouts in millisecs */
73 #define	JZOMBOOT	(JTYPE|7)  /* JBOOT but wait for debugger to run */
74 #define	JAGENT		(JTYPE|9)  /* control for both directions */
75 #define	JTRUN		(JTYPE|10) /* send runlayer command to layers cmd */
76 #define	JXTPROTO	(JTYPE|11) /* set xt protocol type */
77 
78 /*
79  * jwinsize structure used by JWINSIZE message.
80  */
81 
82 struct jwinsize
83 {
84 	char	bytesx, bytesy;	/* Window size in characters */
85 	short	bitsx, bitsy;	/* Window size in bits */
86 };
87 
88 /*
89  * Channel 0 control message format.
90  */
91 
92 struct jerqmesg
93 {
94 	char	cmd;		/* A control code above */
95 	char	chan;		/* Channel it refers to */
96 };
97 
98 /*
99  * The first byte of every xt packet from the terminal to the host
100  * is one of these control codes. Data packets start with either
101  * C_SENDCHAR or C_SENDNCHARS.
102  *
103  * The usual format is: [command][data]
104  */
105 
106 #define	C_SENDCHAR	1	/* Send character to layer process */
107 #define	C_NEW		2	/* Create a new layer */
108 #define	C_UNBLK		3	/* Unblock layer process */
109 #define	C_DELETE	4	/* Delete layer process group */
110 #define	C_EXIT		5	/* Exit layers */
111 #define	C_DEFUNCT	6	/* Send terminate signal to proc. group */
112 #define	C_SENDNCHARS	7	/* Send several characters to layer proc. */
113 #define	C_RESHAPE	8	/* Layer has been reshaped */
114 #define	C_RUN		9	/* Run command in layer (local to xt/layers) */
115 #define	C_NOFLOW	10	/* Disable network xt flow control */
116 #define	C_YESFLOW	11	/* Enable network xt flow control */
117 
118 /*
119  * Format of JAGENT packets.
120  */
121 
122 struct bagent {
123 	int size;	/* size of src string going in and dest string out */
124 	char * src;	/* address of the source byte string */
125 	char * dest;	/* address of the destination byte string */
126 };
127 
128 #ifdef	__cplusplus
129 }
130 #endif
131 
132 #endif	/* _SYS_JIOCTL_H */
133