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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 2002-2003, Network Appliance, Inc. All rights reserved.
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* MODULE: udat_api.c
*
* PURPOSE: DAT Provider and Consumer registry functions.
*
*/
#include "dat_osd.h"
#include <dat/dat_registry.h>
DAT_RETURN dat_lmr_create(
IN DAT_IA_HANDLE ia_handle,
IN DAT_MEM_TYPE mem_type,
IN DAT_REGION_DESCRIPTION region_description,
IN DAT_VLEN length,
IN DAT_PZ_HANDLE pz_handle,
IN DAT_MEM_PRIV_FLAGS privileges,
OUT DAT_LMR_HANDLE *lmr_handle,
OUT DAT_LMR_CONTEXT *lmr_context,
OUT DAT_RMR_CONTEXT *rmr_context,
OUT DAT_VLEN *registered_length,
OUT DAT_VADDR *registered_address)
{
if (DAT_BAD_HANDLE(ia_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA));
}
return DAT_LMR_CREATE(ia_handle,
mem_type,
region_description,
length,
pz_handle,
privileges,
lmr_handle,
lmr_context,
rmr_context,
registered_length,
registered_address);
}
DAT_RETURN dat_evd_create(
IN DAT_IA_HANDLE ia_handle,
IN DAT_COUNT evd_min_qlen,
IN DAT_CNO_HANDLE cno_handle,
IN DAT_EVD_FLAGS evd_flags,
OUT DAT_EVD_HANDLE *evd_handle)
{
if (DAT_BAD_HANDLE(ia_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA));
}
return DAT_EVD_CREATE(ia_handle,
evd_min_qlen,
cno_handle,
evd_flags,
evd_handle);
}
DAT_RETURN dat_evd_modify_cno(
IN DAT_EVD_HANDLE evd_handle,
IN DAT_CNO_HANDLE cno_handle)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return DAT_EVD_MODIFY_CNO(evd_handle,
cno_handle);
}
DAT_RETURN dat_cno_create(
IN DAT_IA_HANDLE ia_handle,
IN DAT_OS_WAIT_PROXY_AGENT agent,
OUT DAT_CNO_HANDLE *cno_handle)
{
if (DAT_BAD_HANDLE(ia_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA));
}
return DAT_CNO_CREATE(ia_handle,
agent,
cno_handle);
}
DAT_RETURN dat_cno_modify_agent(
IN DAT_CNO_HANDLE cno_handle,
IN DAT_OS_WAIT_PROXY_AGENT agent)
{
if (DAT_BAD_HANDLE(cno_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CNO));
}
return DAT_CNO_MODIFY_AGENT(cno_handle,
agent);
}
DAT_RETURN dat_cno_query(
IN DAT_CNO_HANDLE cno_handle,
IN DAT_CNO_PARAM_MASK cno_param_mask,
OUT DAT_CNO_PARAM *cno_param)
{
if (DAT_BAD_HANDLE(cno_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CNO));
}
return DAT_CNO_QUERY(cno_handle,
cno_param_mask,
cno_param);
}
DAT_RETURN dat_cno_free(
IN DAT_CNO_HANDLE cno_handle)
{
if (DAT_BAD_HANDLE(cno_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CNO));
}
return (DAT_CNO_FREE(cno_handle));
}
DAT_RETURN dat_cno_wait(
IN DAT_CNO_HANDLE cno_handle,
IN DAT_TIMEOUT timeout,
OUT DAT_EVD_HANDLE *evd_handle)
{
if (DAT_BAD_HANDLE(cno_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CNO));
}
return DAT_CNO_WAIT(cno_handle,
timeout,
evd_handle);
}
DAT_RETURN dat_evd_enable(
IN DAT_EVD_HANDLE evd_handle)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return (DAT_EVD_ENABLE(evd_handle));
}
DAT_RETURN dat_evd_wait(
IN DAT_EVD_HANDLE evd_handle,
IN DAT_TIMEOUT Timeout,
IN DAT_COUNT Threshold,
OUT DAT_EVENT *event,
OUT DAT_COUNT *n_more_events)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return DAT_EVD_WAIT(evd_handle,
Timeout,
Threshold,
event,
n_more_events);
}
DAT_RETURN dat_evd_disable(
IN DAT_EVD_HANDLE evd_handle)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return (DAT_EVD_DISABLE(evd_handle));
}
DAT_RETURN dat_evd_set_unwaitable(
IN DAT_EVD_HANDLE evd_handle)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return (DAT_EVD_SET_UNWAITABLE(evd_handle));
}
DAT_RETURN dat_evd_clear_unwaitable(
IN DAT_EVD_HANDLE evd_handle)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return (DAT_EVD_CLEAR_UNWAITABLE(evd_handle));
}
DAT_RETURN dat_cr_handoff(
IN DAT_CR_HANDLE cr_handle,
IN DAT_CONN_QUAL handoff)
{
if (DAT_BAD_HANDLE(cr_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR));
}
return DAT_CR_HANDOFF(cr_handle,
handoff);
}
DAT_RETURN dat_psp_create_any(
IN DAT_IA_HANDLE ia_handle,
OUT DAT_CONN_QUAL *conn_qual,
IN DAT_EVD_HANDLE evd_handle,
IN DAT_PSP_FLAGS psp_flags,
OUT DAT_PSP_HANDLE *psp_handle)
{
if (DAT_BAD_HANDLE(ia_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA));
}
return DAT_PSP_CREATE_ANY(ia_handle,
conn_qual,
evd_handle,
psp_flags,
psp_handle);
}
DAT_RETURN dat_ia_query(
IN DAT_IA_HANDLE ia_handle,
OUT DAT_EVD_HANDLE *async_evd_handle,
IN DAT_IA_ATTR_MASK ia_attr_mask,
OUT DAT_IA_ATTR *ia_attr,
IN DAT_PROVIDER_ATTR_MASK provider_attr_mask,
OUT DAT_PROVIDER_ATTR *provider_attr)
{
if (DAT_BAD_HANDLE(ia_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA));
}
return DAT_IA_QUERY(ia_handle,
async_evd_handle,
ia_attr_mask,
ia_attr,
provider_attr_mask,
provider_attr);
}
DAT_RETURN dat_evd_query(
IN DAT_EVD_HANDLE evd_handle,
IN DAT_EVD_PARAM_MASK evd_param_mask,
OUT DAT_EVD_PARAM *evd_param)
{
if (DAT_BAD_HANDLE(evd_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE1));
}
return DAT_EVD_QUERY(evd_handle,
evd_param_mask,
evd_param);
}
DAT_RETURN dat_lmr_query(
IN DAT_LMR_HANDLE lmr_handle,
IN DAT_LMR_PARAM_MASK lmv_param_mask,
OUT DAT_LMR_PARAM *lmr_param)
{
if (DAT_BAD_HANDLE(lmr_handle)) {
return (DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR));
}
return DAT_LMR_QUERY(lmr_handle,
lmv_param_mask,
lmr_param);
}
|