blob: 72d85333965fae715641a093c36b63d6ecdd824f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_VLDS_H_
#define _SYS_VLDS_H_
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* LDOMS Domain Services Device Driver
*/
/*
* ioctl info for vlds device
*/
#define VLDSIOC ('d' << 16 | 's' << 8)
#define VLDS_SVC_REG (VLDSIOC | 1) /* Register DS Service */
#define VLDS_UNREG_HDL (VLDSIOC | 2) /* Unregister DS Service by Handle */
#define VLDS_HDL_LOOKUP (VLDSIOC | 3) /* Lookup DS Handle(s) by Service id */
#define VLDS_DMN_LOOKUP (VLDSIOC | 4) /* Lookup DS Domain id by Handle */
#define VLDS_SEND_MSG (VLDSIOC | 5) /* Send DS Message by Handle */
#define VLDS_RECV_MSG (VLDSIOC | 6) /* Receive DS Message by Handle */
#define VLDS_HDL_ISREADY (VLDSIOC | 7) /* Handle ready for data transfers */
#define VLDS_DOM_NAM2HDL (VLDSIOC | 8) /* Domain Name to Handle translation */
#define VLDS_DOM_HDL2NAM (VLDSIOC | 9) /* Handle ready for data transfers */
/* vlds_reg_flags */
#define VLDS_REG_CLIENT 0x01 /* Register as client */
#define VLDS_REGCB_VALID 0x02 /* User supplied Register callback */
#define VLDS_UNREGCB_VALID 0x04 /* User supplied Unregister callback */
#define VLDS_DATACB_VALID 0x08 /* User supplied Data callback */
#define VLDS_ANYCB_VALID (VLDS_REGCB_VALID | VLDS_UNREGCB_VALID | \
VLDS_DATACB_VALID)
#define VLDS_MAX_VERS 20 /* Max no. of vlds_ver_t entries */
/*
* The following are declared so that they are size-invariant.
*/
/* String arguments to ioctl */
typedef struct vlds_string_arg {
uint64_t vlds_strp;
uint64_t vlds_strlen;
} vlds_string_t;
/* Version array (used by VLDS_SVC_REG) */
typedef struct vlds_ver {
uint16_t vlds_major;
uint16_t vlds_minor;
} vlds_ver_t;
/* Capability structure (used by VLDS_SVC_REG) */
typedef struct vlds_cap {
vlds_string_t vlds_service;
uint64_t vlds_nver;
uint64_t vlds_versp;
} vlds_cap_t;
/*
* VLDS_SVC_REG
*/
typedef struct vlds_svc_reg_arg {
uint64_t vlds_hdlp; /* DS Service Handle ptr. (returned) */
uint64_t vlds_capp; /* DS Capability Structure ptr. */
uint64_t vlds_reg_flags; /* DS reg flags */
} vlds_svc_reg_arg_t;
/*
* VLDS_UNREG_HDL
*/
typedef struct vlds_unreg_hdl_arg {
uint64_t vlds_hdl; /* DS Service Handle */
} vlds_unreg_hdl_arg_t;
/*
* VLDS_DMN_LOOKUP
*/
typedef struct vlds_dmn_lookup_arg {
uint64_t vlds_hdl; /* DS Service Handle */
uint64_t vlds_dhdlp; /* DS Domain hdl ptr. (returned) */
} vlds_dmn_lookup_arg_t;
/*
* VLDS_HDL_LOOKUP
*/
typedef struct vlds_hdl_lookup_arg {
vlds_string_t vlds_service; /* DS Service Name */
uint64_t vlds_isclient; /* DS Client flag */
uint64_t vlds_hdlsp; /* DS Handle array ptr */
uint64_t vlds_maxhdls; /* DS Max no. of hdls to return */
uint64_t vlds_nhdlsp; /* DS No. of hdls returned */
} vlds_hdl_lookup_arg_t;
/*
* VLDS_SEND_MSG
*/
typedef struct vlds_send_msg_arg {
uint64_t vlds_hdl; /* DS Service Handle */
uint64_t vlds_bufp; /* buffer */
uint64_t vlds_buflen; /* message length/buffer size */
} vlds_send_msg_arg_t;
/*
* VLDS_RECV_MSG
*/
typedef struct vlds_recv_msg_arg {
uint64_t vlds_hdl; /* DS Service Handle */
uint64_t vlds_bufp; /* buffer */
uint64_t vlds_buflen; /* message length/buffer size */
uint64_t vlds_msglenp; /* ptr to returned message length */
} vlds_recv_msg_arg_t;
/*
* VLDS_HDL_ISREADY
*/
typedef struct vlds_hdl_isready_arg {
uint64_t vlds_hdl; /* DS Service Handle */
uint64_t vlds_isreadyp; /* Ptr to isready flag */
} vlds_hdl_isready_arg_t;
/*
* VLDS_DOM_NAM2HDL
*/
typedef struct vlds_dom_nam2hdl_arg {
vlds_string_t vlds_domain_name; /* Domain Name string */
uint64_t vlds_dhdlp; /* ptr to returned Domain Handle */
} vlds_dom_nam2hdl_arg_t;
/*
* VLDS_DOM_HDL2NAM
*/
typedef struct vlds_dom_hdl2nam_arg {
uint64_t vlds_dhdl; /* Domain Handle */
vlds_string_t vlds_domain_name; /* returned Domain Name string */
} vlds_dom_hdl2nam_arg_t;
/*
* Machine Description Constants for vlds driver.
*/
#define VLDS_MD_VIRT_DEV_NAME "virtual-device"
#define VLDS_MD_VIRT_ROOT_NAME "virtual-domain-service"
#define VLDS_MD_DOMAIN_HDL "vlds-domain-handle"
#define VLDS_MD_DOMAIN_NAME "vlds-domain-name"
#define VLDS_MD_VIRT_PORT_NAME "virtual-device-port"
#define VLDS_MD_REM_DOMAIN_HDL "vlds-remote-domain-handle"
#define VLDS_MD_REM_DOMAIN_NAME "vlds-remote-domain-name"
/*
* VLDS Sysevent defines.
* VLDS System Event Channel names are of the form:
* sun.com:vlds:pid<pid_number>
*/
#define VLDS_SYSEV_CHAN_FMT "sun.com:vlds:pid%06d"
#define VLDS_SYSEV_MAX_CHAN_NAME 32
#define EC_VLDS "EC_vlds" /* LDOMS Domain Services event class */
/*
* EC_VLDS subclass definitions - supporting attributes (name/value pairs) are
* found in sys/sysevent/vlds.h
*/
#define ESC_VLDS_REGISTER "ESC_VLDS_register"
#define ESC_VLDS_UNREGISTER "ESC_VLDS_unregister"
#define ESC_VLDS_DATA "ESC_VLDS_data"
/*
* Event type EC_VLDS
* Event Class - EC_VLDS
* Event Sub-Class - ESC_VLDS_REGISTER
* Event Publisher - SUNW:kern:[ds_module_name]
* Attribute Name - VLDS_HDL
* Attribute Type - SE_DATA_TYPE_UINT64
* Attribute Value - [Domain Service Handle]
* Attribute Name - VLDS_VER_MAJOR
* Attribute Type - SE_DATA_TYPE_UINT16
* Attribute Value - [major version of the DS interface]
* Attribute Name - VLDS_VER_MINOR
* Attribute Type - SE_DATA_TYPE_UINT16
* Attribute Value - [minor version of the DS interface]
* Attribute Name - VLDS_DOMAIN_HDL
* Attribute Type - SE_DATA_TYPE_UINT64
* Attribute Value - [Domain handle of registered service]
* Attribute Name - VLDS_SERVICE_ID
* Attribute Type - SE_DATA_TYPE_STRING
* Attribute Value - [Service name of registered service]
* Attribute Name - VLDS_ISCLIENT
* Attribute Type - SE_DATA_TYPE_BOOLEAN_VALUE
* Attribute Value - [Service is client or provider]
*
* Event Class - EC_VLDS
* Event Sub-Class - ESC_VLDS_UNREGISTER
* Event Publisher - SUNW:kern:[ds_module_name]
* Attribute Name - VLDS_HDL
* Attribute Type - SE_DATA_TYPE_UINT64
* Attribute Value - [Domain Service Handle]
*
* Event Class - EC_VLDS
* Event Sub-Class - ESC_VLDS_DATA
* Event Publisher - SUNW:kern:[ds_module_name]
* Attribute Name - VLDS_HDL
* Attribute Type - SE_DATA_TYPE_UINT64
* Attribute Value - [Domain Service Handle]
* Attribute Name - VLDS_DATA
* Attribute Type - SE_DATA_TYPE_BYTE_ARRAY
* Attribute Value - [Data array passed to user]
*/
#define VLDS_HDL "vlds_hdl" /* service handle */
#define VLDS_VER_MAJOR "vlds_ver_major" /* major version */
#define VLDS_VER_MINOR "vlds_ver_minor" /* minor version */
#define VLDS_DOMAIN_HDL "vlds_domain_hdl" /* domain handle */
#define VLDS_SERVICE_ID "vlds_service_id" /* service id */
#define VLDS_ISCLIENT "vlds_isclient" /* service is client */
#define VLDS_DATA "vlds_data" /* data buffer */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VLDS_H_ */
|