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
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.
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]
23 * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
31 #pragma ident "%Z%%M% %I% %E% SMI"
38 * PURPOSE: DAT Provider and Consumer registry functions.
43 #include <dat/dat_registry.h>
45 DAT_RETURN
dat_lmr_create(
46 IN DAT_IA_HANDLE ia_handle
,
47 IN DAT_MEM_TYPE mem_type
,
48 IN DAT_REGION_DESCRIPTION region_description
,
50 IN DAT_PZ_HANDLE pz_handle
,
51 IN DAT_MEM_PRIV_FLAGS privileges
,
52 OUT DAT_LMR_HANDLE
*lmr_handle
,
53 OUT DAT_LMR_CONTEXT
*lmr_context
,
54 OUT DAT_RMR_CONTEXT
*rmr_context
,
55 OUT DAT_VLEN
*registered_length
,
56 OUT DAT_VADDR
*registered_address
)
58 if (DAT_BAD_HANDLE(ia_handle
)) {
59 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_IA
));
61 return DAT_LMR_CREATE(ia_handle
,
75 DAT_RETURN
dat_evd_create(
76 IN DAT_IA_HANDLE ia_handle
,
77 IN DAT_COUNT evd_min_qlen
,
78 IN DAT_CNO_HANDLE cno_handle
,
79 IN DAT_EVD_FLAGS evd_flags
,
80 OUT DAT_EVD_HANDLE
*evd_handle
)
82 if (DAT_BAD_HANDLE(ia_handle
)) {
83 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_IA
));
85 return DAT_EVD_CREATE(ia_handle
,
93 DAT_RETURN
dat_evd_modify_cno(
94 IN DAT_EVD_HANDLE evd_handle
,
95 IN DAT_CNO_HANDLE cno_handle
)
97 if (DAT_BAD_HANDLE(evd_handle
)) {
98 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
100 return DAT_EVD_MODIFY_CNO(evd_handle
,
105 DAT_RETURN
dat_cno_create(
106 IN DAT_IA_HANDLE ia_handle
,
107 IN DAT_OS_WAIT_PROXY_AGENT agent
,
108 OUT DAT_CNO_HANDLE
*cno_handle
)
110 if (DAT_BAD_HANDLE(ia_handle
)) {
111 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_IA
));
113 return DAT_CNO_CREATE(ia_handle
,
119 DAT_RETURN
dat_cno_modify_agent(
120 IN DAT_CNO_HANDLE cno_handle
,
121 IN DAT_OS_WAIT_PROXY_AGENT agent
)
123 if (DAT_BAD_HANDLE(cno_handle
)) {
124 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_CNO
));
126 return DAT_CNO_MODIFY_AGENT(cno_handle
,
131 DAT_RETURN
dat_cno_query(
132 IN DAT_CNO_HANDLE cno_handle
,
133 IN DAT_CNO_PARAM_MASK cno_param_mask
,
134 OUT DAT_CNO_PARAM
*cno_param
)
136 if (DAT_BAD_HANDLE(cno_handle
)) {
137 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_CNO
));
139 return DAT_CNO_QUERY(cno_handle
,
145 DAT_RETURN
dat_cno_free(
146 IN DAT_CNO_HANDLE cno_handle
)
148 if (DAT_BAD_HANDLE(cno_handle
)) {
149 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_CNO
));
151 return (DAT_CNO_FREE(cno_handle
));
155 DAT_RETURN
dat_cno_wait(
156 IN DAT_CNO_HANDLE cno_handle
,
157 IN DAT_TIMEOUT timeout
,
158 OUT DAT_EVD_HANDLE
*evd_handle
)
160 if (DAT_BAD_HANDLE(cno_handle
)) {
161 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_CNO
));
163 return DAT_CNO_WAIT(cno_handle
,
169 DAT_RETURN
dat_evd_enable(
170 IN DAT_EVD_HANDLE evd_handle
)
172 if (DAT_BAD_HANDLE(evd_handle
)) {
173 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
175 return (DAT_EVD_ENABLE(evd_handle
));
179 DAT_RETURN
dat_evd_wait(
180 IN DAT_EVD_HANDLE evd_handle
,
181 IN DAT_TIMEOUT Timeout
,
182 IN DAT_COUNT Threshold
,
183 OUT DAT_EVENT
*event
,
184 OUT DAT_COUNT
*n_more_events
)
186 if (DAT_BAD_HANDLE(evd_handle
)) {
187 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
189 return DAT_EVD_WAIT(evd_handle
,
197 DAT_RETURN
dat_evd_disable(
198 IN DAT_EVD_HANDLE evd_handle
)
200 if (DAT_BAD_HANDLE(evd_handle
)) {
201 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
203 return (DAT_EVD_DISABLE(evd_handle
));
207 DAT_RETURN
dat_evd_set_unwaitable(
208 IN DAT_EVD_HANDLE evd_handle
)
210 if (DAT_BAD_HANDLE(evd_handle
)) {
211 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
213 return (DAT_EVD_SET_UNWAITABLE(evd_handle
));
216 DAT_RETURN
dat_evd_clear_unwaitable(
217 IN DAT_EVD_HANDLE evd_handle
)
219 if (DAT_BAD_HANDLE(evd_handle
)) {
220 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
222 return (DAT_EVD_CLEAR_UNWAITABLE(evd_handle
));
225 DAT_RETURN
dat_cr_handoff(
226 IN DAT_CR_HANDLE cr_handle
,
227 IN DAT_CONN_QUAL handoff
)
229 if (DAT_BAD_HANDLE(cr_handle
)) {
230 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_CR
));
232 return DAT_CR_HANDOFF(cr_handle
,
237 DAT_RETURN
dat_psp_create_any(
238 IN DAT_IA_HANDLE ia_handle
,
239 OUT DAT_CONN_QUAL
*conn_qual
,
240 IN DAT_EVD_HANDLE evd_handle
,
241 IN DAT_PSP_FLAGS psp_flags
,
242 OUT DAT_PSP_HANDLE
*psp_handle
)
244 if (DAT_BAD_HANDLE(ia_handle
)) {
245 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_IA
));
247 return DAT_PSP_CREATE_ANY(ia_handle
,
255 DAT_RETURN
dat_ia_query(
256 IN DAT_IA_HANDLE ia_handle
,
257 OUT DAT_EVD_HANDLE
*async_evd_handle
,
258 IN DAT_IA_ATTR_MASK ia_attr_mask
,
259 OUT DAT_IA_ATTR
*ia_attr
,
260 IN DAT_PROVIDER_ATTR_MASK provider_attr_mask
,
261 OUT DAT_PROVIDER_ATTR
*provider_attr
)
263 if (DAT_BAD_HANDLE(ia_handle
)) {
264 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_IA
));
266 return DAT_IA_QUERY(ia_handle
,
275 DAT_RETURN
dat_evd_query(
276 IN DAT_EVD_HANDLE evd_handle
,
277 IN DAT_EVD_PARAM_MASK evd_param_mask
,
278 OUT DAT_EVD_PARAM
*evd_param
)
280 if (DAT_BAD_HANDLE(evd_handle
)) {
281 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE1
));
283 return DAT_EVD_QUERY(evd_handle
,
289 DAT_RETURN
dat_lmr_query(
290 IN DAT_LMR_HANDLE lmr_handle
,
291 IN DAT_LMR_PARAM_MASK lmv_param_mask
,
292 OUT DAT_LMR_PARAM
*lmr_param
)
294 if (DAT_BAD_HANDLE(lmr_handle
)) {
295 return (DAT_ERROR(DAT_INVALID_HANDLE
, DAT_INVALID_HANDLE_LMR
));
297 return DAT_LMR_QUERY(lmr_handle
,