xref: /illumos-gate/usr/src/lib/udapl/libdat/include/dat/dat_redirection.h (revision 03494a9880d80f834bec10a1e8f0a2f8f7c97bf4)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2002-2004, Network Appliance, Inc. All rights reserved.
23  */
24 
25 /*
26  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 
31 #ifndef _DAT_REDIRECTION_H_
32 #define	_DAT_REDIRECTION_H_
33 
34 /*
35  *
36  * HEADER: dat_redirection.h
37  *
38  * PURPOSE: Defines the common redirection macros
39  *
40  * Description: Macros to invoke DAPL functions from the dat_registry
41  *
42  * Mapping rules:
43  *      All global symbols are prepended with "DAT_" or "dat_"
44  *      All DAT objects have an 'api' tag which, such as 'ep' or 'lmr'
45  *      The method table is in the provider definition structure.
46  *
47  *
48  *
49  */
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 typedef struct dat_provider DAT_PROVIDER;
56 
57 #ifndef DAT_HANDLE_TO_PROVIDER
58 
59 /*
60  * A utility macro to fetch the Provider Library for any object
61  *
62  * An alternate version could be defined for single library systems.
63  * it would look something like:
64  *	extern const struct dat_ia my_single_ia_provider;
65  *	#define DAT_HANDLE_TO_PROVIDER(ignore) &my_single_ia_provider
66  *
67  * This would allow a good compiler to avoid indirection overhead when
68  * making function calls.
69  */
70 
71 #define	DAT_HANDLE_TO_PROVIDER(handle) (*(DAT_PROVIDER **)(handle))
72 #endif
73 
74 #define	DAT_IA_QUERY(ia, evd, ia_msk, ia_ptr, p_msk, p_ptr) \
75 	(*DAT_HANDLE_TO_PROVIDER(ia)->ia_query_func)(\
76 		(ia),\
77 		(evd),\
78 		(ia_msk),\
79 		(ia_ptr),\
80 		(p_msk),\
81 		(p_ptr))
82 
83 #define	DAT_SET_CONSUMER_CONTEXT(handle, context) \
84 	(*DAT_HANDLE_TO_PROVIDER(handle)->set_consumer_context_func)(\
85 		(handle),\
86 		(context))
87 
88 #define	DAT_GET_CONSUMER_CONTEXT(handle, context) \
89 	(*DAT_HANDLE_TO_PROVIDER(handle)->get_consumer_context_func)(\
90 		(handle),\
91 		(context))
92 
93 #define	DAT_GET_HANDLE_TYPE(handle, handle_type) \
94 	(*DAT_HANDLE_TO_PROVIDER(handle)->get_handle_type_func)(\
95 		(handle),\
96 		(handle_type))
97 
98 #define	DAT_CR_QUERY(cr, mask, param) \
99 	(*DAT_HANDLE_TO_PROVIDER(cr)->cr_query_func)(\
100 		(cr),\
101 		(mask),\
102 		(param))
103 
104 #define	DAT_CR_ACCEPT(cr, ep, size, pdata) \
105 	(*DAT_HANDLE_TO_PROVIDER(cr)->cr_accept_func)(\
106 		(cr),\
107 		(ep),\
108 		(size),\
109 		(pdata))
110 
111 #define	DAT_CR_REJECT(cr) \
112 	(*DAT_HANDLE_TO_PROVIDER(cr)->cr_reject_func)(\
113 		(cr))
114 
115 #define	DAT_CR_HANDOFF(cr, qual) \
116 	(*DAT_HANDLE_TO_PROVIDER(cr)->cr_handoff_func)(\
117 		(cr),\
118 		(qual))
119 
120 #define	DAT_EVD_QUERY(evd, mask, param) \
121 	(*DAT_HANDLE_TO_PROVIDER(evd)->evd_query_func)(\
122 		(evd),\
123 		(mask),\
124 		(param))
125 
126 #define	DAT_EVD_RESIZE(evd, qsize) \
127 	(*DAT_HANDLE_TO_PROVIDER(evd)->evd_resize_func)(\
128 		(evd),\
129 		(qsize))
130 
131 #define	DAT_EVD_POST_SE(evd, event) \
132 	(*DAT_HANDLE_TO_PROVIDER(evd)->evd_post_se_func)(\
133 		(evd),\
134 		(event))
135 
136 #define	DAT_EVD_DEQUEUE(evd, event) \
137 	(*DAT_HANDLE_TO_PROVIDER(evd)->evd_dequeue_func)(\
138 		(evd),\
139 		(event))
140 
141 #define	DAT_EVD_FREE(evd)\
142 	(*DAT_HANDLE_TO_PROVIDER(evd)->evd_free_func)(\
143 		(evd))
144 
145 #define	DAT_EP_CREATE(ia, pz, in_evd, out_evd, connect_evd, attr, ep) \
146 	(*DAT_HANDLE_TO_PROVIDER(ia)->ep_create_func)(\
147 		(ia),\
148 		(pz),\
149 		(in_evd),\
150 		(out_evd),\
151 		(connect_evd),\
152 		(attr),\
153 		(ep))
154 
155 #define	DAT_EP_CREATE_WITH_SRQ(ia, pz, in_evd, out_evd, connect_evd, srq,\
156 	attr, ep) \
157 	(*DAT_HANDLE_TO_PROVIDER(ia)->ep_create_with_srq_func)(\
158 		(ia),\
159 		(pz),\
160 		(in_evd),\
161 		(out_evd),\
162 		(connect_evd),\
163 		(srq),\
164 		(attr),\
165 		(ep))
166 
167 #define	DAT_EP_QUERY(ep, mask, param) \
168 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_query_func)(\
169 		(ep),\
170 		(mask),\
171 		(param))
172 
173 #define	DAT_EP_MODIFY(ep, mask, param) \
174 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_modify_func)(\
175 		(ep),\
176 		(mask),\
177 		(param))
178 
179 #define	DAT_EP_CONNECT(ep, ia_addr, conn_qual, timeout, psize, pdata,	\
180 		qos, flags)						\
181 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_connect_func)(\
182 		(ep),\
183 		(ia_addr),\
184 		(conn_qual),\
185 		(timeout),\
186 		(psize),\
187 		(pdata),\
188 		(qos),\
189 		(flags))
190 
191 #define	DAT_EP_DUP_CONNECT(ep, dup, timeout, psize, pdata, qos) \
192 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_dup_connect_func)(\
193 		(ep),\
194 		(dup),\
195 		(timeout),\
196 		(psize),\
197 		(pdata),\
198 		(qos))
199 
200 #define	DAT_EP_DISCONNECT(ep, flags) \
201 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_disconnect_func)(\
202 		(ep),\
203 		(flags))
204 
205 #define	DAT_EP_POST_SEND(ep, size, lbuf, cookie, flags) \
206 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_post_send_func)(\
207 		(ep),\
208 		(size),\
209 		(lbuf),\
210 		(cookie),\
211 		(flags))
212 
213 #define	DAT_EP_POST_RECV(ep, size, lbuf, cookie, flags) \
214 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_post_recv_func)(\
215 		(ep),\
216 		(size),\
217 		(lbuf),\
218 		(cookie),\
219 		(flags))
220 
221 #define	DAT_EP_POST_RDMA_READ(ep, size, lbuf, cookie, rbuf, flags) \
222 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_post_rdma_read_func)(\
223 		(ep),\
224 		(size),\
225 		(lbuf),\
226 		(cookie),\
227 		(rbuf),\
228 		(flags))
229 
230 #define	DAT_EP_POST_RDMA_WRITE(ep, size, lbuf, cookie, rbuf, flags) \
231 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_post_rdma_write_func)(\
232 		(ep),\
233 		(size),\
234 		(lbuf),\
235 		(cookie),\
236 		(rbuf),\
237 		(flags))
238 
239 #define	DAT_EP_GET_STATUS(ep, ep_state, recv_idle, request_idle) \
240 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_get_status_func)(\
241 		(ep), \
242 		(ep_state),\
243 		(recv_idle),\
244 		(request_idle))
245 
246 #define	DAT_EP_FREE(ep)\
247 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_free_func)(\
248 		(ep))
249 
250 #define	DAT_EP_RESET(ep)\
251 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_reset_func)(\
252 		(ep))
253 
254 #define	DAT_EP_RECV_QUERY(ep, nbuf_alloc, buf_span) \
255 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_recv_query_func)(\
256 		(ep),\
257 		(nbuf_alloc),\
258 		(buf_span))
259 
260 #define	DAT_EP_SET_WATERMARK(ep, soft_wm, hard_wm) \
261 	(*DAT_HANDLE_TO_PROVIDER(ep)->ep_set_watermark_func)(\
262 		(ep),\
263 		(soft_wm),\
264 		(hard_wm))
265 
266 #define	DAT_LMR_QUERY(lmr, mask, param)\
267 	(*DAT_HANDLE_TO_PROVIDER(lmr)->lmr_query_func)(\
268 		(lmr),\
269 		(mask),\
270 		(param))
271 
272 #define	DAT_LMR_FREE(lmr)\
273 	(*DAT_HANDLE_TO_PROVIDER(lmr)->lmr_free_func)(\
274 		(lmr))
275 
276 #define	DAT_LMR_SYNC_RDMA_READ(ia, lbuf, size) \
277 	(*DAT_HANDLE_TO_PROVIDER(ia)->lmr_sync_rdma_read_func)(\
278 		(ia), \
279 		(lbuf), \
280 		(size))
281 
282 #define	DAT_LMR_SYNC_RDMA_WRITE(ia, lbuf, size) \
283 	(*DAT_HANDLE_TO_PROVIDER(ia)->lmr_sync_rdma_write_func)(\
284 		(ia), \
285 		(lbuf), \
286 		(size))
287 
288 #define	DAT_RMR_CREATE(pz, rmr) \
289 	(*DAT_HANDLE_TO_PROVIDER(pz)->rmr_create_func)(\
290 		(pz),\
291 		(rmr))
292 
293 #define	DAT_RMR_QUERY(rmr, mask, param) \
294 	(*DAT_HANDLE_TO_PROVIDER(rmr)->rmr_query_func)(\
295 		(rmr),\
296 		(mask),\
297 		(param))
298 
299 #define	DAT_RMR_BIND(rmr, lmr, mem_priv, ep, cookie, flags, context) \
300 	(*DAT_HANDLE_TO_PROVIDER(rmr)->rmr_bind_func)(\
301 		(rmr),\
302 		(lmr),\
303 		(mem_priv),\
304 		(ep),\
305 		(cookie),\
306 		(flags),\
307 		(context))
308 
309 #define	DAT_RMR_FREE(rmr)\
310 	(*DAT_HANDLE_TO_PROVIDER(rmr)->rmr_free_func)(\
311 		(rmr))
312 
313 #define	DAT_PSP_CREATE(ia, conn_qual, evd, flags, handle) \
314 	(*DAT_HANDLE_TO_PROVIDER(ia)->psp_create_func)(\
315 		(ia),\
316 		(conn_qual),\
317 		(evd),\
318 		(flags),\
319 		(handle))
320 
321 #define	DAT_PSP_CREATE_ANY(ia, conn_qual, evd, flags, handle) \
322 	(*DAT_HANDLE_TO_PROVIDER(ia)->psp_create_any_func)(\
323 		(ia), \
324 		(conn_qual), \
325 		(evd), \
326 		(flags), \
327 		(handle))
328 
329 #define	DAT_PSP_QUERY(psp, mask, param) \
330 	(*DAT_HANDLE_TO_PROVIDER(psp)->psp_query_func)(\
331 		(psp),\
332 		(mask),\
333 		(param))
334 
335 #define	DAT_PSP_FREE(psp)\
336 	(*DAT_HANDLE_TO_PROVIDER(psp)->psp_free_func)(\
337 		(psp))
338 
339 #define	DAT_RSP_CREATE(ia, conn_qual, ep, evd, handle) \
340 	(*DAT_HANDLE_TO_PROVIDER(ia)->rsp_create_func)(\
341 		(ia),\
342 		(conn_qual),\
343 		(ep),\
344 		(evd),\
345 		(handle))
346 
347 #define	DAT_RSP_QUERY(rsp, mask, param) \
348 	(*DAT_HANDLE_TO_PROVIDER(rsp)->rsp_query_func)(\
349 		(rsp),\
350 		(mask),\
351 		(param))
352 
353 #define	DAT_RSP_FREE(rsp)\
354 	(*DAT_HANDLE_TO_PROVIDER(rsp)->rsp_free_func)(\
355 		(rsp))
356 
357 #define	DAT_PZ_CREATE(ia, pz) \
358 	(*DAT_HANDLE_TO_PROVIDER(ia)->pz_create_func)(\
359 		(ia),\
360 		(pz))
361 
362 #define	DAT_PZ_QUERY(pz, mask, param) \
363 	(*DAT_HANDLE_TO_PROVIDER(pz)->pz_query_func)(\
364 		(pz),\
365 		(mask),\
366 		(param))
367 
368 #define	DAT_PZ_FREE(pz) \
369 	(*DAT_HANDLE_TO_PROVIDER(pz)->pz_free_func)(\
370 		(pz))
371 
372 #define	DAT_SRQ_CREATE(ia, pz, attr, srq) \
373 	(*DAT_HANDLE_TO_PROVIDER(ia)->srq_create_func)(\
374 		(ia),\
375 		(pz),\
376 		(attr),\
377 		(srq))
378 
379 #define	DAT_SRQ_SET_LW(srq, lw) \
380 	(*DAT_HANDLE_TO_PROVIDER(srq)->srq_set_lw_func)(\
381 		(srq),\
382 		(lw))
383 
384 #define	DAT_SRQ_FREE(srq) \
385 	(*DAT_HANDLE_TO_PROVIDER(srq)->srq_free_func)(\
386 		(srq))
387 
388 #define	DAT_SRQ_QUERY(srq, mask, param) \
389 	(*DAT_HANDLE_TO_PROVIDER(srq)->srq_query_func)(\
390 		(srq),\
391 		(mask),\
392 		(param))
393 
394 #define	DAT_SRQ_RESIZE(srq, qsize) \
395 	(*DAT_HANDLE_TO_PROVIDER(srq)->srq_resize_func)(\
396 		(srq),\
397 		(qsize))
398 
399 #define	DAT_SRQ_POST_RECV(srq, size, lbuf, cookie) \
400 	(*DAT_HANDLE_TO_PROVIDER(srq)->srq_post_recv_func)(\
401 		(srq),\
402 		(size),\
403 		(lbuf),\
404 		(cookie))
405 
406 /*
407  * FUNCTION PROTOTYPES
408  */
409 
410 typedef DAT_RETURN (*DAT_IA_OPEN_FUNC)(
411 	IN	const DAT_NAME_PTR,	/* provider		*/
412 	IN	DAT_COUNT,		/* asynch_evd_min_qlen  */
413 	INOUT	DAT_EVD_HANDLE *,	/* asynch_evd_handle    */
414 	OUT	DAT_IA_HANDLE *,	/* ia_handle		*/
415 	IN	boolean_t);		/* relaxed ordering aware */
416 
417 typedef DAT_RETURN (*DAT_IA_OPENV_FUNC)(
418 	IN	const DAT_NAME_PTR,	/* provider		*/
419 	IN	DAT_COUNT,		/* asynch_evd_min_qlen  */
420 	INOUT	DAT_EVD_HANDLE *,	/* asynch_evd_handle    */
421 	OUT	DAT_IA_HANDLE *,	/* ia_handle		*/
422 	IN	DAT_UINT32,		/* dat major version number */
423 	IN	DAT_UINT32,		/* dat minor version number */
424 	IN	DAT_BOOLEAN);		/* dat thread safety */
425 
426 typedef DAT_RETURN (*DAT_IA_CLOSE_FUNC)(
427 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
428 	IN	DAT_CLOSE_FLAGS);	/* close_flags		*/
429 
430 typedef DAT_RETURN (*DAT_IA_QUERY_FUNC)(
431 	IN	DAT_IA_HANDLE,		/* ia handle		*/
432 	OUT	DAT_EVD_HANDLE *,	/* async_evd_handle	*/
433 	IN	DAT_IA_ATTR_MASK,	/* ia_attr_mask		*/
434 	OUT	DAT_IA_ATTR *,		/* ia_attr		*/
435 	IN	DAT_PROVIDER_ATTR_MASK,	/* provider_attr_mask	*/
436 	OUT	DAT_PROVIDER_ATTR *);	/* provider_attr	*/
437 
438 /* helper functions */
439 
440 typedef DAT_RETURN (*DAT_SET_CONSUMER_CONTEXT_FUNC)(
441 	IN	DAT_HANDLE,		/* dat handle		*/
442 	IN	DAT_CONTEXT);		/* context		*/
443 
444 typedef DAT_RETURN (*DAT_GET_CONSUMER_CONTEXT_FUNC)(
445 	IN	DAT_HANDLE,		/* dat handle		*/
446 	OUT	DAT_CONTEXT *);		/* context		*/
447 
448 typedef DAT_RETURN (*DAT_GET_HANDLE_TYPE_FUNC)(
449 	IN	DAT_HANDLE,
450 	OUT	DAT_HANDLE_TYPE *);
451 
452 /* CR Functions */
453 
454 typedef DAT_RETURN (*DAT_CR_QUERY_FUNC)(
455 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
456 	IN	DAT_CR_PARAM_MASK,	/* cr_param_mask	*/
457 	OUT	DAT_CR_PARAM *);	/* cr_param		*/
458 
459 typedef DAT_RETURN (*DAT_CR_ACCEPT_FUNC)(
460 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
461 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
462 	IN	DAT_COUNT,		/* private_data_size	*/
463 	IN	const DAT_PVOID);	/* private_data		*/
464 
465 typedef DAT_RETURN (*DAT_CR_REJECT_FUNC)(
466 	IN	DAT_CR_HANDLE);
467 
468 /*
469  * For DAT-1.1 this function is defined for both uDAPL and kDAPL.
470  * For DAT-1.0 it was only defined for uDAPL.
471  */
472 typedef DAT_RETURN (*DAT_CR_HANDOFF_FUNC)(
473 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
474 	IN	DAT_CONN_QUAL);		/* handoff		*/
475 
476 /* EVD Functions */
477 
478 typedef DAT_RETURN (*DAT_EVD_RESIZE_FUNC)(
479 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
480 	IN	DAT_COUNT);		/* evd_min_qlen		*/
481 
482 typedef DAT_RETURN (*DAT_EVD_POST_SE_FUNC)(
483 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
484 	IN	const DAT_EVENT *);	/* event		*/
485 
486 typedef DAT_RETURN (*DAT_EVD_DEQUEUE_FUNC)(
487 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
488 	OUT	DAT_EVENT *);		/* event		*/
489 
490 typedef DAT_RETURN (*DAT_EVD_FREE_FUNC)(
491 	IN	DAT_EVD_HANDLE);	/* evd_handle		*/
492 
493 typedef DAT_RETURN (*DAT_EVD_QUERY_FUNC)(
494 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
495 	IN	DAT_EVD_PARAM_MASK,	/* evd_param_mask	*/
496 	OUT	DAT_EVD_PARAM *);	/* evd_param		*/
497 
498 /* EP functions */
499 
500 typedef DAT_RETURN (*DAT_EP_CREATE_FUNC)(
501 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
502 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
503 	IN	DAT_EVD_HANDLE,		/* recv_completion_evd_handle */
504 	IN	DAT_EVD_HANDLE,		/* request_completion_evd_handle */
505 	IN	DAT_EVD_HANDLE,		/* connect_evd_handle   */
506 	IN	const DAT_EP_ATTR *,	/* ep_attributes	*/
507 	OUT	DAT_EP_HANDLE *);	/* ep_handle		*/
508 
509 typedef DAT_RETURN (*DAT_EP_CREATE_WITH_SRQ_FUNC)(
510 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
511 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
512 	IN	DAT_EVD_HANDLE,		/* recv_evd_handle	*/
513 	IN	DAT_EVD_HANDLE,		/* request_evd_handle	*/
514 	IN	DAT_EVD_HANDLE,		/* connect_evd_handle	*/
515 	IN	DAT_SRQ_HANDLE,		/* srq_handle 		*/
516 	IN	const DAT_EP_ATTR *,	/* ep_attributes	*/
517 	OUT	DAT_EP_HANDLE *);	/* ep_handle		*/
518 
519 typedef DAT_RETURN (*DAT_EP_QUERY_FUNC)(
520 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
521 	IN	DAT_EP_PARAM_MASK,	/* ep_param_mask	*/
522 	OUT	DAT_EP_PARAM *);	/* ep_param		*/
523 
524 typedef DAT_RETURN (*DAT_EP_MODIFY_FUNC)(
525 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
526 	IN	DAT_EP_PARAM_MASK,	/* ep_param_mask	*/
527 	IN	const DAT_EP_PARAM *);	/* ep_param		*/
528 
529 typedef DAT_RETURN (*DAT_EP_CONNECT_FUNC)(
530 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
531 	IN	DAT_IA_ADDRESS_PTR,	/* remote_ia_address	*/
532 	IN	DAT_CONN_QUAL,		/* remote_conn_qual	*/
533 	IN	DAT_TIMEOUT,		/* timeout		*/
534 	IN	DAT_COUNT,		/* private_data_size	*/
535 	IN	const DAT_PVOID,	/* private_data		*/
536 	IN	DAT_QOS,		/* quality_of_service	*/
537 	IN	DAT_CONNECT_FLAGS);	/* connect_flags	*/
538 
539 typedef DAT_RETURN (*DAT_EP_DUP_CONNECT_FUNC)(
540 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
541 	IN	DAT_EP_HANDLE,		/* ep_dup_handle	*/
542 	IN	DAT_TIMEOUT,		/* timeout		*/
543 	IN	DAT_COUNT,		/* private_data_size	*/
544 	IN	const DAT_PVOID,	/* private_data		*/
545 	IN	DAT_QOS);		/* quality_of_service	*/
546 
547 typedef DAT_RETURN (*DAT_EP_DISCONNECT_FUNC)(
548 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
549 	IN	DAT_CLOSE_FLAGS);	/* close_flags		*/
550 
551 typedef DAT_RETURN (*DAT_EP_POST_SEND_FUNC)(
552 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
553 	IN	DAT_COUNT,		/* num_segments		*/
554 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
555 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
556 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
557 
558 typedef DAT_RETURN (*DAT_EP_POST_RECV_FUNC)(
559 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
560 	IN	DAT_COUNT,		/* num_segments		*/
561 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
562 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
563 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
564 
565 typedef DAT_RETURN (*DAT_EP_POST_RDMA_READ_FUNC)(
566 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
567 	IN	DAT_COUNT,		/* num_segments		*/
568 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
569 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
570 	IN	const DAT_RMR_TRIPLET *,	/* remote_iov		*/
571 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
572 
573 typedef DAT_RETURN (*DAT_EP_POST_RDMA_WRITE_FUNC)(
574 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
575 	IN	DAT_COUNT,		/* num_segments		*/
576 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
577 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
578 	IN	const DAT_RMR_TRIPLET *,	/* remote_iov		*/
579 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
580 
581 typedef DAT_RETURN (*DAT_EP_GET_STATUS_FUNC)(
582 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
583 	OUT	DAT_EP_STATE *,		/* ep_state		*/
584 	OUT	DAT_BOOLEAN *,		/* recv_idle		*/
585 	OUT	DAT_BOOLEAN *);		/* request_idle		*/
586 
587 typedef DAT_RETURN (*DAT_EP_FREE_FUNC)(
588 	IN	DAT_EP_HANDLE);		/* ep_handle		*/
589 
590 typedef DAT_RETURN (*DAT_EP_RESET_FUNC)(
591 	IN	DAT_EP_HANDLE);		/* ep_handle		*/
592 
593 typedef DAT_RETURN (*DAT_EP_RECV_QUERY_FUNC)(
594 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
595 	OUT	DAT_COUNT *,		/* nbufs_allocated	*/
596 	OUT	DAT_COUNT *);		/* bufs_alloc_span	*/
597 
598 typedef DAT_RETURN (*DAT_EP_SET_WATERMARK_FUNC)(
599 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
600 	IN	DAT_COUNT,		/* soft_high_watermark	*/
601 	IN	DAT_COUNT);		/* hard_high_watermark	*/
602 
603 /* LMR functions */
604 
605 typedef DAT_RETURN (*DAT_LMR_FREE_FUNC)(
606 	IN	DAT_LMR_HANDLE);
607 
608 typedef DAT_RETURN (*DAT_LMR_QUERY_FUNC)(
609 	IN	DAT_LMR_HANDLE,		/* lmr_handle		*/
610 	IN	DAT_LMR_PARAM_MASK,	/* lmr_param_mask	*/
611 	OUT	DAT_LMR_PARAM *);	/* lmr_param		*/
612 
613 typedef DAT_RETURN (*DAT_LMR_SYNC_RDMA_READ_FUNC)(
614 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
615 	IN 	const DAT_LMR_TRIPLET *, /* local_segments	*/
616 	IN	DAT_VLEN);		/* num_segments		*/
617 
618 typedef DAT_RETURN (*DAT_LMR_SYNC_RDMA_WRITE_FUNC)(
619 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
620 	IN 	const DAT_LMR_TRIPLET *, /* local_segments	*/
621 	IN	DAT_VLEN);		/* num_segments		*/
622 
623 /* RMR Functions */
624 
625 typedef DAT_RETURN (*DAT_RMR_CREATE_FUNC)(
626 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
627 	OUT	DAT_RMR_HANDLE *);	/* rmr_handle		*/
628 
629 typedef DAT_RETURN (*DAT_RMR_QUERY_FUNC)(
630 	IN	DAT_RMR_HANDLE,		/* rmr_handle		*/
631 	IN	DAT_RMR_PARAM_MASK,	/* rmr_param_mask	*/
632 	OUT	DAT_RMR_PARAM *);	/* rmr_param		*/
633 
634 typedef DAT_RETURN (*DAT_RMR_BIND_FUNC)(
635 	IN	DAT_RMR_HANDLE,		/* rmr_handle		*/
636 	IN	const DAT_LMR_TRIPLET *,	/* lmr_triplet		*/
637 	IN	DAT_MEM_PRIV_FLAGS,	/* mem_priv		*/
638 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
639 	IN	DAT_RMR_COOKIE,		/* user_cookie		*/
640 	IN	DAT_COMPLETION_FLAGS,	/* completion_flags	*/
641 	OUT	DAT_RMR_CONTEXT *);	/* context		*/
642 
643 typedef DAT_RETURN (*DAT_RMR_FREE_FUNC)(
644 	IN	DAT_RMR_HANDLE);
645 
646 /* PSP Functions */
647 
648 typedef DAT_RETURN (*DAT_PSP_CREATE_FUNC)(
649 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
650 	IN	DAT_CONN_QUAL,		/* conn_qual		*/
651 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
652 	IN	DAT_PSP_FLAGS,		/* psp_flags		*/
653 	OUT	DAT_PSP_HANDLE *);	/* psp_handle		*/
654 
655 typedef DAT_RETURN (*DAT_PSP_CREATE_ANY_FUNC)(
656 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
657 	OUT	DAT_CONN_QUAL *,	/* conn_qual		*/
658 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
659 	IN	DAT_PSP_FLAGS,		/* psp_flags		*/
660 	OUT	DAT_PSP_HANDLE *);	/* psp_handle		*/
661 
662 typedef DAT_RETURN (*DAT_PSP_QUERY_FUNC)(
663 	IN	DAT_PSP_HANDLE,		/* psp_handle		*/
664 	IN	DAT_PSP_PARAM_MASK,	/* psp_param_mask	*/
665 	OUT	DAT_PSP_PARAM *);	/* *psp_param		*/
666 
667 typedef DAT_RETURN (*DAT_PSP_FREE_FUNC)(
668 	IN	DAT_PSP_HANDLE);	/* psp_handle		*/
669 
670 /* RSP Functions */
671 
672 typedef DAT_RETURN (*DAT_RSP_CREATE_FUNC)(
673 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
674 	IN	DAT_CONN_QUAL,		/* conn_qual		*/
675 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
676 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
677 	OUT	DAT_RSP_HANDLE *);	/* rsp_handle		*/
678 
679 typedef DAT_RETURN (*DAT_RSP_QUERY_FUNC) (
680 	IN	DAT_RSP_HANDLE,		/* rsp_handle		*/
681 	IN	DAT_RSP_PARAM_MASK,	/* rsp_param_mask	*/
682 	OUT	DAT_RSP_PARAM *);	/* *rsp_param		*/
683 
684 typedef DAT_RETURN (*DAT_RSP_FREE_FUNC)(
685 	IN	DAT_RSP_HANDLE);	/* rsp_handle		*/
686 
687 /* PZ Functions */
688 
689 typedef DAT_RETURN (*DAT_PZ_CREATE_FUNC)(
690 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
691 	OUT	DAT_PZ_HANDLE *);	/* pz_handle		*/
692 
693 typedef DAT_RETURN (*DAT_PZ_QUERY_FUNC)(
694 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
695 	IN	DAT_PZ_PARAM_MASK,	/* pz_param_mask	*/
696 	OUT	DAT_PZ_PARAM *);	/* pz_param		*/
697 
698 typedef DAT_RETURN (*DAT_PZ_FREE_FUNC)(
699 	IN	DAT_PZ_HANDLE);		/* pz_handle		*/
700 
701 /* SRQ Functions */
702 
703 typedef DAT_RETURN (*DAT_SRQ_CREATE_FUNC)(
704 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
705 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
706 	IN	DAT_SRQ_ATTR *,		/* srq_attr		*/
707 	OUT	DAT_SRQ_HANDLE *);	/* srq_handle		*/
708 
709 typedef DAT_RETURN (*DAT_SRQ_SET_LW_FUNC)(
710 	IN	DAT_SRQ_HANDLE,		/* srq_handle		*/
711 	IN	DAT_COUNT);		/* low_watermark	*/
712 
713 typedef DAT_RETURN (*DAT_SRQ_FREE_FUNC)(
714 	IN	DAT_SRQ_HANDLE);	/* srq_handle		*/
715 
716 typedef DAT_RETURN (*DAT_SRQ_QUERY_FUNC)(
717 	IN	DAT_SRQ_HANDLE,		/* srq_handle		*/
718 	IN	DAT_SRQ_PARAM_MASK,	/* srq_param_mask	*/
719 	OUT	DAT_SRQ_PARAM *);		/* srq_param		*/
720 
721 typedef DAT_RETURN (*DAT_SRQ_RESIZE_FUNC)(
722 	IN	DAT_SRQ_HANDLE,		/* srq_handle		*/
723 	IN	DAT_COUNT);		/* srq_max_recv_dto	*/
724 
725 typedef DAT_RETURN (*DAT_SRQ_POST_RECV_FUNC)(
726 	IN	DAT_SRQ_HANDLE,		/* srq_handle		*/
727 	IN	DAT_COUNT,		/* num_segments		*/
728 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
729 	IN	DAT_DTO_COOKIE);	/* user_cookie		*/
730 
731 #ifdef __cplusplus
732 }
733 #endif
734 
735 #endif /* _DAT_REDIRECTION_H_ */
736