xref: /titanic_41/usr/src/uts/common/sys/timod.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 /*
23  * Copyright 1998 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 #ifndef _SYS_TIMOD_H
31 #define	_SYS_TIMOD_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #include <sys/types.h>
36 #include <sys/stream.h>
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /* Timod ioctls */
43 #define		TIMOD 		('T'<<8)
44 #define		TI_GETINFO	(TIMOD|140)
45 #define		TI_OPTMGMT	(TIMOD|141)
46 #define		TI_BIND		(TIMOD|142)
47 #define		TI_UNBIND	(TIMOD|143)
48 #define		TI_GETMYNAME	(TIMOD|144)
49 #define		TI_GETPEERNAME	(TIMOD|145)
50 #define		TI_SETMYNAME	(TIMOD|146)
51 #define		TI_SETPEERNAME	(TIMOD|147)
52 #define		TI_SYNC		(TIMOD|148)
53 #define		TI_GETADDRS	(TIMOD|149)
54 #define		TI_CAPABILITY	(TIMOD|150)
55 
56 /*
57  * There are two ioctls to get information from the kernel. One is TI_SYNC
58  * and it should be only used to exchange information between the library and
59  * timod. It should not request any TPI information. The second ioctl is
60  * TI_CAPABILITY which is extensible ioctl for getting all the information from
61  * transport provider.
62  */
63 
64 /* sent with TI_SYNC */
65 struct ti_sync_req {
66 	uint32_t	tsr_flags;
67 	/* can grow at the end */
68 };
69 
70 /*
71  * For use with tsr_flags
72  * TSRF_INFO_REQ is obsolete and shouldn't be used in new code. Use
73  * TI_CAPABILITY ioctl instead.
74  */
75 #define	TSRF_INFO_REQ		0x1 /* get info about transport endpoint */
76 #define	TSRF_IS_EXP_IN_RCVBUF	0x2 /* look for exp ind in rcvbuf */
77 #define	TSRF_QLEN_REQ		0x4 /* get qlen from timod */
78 
79 /* returned by TI_SYNC  */
80 struct ti_sync_ack {
81 	/*
82 	 * - initial part derived from and matches T_info_ack
83 	 * - returned when TSRF_INFO_REQ is set on request
84 	 */
85 	t_scalar_t	PRIM_type;
86 	t_scalar_t	TSDU_size;
87 	t_scalar_t	ETSDU_size;
88 	t_scalar_t	CDATA_size;
89 	t_scalar_t	DDATA_size;
90 	t_scalar_t	ADDR_size;
91 	t_scalar_t	OPT_size;
92 	t_scalar_t	TIDU_size;
93 	t_scalar_t	SERV_type;
94 	t_scalar_t	CURRENT_state;
95 	t_scalar_t	PROVIDER_flag;
96 
97 	/*
98 	 * endpoint qlen backlog, returned when TSRF_INFO_REQ is set on request
99 	 */
100 	t_uscalar_t	tsa_qlen;
101 
102 	/*
103 	 * misc flags info - bits set based on what is requested.
104 	 */
105 	uint32_t tsa_flags;
106 	/* can grow at the end */
107 };
108 
109 /*
110  * Flag bits for use with tsa_flags
111  */
112 
113 /*
114  * TSAF_EXP_QUEUED:
115  * 	set/clear significant when TSRF_IS_EXP_IN_RCVBUF is set on request
116  */
117 #define	TSAF_EXP_QUEUED	0x1
118 
119 #ifdef	__cplusplus
120 }
121 #endif
122 
123 #endif	/* _SYS_TIMOD_H */
124