19e39c5baSBill Taylor /*
29e39c5baSBill Taylor  * CDDL HEADER START
39e39c5baSBill Taylor  *
49e39c5baSBill Taylor  * The contents of this file are subject to the terms of the
59e39c5baSBill Taylor  * Common Development and Distribution License (the "License").
69e39c5baSBill Taylor  * You may not use this file except in compliance with the License.
79e39c5baSBill Taylor  *
89e39c5baSBill Taylor  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99e39c5baSBill Taylor  * or http://www.opensolaris.org/os/licensing.
109e39c5baSBill Taylor  * See the License for the specific language governing permissions
119e39c5baSBill Taylor  * and limitations under the License.
129e39c5baSBill Taylor  *
139e39c5baSBill Taylor  * When distributing Covered Code, include this CDDL HEADER in each
149e39c5baSBill Taylor  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159e39c5baSBill Taylor  * If applicable, add the following below this CDDL HEADER, with the
169e39c5baSBill Taylor  * fields enclosed by brackets "[]" replaced with your own identifying
179e39c5baSBill Taylor  * information: Portions Copyright [yyyy] [name of copyright owner]
189e39c5baSBill Taylor  *
199e39c5baSBill Taylor  * CDDL HEADER END
209e39c5baSBill Taylor  */
219e39c5baSBill Taylor 
229e39c5baSBill Taylor /*
239e39c5baSBill Taylor  * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
249e39c5baSBill Taylor  */
259e39c5baSBill Taylor 
269e39c5baSBill Taylor /*
27*1cfa752fSRamaswamy Tummala  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
289e39c5baSBill Taylor  */
299e39c5baSBill Taylor 
309e39c5baSBill Taylor /*
319e39c5baSBill Taylor  *
329e39c5baSBill Taylor  * HEADER: dapl.h
339e39c5baSBill Taylor  *
349e39c5baSBill Taylor  * PURPOSE: defines common data structures for the DAPL reference implemenation
359e39c5baSBill Taylor  *
369e39c5baSBill Taylor  * Description: This file describes the working data structures used within
379e39c5baSBill Taylor  *              DAPL RI.
389e39c5baSBill Taylor  *
399e39c5baSBill Taylor  */
409e39c5baSBill Taylor 
419e39c5baSBill Taylor #ifndef _DAPL_H_
429e39c5baSBill Taylor #define	_DAPL_H_
439e39c5baSBill Taylor 
449e39c5baSBill Taylor #ifdef __cplusplus
459e39c5baSBill Taylor extern "C" {
469e39c5baSBill Taylor #endif
479e39c5baSBill Taylor 
489e39c5baSBill Taylor #include <sys/types.h>
499e39c5baSBill Taylor #include <sys/byteorder.h>
509e39c5baSBill Taylor 
519e39c5baSBill Taylor #include <dat/udat.h>
529e39c5baSBill Taylor #include <dat/dat_registry.h>
539e39c5baSBill Taylor #include "dapl_osd.h"
549e39c5baSBill Taylor #include "dapl_debug.h"
559e39c5baSBill Taylor #include "dapl_tavor_ibtf.h"
569e39c5baSBill Taylor 
579e39c5baSBill Taylor 
589e39c5baSBill Taylor /*
599e39c5baSBill Taylor  * The HTOBE_xx() macro converts data from host order to big endian
609e39c5baSBill Taylor  * order and hence uses the BE_xx macros to do the byte swapping.
619e39c5baSBill Taylor  *
629e39c5baSBill Taylor  * The BETOH_xx() macro converts data from big endian order to host
639e39c5baSBill Taylor  * order. This is used when data is read from CQs or QPs. Due to the
649e39c5baSBill Taylor  * self-inversing nature of byte swapping routines BE_xx macros have
659e39c5baSBill Taylor  * the effect of converting big endian to host byte order which can
669e39c5baSBill Taylor  * be big endian or little endian.
679e39c5baSBill Taylor  * eg.	On i386 BE_64(val64_be) = val64_le
689e39c5baSBill Taylor  *	On sparc BE_64(val64_be) = val64_be.
699e39c5baSBill Taylor  *
709e39c5baSBill Taylor  * Tavor is a big endian device, all the buffer manipulation for
719e39c5baSBill Taylor  * QPs, CQs and the doorbell page needs to be aware of this.
729e39c5baSBill Taylor  *
739e39c5baSBill Taylor  */
749e39c5baSBill Taylor #if defined(__amd64) || defined(__i386)
759e39c5baSBill Taylor /* use inline code to get performance of bswap* instructions */
769e39c5baSBill Taylor 
779e39c5baSBill Taylor #if !defined(__lint) && defined(__GNUC__)
789e39c5baSBill Taylor /* use GNU inline */
799e39c5baSBill Taylor 	/* works for both i386 and amd64 */
dapls_byteswap32(uint32_t value)809e39c5baSBill Taylor 	extern __inline__ uint32_t dapls_byteswap32(uint32_t value)
819e39c5baSBill Taylor 	{
829e39c5baSBill Taylor 		__asm__("bswap %0" : "+r" (value));
839e39c5baSBill Taylor 		return (value);
849e39c5baSBill Taylor 	}
859e39c5baSBill Taylor 
869e39c5baSBill Taylor #if defined(__amd64)
879e39c5baSBill Taylor 
dapls_byteswap64(uint64_t value)889e39c5baSBill Taylor 	extern __inline__ uint64_t dapls_byteswap64(uint64_t value)
899e39c5baSBill Taylor 	{
909e39c5baSBill Taylor 		__asm__("bswapq %0" : "+r" (value));
919e39c5baSBill Taylor 		return (value);
929e39c5baSBill Taylor 	}
939e39c5baSBill Taylor 
949e39c5baSBill Taylor #else /* defined(__i386) */
959e39c5baSBill Taylor 
dapls_byteswap64(uint64_t value)969e39c5baSBill Taylor 	extern __inline__ uint64_t dapls_byteswap64(uint64_t value)
979e39c5baSBill Taylor 	{
989e39c5baSBill Taylor 		union {
999e39c5baSBill Taylor 			struct { uint32_t a, b; } s;
1009e39c5baSBill Taylor 			uint64_t u;
1019e39c5baSBill Taylor 		} v;
1029e39c5baSBill Taylor 		v.u = value;
1039e39c5baSBill Taylor 		__asm__("bswap %0 ; bswap %1 ; xchgl %0,%1"
1049e39c5baSBill Taylor 		    : "=r" (v.s.a), "=r" (v.s.b)
1059e39c5baSBill Taylor 		    : "0" (v.s.a), "1" (v.s.b));
1069e39c5baSBill Taylor 		return (v.u);
1079e39c5baSBill Taylor 	}
1089e39c5baSBill Taylor #endif
1099e39c5baSBill Taylor 
1109e39c5baSBill Taylor #else	/* !defined(__lint) && defined(__GNUC__) */
1119e39c5baSBill Taylor /* use SUN inline with .il files */
1129e39c5baSBill Taylor uint64_t dapls_byteswap64(uint64_t);
1139e39c5baSBill Taylor uint32_t dapls_byteswap32(uint32_t);
1149e39c5baSBill Taylor 
1159e39c5baSBill Taylor #endif	/* !defined(__lint) && defined(__GNUC__) */
1169e39c5baSBill Taylor 
1179e39c5baSBill Taylor #define	HTOBE_64(x)	dapls_byteswap64(x)
1189e39c5baSBill Taylor #define	HTOBE_32(x)	dapls_byteswap32(x)
1199e39c5baSBill Taylor #define	BETOH_64(x)	dapls_byteswap64(x)
1209e39c5baSBill Taylor #define	BETOH_32(x)	dapls_byteswap32(x)
1219e39c5baSBill Taylor 
1229e39c5baSBill Taylor #else	/* defined(__amd64) || defined(__i386) */
1239e39c5baSBill Taylor 
1249e39c5baSBill Taylor /* These are identity (do nothing) on big-endian machines. */
1259e39c5baSBill Taylor 
1269e39c5baSBill Taylor #define	HTOBE_64(x)	BE_64((x))
1279e39c5baSBill Taylor #define	HTOBE_32(x)	BE_32((x))
1289e39c5baSBill Taylor #define	BETOH_64(x)	BE_64((x))
1299e39c5baSBill Taylor #define	BETOH_32(x)	BE_32((x))
1309e39c5baSBill Taylor 
1319e39c5baSBill Taylor #endif	/* defined(__amd64) || defined(__i386) */
1329e39c5baSBill Taylor 
1339e39c5baSBill Taylor /*
1349e39c5baSBill Taylor  *
1359e39c5baSBill Taylor  * Enumerations
1369e39c5baSBill Taylor  *
1379e39c5baSBill Taylor  */
1389e39c5baSBill Taylor 
1399e39c5baSBill Taylor typedef enum dapl_magic {
1409e39c5baSBill Taylor 	/* magic number values for verification & debug */
1419e39c5baSBill Taylor 	DAPL_MAGIC_IA = 0x1afeF00d,
1429e39c5baSBill Taylor 	DAPL_MAGIC_EVD = 0x2eedFace,
1439e39c5baSBill Taylor 	DAPL_MAGIC_EP = 0x3eadBabe,
1449e39c5baSBill Taylor 	DAPL_MAGIC_LMR = 0x4eefCafe,
1459e39c5baSBill Taylor 	DAPL_MAGIC_RMR = 0x5BadCafe,
1469e39c5baSBill Taylor 	DAPL_MAGIC_PZ = 0x6eafBeef,
1479e39c5baSBill Taylor 	DAPL_MAGIC_PSP = 0x7eadeD0c,
1489e39c5baSBill Taylor 	DAPL_MAGIC_RSP = 0x1ab4Feed,
1499e39c5baSBill Taylor 	DAPL_MAGIC_CR = 0x2e12Cee1,
1509e39c5baSBill Taylor 	DAPL_MAGIC_CR_DESTROYED = 0x312bDead,
1519e39c5baSBill Taylor 	DAPL_MAGIC_CNO = 0x4eadF00d,
1529e39c5baSBill Taylor 	DAPL_MAGIC_EP_EXIT = 0x5abeDead,
1539e39c5baSBill Taylor 	DAPL_MAGIC_SRQ = 0x5eedFace,
1549e39c5baSBill Taylor 	DAPL_MAGIC_INVALID = 0x6FFFFFFF
1559e39c5baSBill Taylor } DAPL_MAGIC;
1569e39c5baSBill Taylor 
1579e39c5baSBill Taylor typedef enum dapl_evd_state {
1589e39c5baSBill Taylor 	DAPL_EVD_STATE_TERMINAL,
1599e39c5baSBill Taylor 	DAPL_EVD_STATE_INITIAL,
1609e39c5baSBill Taylor 	DAPL_EVD_STATE_OPEN,
1619e39c5baSBill Taylor 	DAPL_EVD_STATE_WAITED,
1629e39c5baSBill Taylor 	DAPL_EVD_STATE_DEAD = 0xDEAD
1639e39c5baSBill Taylor } DAPL_EVD_STATE;
1649e39c5baSBill Taylor 
1659e39c5baSBill Taylor typedef enum dapl_evd_completion {
1669e39c5baSBill Taylor 	DAPL_EVD_STATE_INIT,
1689e39c5baSBill Taylor 	DAPL_EVD_STATE_THRESHOLD,
1709e39c5baSBill Taylor } DAPL_EVD_COMPLETION;
1719e39c5baSBill Taylor 
1729e39c5baSBill Taylor typedef enum dapl_cno_state {
1739e39c5baSBill Taylor 	DAPL_CNO_STATE_UNTRIGGERED,
1749e39c5baSBill Taylor 	DAPL_CNO_STATE_TRIGGERED,
1759e39c5baSBill Taylor 	DAPL_CNO_STATE_DEAD = 0x7eadFeed
1769e39c5baSBill Taylor } DAPL_CNO_STATE;
1779e39c5baSBill Taylor 
1789e39c5baSBill Taylor typedef enum dapl_qp_state {
1799e39c5baSBill Taylor 	DAPL_QP_STATE_UNCONNECTED,
1809e39c5baSBill Taylor 	DAPL_QP_STATE_RESERVED,
1849e39c5baSBill Taylor 	DAPL_QP_STATE_CONNECTED,
1869e39c5baSBill Taylor 	DAPL_QP_STATE_ERROR,
1879e39c5baSBill Taylor 	DAPL_QP_STATE_NOT_REUSABLE,
1889e39c5baSBill Taylor 	DAPL_QP_STATE_FREE
1899e39c5baSBill Taylor } DAPL_QP_STATE;
1909e39c5baSBill Taylor 
1919e39c5baSBill Taylor 
1929e39c5baSBill Taylor /*
1939e39c5baSBill Taylor  *
1949e39c5baSBill Taylor  * Constants
1959e39c5baSBill Taylor  *
1969e39c5baSBill Taylor  */
1979e39c5baSBill Taylor 
1989e39c5baSBill Taylor /*
1999e39c5baSBill Taylor  * number of HCAs allowed
2009e39c5baSBill Taylor  */
2019e39c5baSBill Taylor #define	DAPL_MAX_HCA_COUNT		4
2029e39c5baSBill Taylor 
2039e39c5baSBill Taylor /*
2049e39c5baSBill Taylor  * Configures the RMR bind evd restriction
2059e39c5baSBill Taylor  */
2079e39c5baSBill Taylor 
2089e39c5baSBill Taylor /*
2099e39c5baSBill Taylor  * special qp_state indicating the EP does not have a QP attached yet
2109e39c5baSBill Taylor  */
2119e39c5baSBill Taylor #define	DAPL_QP_STATE_UNATTACHED	0xFFF0
2129e39c5baSBill Taylor 
2139e39c5baSBill Taylor /*
2149e39c5baSBill Taylor  *
2159e39c5baSBill Taylor  * Macros
2169e39c5baSBill Taylor  *
2179e39c5baSBill Taylor  */
2189e39c5baSBill Taylor 
2199e39c5baSBill Taylor /*
2209e39c5baSBill Taylor  * Simple macro to verify a handle is bad.
2219e39c5baSBill Taylor  * - pointer's magic number is wrong
2229e39c5baSBill Taylor  * - both pointer is NULL and not word aligned checked by the registry
2239e39c5baSBill Taylor  */
2249e39c5baSBill Taylor #define	DAPL_BAD_HANDLE(h, magicNum) (				\
2259e39c5baSBill Taylor 	    (((DAPL_HEADER *)(h))->magic != (magicNum)))
2269e39c5baSBill Taylor 
2279e39c5baSBill Taylor #define	DAPL_MIN(a, b)		(((a) < (b)) ? (a) : (b))
2289e39c5baSBill Taylor #define	DAPL_MAX(a, b)		(((a) > (b)) ? (a) : (b))
2299e39c5baSBill Taylor 
2309e39c5baSBill Taylor #define	DAT_ERROR(Type, SubType) \
2319e39c5baSBill Taylor 	((DAT_RETURN)(DAT_CLASS_ERROR | (Type) | (SubType)))
2329e39c5baSBill Taylor 
2339e39c5baSBill Taylor /*
2349e39c5baSBill Taylor  *
2359e39c5baSBill Taylor  * Typedefs
2369e39c5baSBill Taylor  *
2379e39c5baSBill Taylor  */
2389e39c5baSBill Taylor 
2399e39c5baSBill Taylor typedef	struct dapl_llist_entry DAPL_LLIST_ENTRY;
2409e39c5baSBill Taylor typedef	DAPL_LLIST_ENTRY *DAPL_LLIST_HEAD;
2419e39c5baSBill Taylor typedef	struct dapl_ring_buffer DAPL_RING_BUFFER;
2429e39c5baSBill Taylor typedef	struct dapl_cookie_buffer DAPL_COOKIE_BUFFER;
2439e39c5baSBill Taylor 
2449e39c5baSBill Taylor typedef	struct dapl_hash_table DAPL_HASH_TABLE;
2459e39c5baSBill Taylor typedef	struct dapl_hash_table *DAPL_HASH_TABLEP;
2469e39c5baSBill Taylor typedef	DAT_UINT64 DAPL_HASH_KEY;
2479e39c5baSBill Taylor typedef	void *DAPL_HASH_DATA;
2489e39c5baSBill Taylor 
2499e39c5baSBill Taylor typedef	struct dapl_hca DAPL_HCA;
2509e39c5baSBill Taylor 
2519e39c5baSBill Taylor typedef	struct dapl_header DAPL_HEADER;
2529e39c5baSBill Taylor 
2539e39c5baSBill Taylor typedef	struct dapl_ia DAPL_IA;
2549e39c5baSBill Taylor typedef	struct dapl_cno DAPL_CNO;
2559e39c5baSBill Taylor typedef	struct dapl_evd DAPL_EVD;
2569e39c5baSBill Taylor typedef	struct dapl_ep DAPL_EP;
2579e39c5baSBill Taylor typedef	struct dapl_pz DAPL_PZ;
2589e39c5baSBill Taylor typedef	struct dapl_lmr DAPL_LMR;
2599e39c5baSBill Taylor typedef	struct dapl_rmr DAPL_RMR;
2609e39c5baSBill Taylor typedef	struct dapl_sp DAPL_SP;
2619e39c5baSBill Taylor typedef	struct dapl_cr DAPL_CR;
2629e39c5baSBill Taylor typedef struct dapl_srq DAPL_SRQ;
2639e39c5baSBill Taylor 
2649e39c5baSBill Taylor typedef	struct dapl_cookie DAPL_COOKIE;
2659e39c5baSBill Taylor typedef	struct dapl_dto_cookie DAPL_DTO_COOKIE;
2669e39c5baSBill Taylor typedef	struct dapl_rmr_cookie DAPL_RMR_COOKIE;
2679e39c5baSBill Taylor 
2689e39c5baSBill Taylor typedef	void (*DAPL_CONNECTION_STATE_HANDLER)(IN DAPL_EP *,
2699e39c5baSBill Taylor 	IN ib_cm_events_t,
2709e39c5baSBill Taylor 	IN const void *,
2719e39c5baSBill Taylor 	OUT DAT_EVENT *);
2729e39c5baSBill Taylor 
2739e39c5baSBill Taylor 
2749e39c5baSBill Taylor /*
2759e39c5baSBill Taylor  *
2769e39c5baSBill Taylor  * Structures
2779e39c5baSBill Taylor  *
2789e39c5baSBill Taylor  */
2799e39c5baSBill Taylor 
2809e39c5baSBill Taylor struct dapl_llist_entry {
2819e39c5baSBill Taylor 	struct dapl_llist_entry *flink;
2829e39c5baSBill Taylor 	struct dapl_llist_entry *blink;
2839e39c5baSBill Taylor 	void *data;
2849e39c5baSBill Taylor 	DAPL_LLIST_HEAD *list_head;	/* for consistency checking */
2859e39c5baSBill Taylor };
2869e39c5baSBill Taylor 
2879e39c5baSBill Taylor struct dapl_ring_buffer {
2889e39c5baSBill Taylor 	void **base;		/* base of element array */
2899e39c5baSBill Taylor 	DAT_COUNT lim;		/* mask, number of entries - 1 */
2909e39c5baSBill Taylor 	DAPL_ATOMIC head;	/* head pointer index */
2919e39c5baSBill Taylor 	DAPL_ATOMIC tail;	/* tail pointer index */
2929e39c5baSBill Taylor 	DAPL_OS_LOCK lock;	/* lock */
2939e39c5baSBill Taylor };
2949e39c5baSBill Taylor 
2959e39c5baSBill Taylor struct dapl_cookie_buffer {
2969e39c5baSBill Taylor 	DAPL_COOKIE *pool;
2979e39c5baSBill Taylor 	DAT_COUNT pool_size;
2989e39c5baSBill Taylor 	DAPL_ATOMIC head;
2999e39c5baSBill Taylor 	DAPL_ATOMIC tail;
3009e39c5baSBill Taylor };
3019e39c5baSBill Taylor 
3029e39c5baSBill Taylor typedef DAT_RETURN (*DAPL_POST_SEND)(DAPL_EP *, ibt_send_wr_t *, boolean_t);
3039e39c5baSBill Taylor typedef DAT_RETURN (*DAPL_POST_RECV)(DAPL_EP *, ibt_recv_wr_t *, boolean_t);
3049e39c5baSBill Taylor typedef DAT_RETURN (*DAPL_POST_SRQ)(DAPL_SRQ *, ibt_recv_wr_t *, boolean_t);
3059e39c5baSBill Taylor typedef void (*DAPL_CQ_PEEK)(ib_cq_handle_t, int *);
3069e39c5baSBill Taylor typedef DAT_RETURN
3079e39c5baSBill Taylor 	(*DAPL_CQ_POLL)(ib_cq_handle_t, ibt_wc_t *, uint_t, uint_t *);
3089e39c5baSBill Taylor typedef DAT_RETURN (*DAPL_CQ_POLL_ONE)(ib_cq_handle_t, ibt_wc_t *);
3099e39c5baSBill Taylor typedef DAT_RETURN (*DAPL_CQ_NOTIFY)(ib_cq_handle_t, int, uint32_t);
3109e39c5baSBill Taylor typedef void (*DAPL_SRQ_FLUSH)(ib_qp_handle_t);
3119e39c5baSBill Taylor typedef void (*DAPL_QP_INIT)(ib_qp_handle_t);
3129e39c5baSBill Taylor typedef void (*DAPL_CQ_INIT)(ib_cq_handle_t);
3139e39c5baSBill Taylor typedef void (*DAPL_SRQ_INIT)(ib_srq_handle_t);
3149e39c5baSBill Taylor 
3159e39c5baSBill Taylor struct dapl_hca {
3169e39c5baSBill Taylor 	DAPL_OS_LOCK lock;
3179e39c5baSBill Taylor 	DAPL_LLIST_HEAD ia_list_head;
3189e39c5baSBill Taylor 	DAPL_EVD *async_evd;
3199e39c5baSBill Taylor 	DAPL_EVD *async_error_evd;
3209e39c5baSBill Taylor 	DAT_SOCK_ADDR6 hca_address;	/* local address of HCA */
3219e39c5baSBill Taylor 	/* Values specific to IB OS API */
3229e39c5baSBill Taylor 	IB_HCA_NAME name;
3239e39c5baSBill Taylor 	ib_hca_handle_t ib_hca_handle;
3249e39c5baSBill Taylor 	DAPL_ATOMIC handle_ref_count;	/* count of ia_opens on handle */
3259e39c5baSBill Taylor 	ib_uint32_t port_num;	/* number of physical port */
3269e39c5baSBill Taylor 	ib_uint32_t partition_max;
3279e39c5baSBill Taylor 	ib_uint32_t partition_key;
3289e39c5baSBill Taylor 	ib_uint32_t tavor_idx;
3299e39c5baSBill Taylor 	ib_guid_t node_GUID;
3309e39c5baSBill Taylor 	ib_lid_t lid;
3319e39c5baSBill Taylor 	int max_inline_send;
3329e39c5baSBill Taylor 	/* CQ support thread */
3339e39c5baSBill Taylor 	ib_cqd_handle_t ib_cqd_handle;		/* cq domain handle */
3349e39c5baSBill Taylor 	ib_cq_handle_t null_ib_cq_handle;	/* CQ handle with 0 entries */
3359e39c5baSBill Taylor 	/* Memory Subsystem Support */
3369e39c5baSBill Taylor 	DAPL_HASH_TABLE *lmr_hash_table;
3379e39c5baSBill Taylor 	/* Limits & useful HCA attributes */
3389e39c5baSBill Taylor 	DAT_IA_ATTR ia_attr;
3399e39c5baSBill Taylor 	struct dapl_hca *hca_next;
3409e39c5baSBill Taylor 	DAPL_POST_SEND post_send;
3419e39c5baSBill Taylor 	DAPL_POST_RECV post_recv;
3429e39c5baSBill Taylor 	DAPL_POST_SRQ post_srq;
3439e39c5baSBill Taylor 	DAPL_CQ_PEEK cq_peek;
3449e39c5baSBill Taylor 	DAPL_CQ_POLL cq_poll;
3459e39c5baSBill Taylor 	DAPL_CQ_POLL_ONE cq_poll_one;
3469e39c5baSBill Taylor 	DAPL_CQ_NOTIFY cq_notify;
3479e39c5baSBill Taylor 	DAPL_SRQ_FLUSH srq_flush;
3489e39c5baSBill Taylor 	DAPL_QP_INIT qp_init;
3499e39c5baSBill Taylor 	DAPL_CQ_INIT cq_init;
3509e39c5baSBill Taylor 	DAPL_SRQ_INIT srq_init;
3519e39c5baSBill Taylor 	int hermon_resize_cq;
3529e39c5baSBill Taylor };
3539e39c5baSBill Taylor 
3549e39c5baSBill Taylor #define	DAPL_SEND(x)	(x->header.owner_ia->hca_ptr->post_send)
3559e39c5baSBill Taylor #define	DAPL_RECV(x)	(x->header.owner_ia->hca_ptr->post_recv)
3569e39c5baSBill Taylor #define	DAPL_SRECV(x)	(x->header.owner_ia->hca_ptr->post_srq)
3579e39c5baSBill Taylor #define	DAPL_PEEK(x)	(x->header.owner_ia->hca_ptr->cq_peek)
3589e39c5baSBill Taylor #define	DAPL_POLL(x)	(x->header.owner_ia->hca_ptr->cq_poll)
3599e39c5baSBill Taylor #define	DAPL_POLL1(x)	(x->header.owner_ia->hca_ptr->cq_poll_one)
3609e39c5baSBill Taylor #define	DAPL_NOTIFY(x)	(x->header.owner_ia->hca_ptr->cq_notify)
3619e39c5baSBill Taylor #define	DAPL_FLUSH(x)	(x->header.owner_ia->hca_ptr->srq_flush)
3629e39c5baSBill Taylor #define	DAPL_INIT_QP(x)	(x->hca_ptr->qp_init)
3639e39c5baSBill Taylor #define	DAPL_INIT_CQ(x)	(x->hca_ptr->cq_init)
3649e39c5baSBill Taylor #define	DAPL_INIT_SRQ(x) (x->hca_ptr->srq_init)
3659e39c5baSBill Taylor 
3669e39c5baSBill Taylor extern void dapls_init_funcs_tavor(DAPL_HCA *);
3679e39c5baSBill Taylor extern void dapls_init_funcs_arbel(DAPL_HCA *);
3689e39c5baSBill Taylor extern void dapls_init_funcs_hermon(DAPL_HCA *);
3699e39c5baSBill Taylor 
3709e39c5baSBill Taylor /* DAPL Objects always have the following header */
3719e39c5baSBill Taylor struct dapl_header {
3729e39c5baSBill Taylor 	DAT_PROVIDER *provider;		/* required by DAT - must be first */
3739e39c5baSBill Taylor 	DAPL_MAGIC magic;		/* magic number for verification */
3749e39c5baSBill Taylor 	DAT_HANDLE_TYPE handle_type;	/* struct type */
3759e39c5baSBill Taylor 	DAPL_IA *owner_ia;		/* ia which owns this struct */
3769e39c5baSBill Taylor 	DAPL_LLIST_ENTRY ia_list_entry;	/* link entry on ia struct */
3779e39c5baSBill Taylor 	DAT_CONTEXT user_context;	/* user context - opaque to DAPL */
3789e39c5baSBill Taylor 	DAPL_OS_LOCK lock;		/* lock - in header for easier macros */
3799e39c5baSBill Taylor };
3809e39c5baSBill Taylor 
3819e39c5baSBill Taylor enum DAPL_IA_FLAGS {
3829e39c5baSBill Taylor 	DAPL_DISABLE_RO	= 1		/* Disable relaxed ordering */
3839e39c5baSBill Taylor };
3849e39c5baSBill Taylor 
3859e39c5baSBill Taylor /* DAPL_IA maps to DAT_IA_HANDLE */
3869e39c5baSBill Taylor struct dapl_ia {
3879e39c5baSBill Taylor 	DAPL_HEADER header;
3889e39c5baSBill Taylor 	DAPL_HCA *hca_ptr;
3899e39c5baSBill Taylor 	DAPL_EVD *async_error_evd;
3909e39c5baSBill Taylor 	DAT_BOOLEAN cleanup_async_error_evd;
3919e39c5baSBill Taylor 
3929e39c5baSBill Taylor 	DAPL_LLIST_ENTRY hca_ia_list_entry;	/* HCAs list of IAs */
3939e39c5baSBill Taylor 	DAPL_LLIST_HEAD ep_list_head;		/* EP queue */
3949e39c5baSBill Taylor 	DAPL_LLIST_HEAD lmr_list_head;		/* LMR queue */
3959e39c5baSBill Taylor 	DAPL_LLIST_HEAD rmr_list_head;		/* RMR queue */
3969e39c5baSBill Taylor 	DAPL_LLIST_HEAD pz_list_head;		/* PZ queue */
3979e39c5baSBill Taylor 	DAPL_LLIST_HEAD evd_list_head;		/* EVD queue */
3989e39c5baSBill Taylor 	DAPL_LLIST_HEAD cno_list_head;		/* CNO queue */
3999e39c5baSBill Taylor 	DAPL_LLIST_HEAD psp_list_head;		/* PSP queue */
4009e39c5baSBill Taylor 	DAPL_LLIST_HEAD rsp_list_head;		/* RSP queue */
4019e39c5baSBill Taylor 	DAPL_LLIST_HEAD srq_list_head;		/* SRQ queue */
4029e39c5baSBill Taylor 
4039e39c5baSBill Taylor 	enum DAPL_IA_FLAGS dapl_flags;		/* state flags, see above */
4049e39c5baSBill Taylor };
4059e39c5baSBill Taylor 
4069e39c5baSBill Taylor /* DAPL_CNO maps to DAT_CNO_HANDLE */
4079e39c5baSBill Taylor struct dapl_cno {
4089e39c5baSBill Taylor 	DAPL_HEADER header;
4099e39c5baSBill Taylor 
4109e39c5baSBill Taylor 	/* A CNO cannot be freed while it is referenced elsewhere.  */
4119e39c5baSBill Taylor 	DAPL_ATOMIC cno_ref_count;
4129e39c5baSBill Taylor 	DAPL_CNO_STATE cno_state;
4139e39c5baSBill Taylor 
4149e39c5baSBill Taylor 	DAT_COUNT cno_waiters;
4159e39c5baSBill Taylor 	DAPL_EVD *cno_evd_triggered;
4169e39c5baSBill Taylor 	DAT_OS_WAIT_PROXY_AGENT cno_wait_agent;
4179e39c5baSBill Taylor 
4189e39c5baSBill Taylor 	DAPL_OS_WAIT_OBJECT cno_wait_object;
4199e39c5baSBill Taylor 	DAPL_LLIST_HEAD evd_list_head;
4209e39c5baSBill Taylor 	ib_cno_handle_t ib_cno_handle;
4219e39c5baSBill Taylor };
4229e39c5baSBill Taylor 
4239e39c5baSBill Taylor /* DAPL_EVD maps to DAT_EVD_HANDLE */
4249e39c5baSBill Taylor struct dapl_evd {
4259e39c5baSBill Taylor 	DAPL_HEADER header;
4269e39c5baSBill Taylor 
4279e39c5baSBill Taylor 	DAPL_EVD_STATE evd_state;
4289e39c5baSBill Taylor 	DAT_EVD_FLAGS evd_flags;
4299e39c5baSBill Taylor 	DAT_BOOLEAN evd_enabled;	/* For attached CNO.  */
4309e39c5baSBill Taylor 	DAT_BOOLEAN evd_waitable;	/* EVD state.  */
4319e39c5baSBill Taylor 
4329e39c5baSBill Taylor 	/* Derived from evd_flags; see dapls_evd_internal_create.  */
4339e39c5baSBill Taylor 	DAT_BOOLEAN evd_producer_locking_needed;
4349e39c5baSBill Taylor 
4359e39c5baSBill Taylor 	/* Every EVD has a CQ unless it is a SOFTWARE_EVENT only EVD */
4369e39c5baSBill Taylor 	ib_cq_handle_t ib_cq_handle;
4379e39c5baSBill Taylor 
4389e39c5baSBill Taylor 	/*
4399e39c5baSBill Taylor 	 * Mellanox Specific completion handle for
4409e39c5baSBill Taylor 	 * registration/de-registration
4419e39c5baSBill Taylor 	 */
4429e39c5baSBill Taylor 	ib_comp_handle_t ib_comp_handle;
4439e39c5baSBill Taylor 
4449e39c5baSBill Taylor 	/*
4459e39c5baSBill Taylor 	 * An Event Dispatcher cannot be freed while
4469e39c5baSBill Taylor 	 * it is referenced elsewhere.
4479e39c5baSBill Taylor 	 */
4489e39c5baSBill Taylor 	DAPL_ATOMIC evd_ref_count;
4499e39c5baSBill Taylor 
4509e39c5baSBill Taylor 	/* Set if there has been a catastrophic overflow */
4519e39c5baSBill Taylor 	DAT_BOOLEAN catastrophic_overflow;
4529e39c5baSBill Taylor 
4539e39c5baSBill Taylor 	/* the actual events */
4549e39c5baSBill Taylor 	DAT_COUNT qlen;
4559e39c5baSBill Taylor 	DAT_EVENT *events;
4569e39c5baSBill Taylor 	DAPL_RING_BUFFER free_event_queue;
4579e39c5baSBill Taylor 	DAPL_RING_BUFFER pending_event_queue;
4589e39c5baSBill Taylor 
4599e39c5baSBill Taylor 	/*
4609e39c5baSBill Taylor 	 * CQ Completions are not placed into 'deferred_events'
4619e39c5baSBill Taylor 	 * rather they are simply left on the Completion Queue
4629e39c5baSBill Taylor 	 * and the fact that there was a notification is flagged.
4639e39c5baSBill Taylor 	 */
4649e39c5baSBill Taylor 	DAT_BOOLEAN cq_notified;
4659e39c5baSBill Taylor 	DAPL_OS_TICKS cq_notified_when;
4669e39c5baSBill Taylor 
4679e39c5baSBill Taylor 	DAT_COUNT cno_active_count;
4689e39c5baSBill Taylor 	DAPL_CNO *cno_ptr;
4699e39c5baSBill Taylor 
4709e39c5baSBill Taylor 	DAPL_OS_WAIT_OBJECT wait_object;
4719e39c5baSBill Taylor 	DAT_COUNT threshold;
4729e39c5baSBill Taylor 	DAPL_LLIST_ENTRY cno_list_entry;
4739e39c5baSBill Taylor 	DAPL_EVD_COMPLETION	completion_type;
4749e39c5baSBill Taylor };
4759e39c5baSBill Taylor 
4769e39c5baSBill Taylor /* DAPL_EP maps to DAT_EP_HANDLE */
4779e39c5baSBill Taylor struct dapl_ep {
4789e39c5baSBill Taylor 	DAPL_HEADER header;
4799e39c5baSBill Taylor 	/* What the DAT Consumer asked for */
4809e39c5baSBill Taylor 	DAT_EP_PARAM param;
4819e39c5baSBill Taylor 
4829e39c5baSBill Taylor 	/* The RC Queue Pair (IBM OS API) */
4839e39c5baSBill Taylor 	ib_qp_handle_t qp_handle;
4849e39c5baSBill Taylor 	unsigned int qpn;		/* qp number */
4859e39c5baSBill Taylor 	ib_qp_state_t qp_state;
4869e39c5baSBill Taylor 
4879e39c5baSBill Taylor 	/* communications manager handle (IBM OS API) */
4889e39c5baSBill Taylor 	ib_cm_handle_t cm_handle;
4899e39c5baSBill Taylor 	/*
4909e39c5baSBill Taylor 	 * store the remote IA address here, reference from the param
4919e39c5baSBill Taylor 	 * struct which only has a pointer, no storage
4929e39c5baSBill Taylor 	 */
4939e39c5baSBill Taylor 	DAT_SOCK_ADDR6 remote_ia_address;
4949e39c5baSBill Taylor 
4959e39c5baSBill Taylor 	/* For passive connections we maintain a back pointer to the CR */
4969e39c5baSBill Taylor 	void *cr_ptr;
4979e39c5baSBill Taylor 
4989e39c5baSBill Taylor 	/* private data container */
4999e39c5baSBill Taylor 	unsigned char private_data[DAPL_MAX_PRIVATE_DATA_SIZE];
5009e39c5baSBill Taylor 
5019e39c5baSBill Taylor 	/* DTO data */
5029e39c5baSBill Taylor 	DAPL_ATOMIC req_count;
5039e39c5baSBill Taylor 	DAPL_ATOMIC recv_count;
5049e39c5baSBill Taylor 
5059e39c5baSBill Taylor 	DAPL_COOKIE_BUFFER req_buffer;
5069e39c5baSBill Taylor 	DAPL_COOKIE_BUFFER recv_buffer;
5079e39c5baSBill Taylor 
5089e39c5baSBill Taylor 	DAT_BOOLEAN		srq_attached;
5099e39c5baSBill Taylor };
5109e39c5baSBill Taylor 
5119e39c5baSBill Taylor /* DAPL_PZ maps to DAT_PZ_HANDLE */
5129e39c5baSBill Taylor struct dapl_pz {
5139e39c5baSBill Taylor 	DAPL_HEADER header;
5149e39c5baSBill Taylor 	ib_pd_handle_t pd_handle;
5159e39c5baSBill Taylor 	DAPL_ATOMIC pz_ref_count;
5169e39c5baSBill Taylor };
5179e39c5baSBill Taylor 
5189e39c5baSBill Taylor /* DAPL_LMR maps to DAT_LMR_HANDLE */
5199e39c5baSBill Taylor struct dapl_lmr {
5209e39c5baSBill Taylor 	DAPL_HEADER header;
5219e39c5baSBill Taylor 	DAT_LMR_PARAM param;
5229e39c5baSBill Taylor 	ib_mr_handle_t mr_handle;
5239e39c5baSBill Taylor 	DAPL_ATOMIC lmr_ref_count;
5249e39c5baSBill Taylor };
5259e39c5baSBill Taylor 
5269e39c5baSBill Taylor /* DAPL_RMR maps to DAT_RMR_HANDLE */
5279e39c5baSBill Taylor struct dapl_rmr {
5289e39c5baSBill Taylor 	DAPL_HEADER header;
5299e39c5baSBill Taylor 	DAT_RMR_PARAM param;
5309e39c5baSBill Taylor 	DAPL_EP *ep;
5319e39c5baSBill Taylor 	DAPL_PZ *pz;
5329e39c5baSBill Taylor 	DAPL_LMR *lmr;
5339e39c5baSBill Taylor 	ib_mw_handle_t mw_handle;
5349e39c5baSBill Taylor };
5359e39c5baSBill Taylor 
5369e39c5baSBill Taylor /* SP types, indicating the state and queue */
5379e39c5baSBill Taylor typedef enum dapl_sp_state {
5389e39c5baSBill Taylor 	DAPL_SP_STATE_FREE,
5399e39c5baSBill Taylor 	DAPL_SP_STATE_PSP_LISTENING,
5409e39c5baSBill Taylor 	DAPL_SP_STATE_PSP_PENDING,
5419e39c5baSBill Taylor 	DAPL_SP_STATE_RSP_LISTENING,
5429e39c5baSBill Taylor 	DAPL_SP_STATE_RSP_PENDING
5439e39c5baSBill Taylor } DAPL_SP_STATE;
5449e39c5baSBill Taylor 
5459e39c5baSBill Taylor /* DAPL_SP maps to DAT_PSP_HANDLE and DAT_RSP_HANDLE */
5469e39c5baSBill Taylor struct dapl_sp {
5479e39c5baSBill Taylor 	DAPL_HEADER header;
5489e39c5baSBill Taylor 	DAPL_SP_STATE state;	/* type and queue of the SP */
5499e39c5baSBill Taylor 
5509e39c5baSBill Taylor 	/* PSP/RSP PARAM fields */
5519e39c5baSBill Taylor 	DAT_IA_HANDLE ia_handle;
5529e39c5baSBill Taylor 	DAT_CONN_QUAL conn_qual;
5539e39c5baSBill Taylor 	DAT_EVD_HANDLE evd_handle;
5549e39c5baSBill Taylor 	DAT_PSP_FLAGS psp_flags;
5559e39c5baSBill Taylor 	DAT_EP_HANDLE ep_handle;
5569e39c5baSBill Taylor 
5579e39c5baSBill Taylor 	/* maintenence fields */
5589e39c5baSBill Taylor 	DAT_BOOLEAN listening;		/* PSP is registered & active */
5599e39c5baSBill Taylor 	ib_cm_srvc_handle_t cm_srvc_handle;	/* Used by Mellanox CM */
5609e39c5baSBill Taylor 	DAPL_LLIST_HEAD cr_list_head;	/* CR pending queue */
5619e39c5baSBill Taylor 	DAT_COUNT cr_list_count;	/* count of CRs on queue */
5629e39c5baSBill Taylor };
5639e39c5baSBill Taylor 
5649e39c5baSBill Taylor /* DAPL_CR maps to DAT_CR_HANDLE */
5659e39c5baSBill Taylor struct dapl_cr {
5669e39c5baSBill Taylor 	DAPL_HEADER header;
5679e39c5baSBill Taylor 
5689e39c5baSBill Taylor 	/*
5699e39c5baSBill Taylor 	 * for convenience the data is kept as a DAT_CR_PARAM.
5709e39c5baSBill Taylor 	 * however, the "local_endpoint" field is always NULL
5719e39c5baSBill Taylor 	 * so this wastes a pointer. This is probably ok to
5729e39c5baSBill Taylor 	 * simplify code, espedially dat_cr_query.
5739e39c5baSBill Taylor 	 */
5749e39c5baSBill Taylor 	DAT_CR_PARAM param;
5759e39c5baSBill Taylor 	/* IB specific fields */
5769e39c5baSBill Taylor 	ib_cm_handle_t ib_cm_handle;
5779e39c5baSBill Taylor 
5789e39c5baSBill Taylor 	DAT_SOCK_ADDR6 remote_ia_address;
5799e39c5baSBill Taylor 	/*
5809e39c5baSBill Taylor 	 * Assuming that the maximum private data size is small.
5819e39c5baSBill Taylor 	 * If it gets large, use of a pointer may be appropriate.
5829e39c5baSBill Taylor 	 */
5839e39c5baSBill Taylor 	unsigned char private_data[DAPL_MAX_PRIVATE_DATA_SIZE];
5849e39c5baSBill Taylor 	/*
5859e39c5baSBill Taylor 	 * Need to be able to associate the CR back to the PSP for
5869e39c5baSBill Taylor 	 * dapl_cr_reject.
5879e39c5baSBill Taylor 	 */
5889e39c5baSBill Taylor 	DAPL_SP *sp_ptr;
5899e39c5baSBill Taylor };
5909e39c5baSBill Taylor 
5919e39c5baSBill Taylor /* DAPL_SRQ maps to DAT_SRQ_HANDLE */
5929e39c5baSBill Taylor struct dapl_srq {
5939e39c5baSBill Taylor 	DAPL_HEADER		header;
5949e39c5baSBill Taylor 	DAT_SRQ_PARAM		param;
5959e39c5baSBill Taylor 	/* SRQ cannot be freed till EPs attached to srq are freed */
5969e39c5baSBill Taylor 	DAPL_ATOMIC		srq_ref_count;
5979e39c5baSBill Taylor 	ib_srq_handle_t		srq_handle;
5989e39c5baSBill Taylor 	/* DTO data */
5999e39c5baSBill Taylor 	DAPL_ATOMIC		recv_count;
6009e39c5baSBill Taylor 	DAPL_COOKIE_BUFFER	recv_buffer;
6019e39c5baSBill Taylor };
6029e39c5baSBill Taylor 
6039e39c5baSBill Taylor typedef enum dapl_dto_type {
6049e39c5baSBill Taylor 	DAPL_DTO_TYPE_SEND,
6059e39c5baSBill Taylor 	DAPL_DTO_TYPE_RECV,
6069e39c5baSBill Taylor 	DAPL_DTO_TYPE_RDMA_WRITE,
6079e39c5baSBill Taylor 	DAPL_DTO_TYPE_RDMA_READ
6089e39c5baSBill Taylor } DAPL_DTO_TYPE;
6099e39c5baSBill Taylor 
6109e39c5baSBill Taylor typedef enum dapl_cookie_type {
6119e39c5baSBill Taylor 	DAPL_COOKIE_TYPE_NULL,
6129e39c5baSBill Taylor 	DAPL_COOKIE_TYPE_DTO,
6139e39c5baSBill Taylor 	DAPL_COOKIE_TYPE_RMR
6149e39c5baSBill Taylor } DAPL_COOKIE_TYPE;
6159e39c5baSBill Taylor 
6169e39c5baSBill Taylor /* DAPL_DTO_COOKIE used as context for DTO WQEs */
6179e39c5baSBill Taylor struct dapl_dto_cookie {
6189e39c5baSBill Taylor 	DAPL_DTO_TYPE type;
6199e39c5baSBill Taylor 	DAT_DTO_COOKIE cookie;
6209e39c5baSBill Taylor 	DAT_COUNT size;		/* used for SEND and RDMA write */
6219e39c5baSBill Taylor };
6229e39c5baSBill Taylor 
6239e39c5baSBill Taylor /* DAPL_RMR_COOKIE used as context for bind WQEs */
6249e39c5baSBill Taylor struct dapl_rmr_cookie {
6259e39c5baSBill Taylor 	DAPL_RMR *rmr;
6269e39c5baSBill Taylor 	DAT_RMR_COOKIE cookie;
6279e39c5baSBill Taylor };
6289e39c5baSBill Taylor 
6299e39c5baSBill Taylor typedef enum dapl_cookie_queue_type {
6309e39c5baSBill Taylor 	DAPL_COOKIE_QUEUE_EP,
6319e39c5baSBill Taylor 	DAPL_COOKIE_QUEUE_SRQ
6329e39c5baSBill Taylor } DAPL_COOKIE_QUEUE_TYPE;
6339e39c5baSBill Taylor 
6349e39c5baSBill Taylor /* DAPL_COOKIE used as context for WQEs */
6359e39c5baSBill Taylor struct dapl_cookie {
6369e39c5baSBill Taylor 	DAPL_COOKIE_TYPE type;	/* Must be first, to define struct.  */
6379e39c5baSBill Taylor 	DAPL_COOKIE_QUEUE_TYPE	 queue_type;
6389e39c5baSBill Taylor 	union {
6399e39c5baSBill Taylor 		void		*ptr;
6409e39c5baSBill Taylor 		DAPL_EP		*ep;
6419e39c5baSBill Taylor 		DAPL_SRQ	*srq;
6429e39c5baSBill Taylor 	} queue;
6439e39c5baSBill Taylor 	DAT_COUNT index;
6449e39c5baSBill Taylor 	union {
6459e39c5baSBill Taylor 		DAPL_DTO_COOKIE dto;
6469e39c5baSBill Taylor 		DAPL_RMR_COOKIE rmr;
6479e39c5baSBill Taylor 	} val;
6489e39c5baSBill Taylor };
6499e39c5baSBill Taylor 
6509e39c5baSBill Taylor /*
6519e39c5baSBill Taylor  * Generic HCA name field
6529e39c5baSBill Taylor  */
6539e39c5baSBill Taylor #define	DAPL_HCA_NAME_MAX_LEN 260
6549e39c5baSBill Taylor typedef char DAPL_HCA_NAME[DAPL_HCA_NAME_MAX_LEN + 1];
6559e39c5baSBill Taylor 
6569e39c5baSBill Taylor #if defined(IBHOSTS_NAMING)
6579e39c5baSBill Taylor 
6589e39c5baSBill Taylor /*
6599e39c5baSBill Taylor  * Simple mapping table to match IP addresses to GIDs. Loaded
6609e39c5baSBill Taylor  * by dapl_init.
6619e39c5baSBill Taylor  */
6629e39c5baSBill Taylor typedef struct _dapl_gid_map_table {
6639e39c5baSBill Taylor 	uint32_t ip_address;
6649e39c5baSBill Taylor 	ib_gid_t gid;
6659e39c5baSBill Taylor } DAPL_GID_MAP;
6669e39c5baSBill Taylor 
6679e39c5baSBill Taylor #endif /* IBHOSTS_NAMING */
6689e39c5baSBill Taylor 
6699e39c5baSBill Taylor /*
6709e39c5baSBill Taylor  *
6719e39c5baSBill Taylor  * Function Prototypes
6729e39c5baSBill Taylor  *
6739e39c5baSBill Taylor  */
6749e39c5baSBill Taylor 
6759e39c5baSBill Taylor /*
6769e39c5baSBill Taylor  * DAT Mandated functions
6779e39c5baSBill Taylor  */
6789e39c5baSBill Taylor extern DAT_RETURN
6799e39c5baSBill Taylor dapl_ia_open(
6809e39c5baSBill Taylor 	IN const DAT_NAME_PTR,	/* name */
6819e39c5baSBill Taylor 	IN DAT_COUNT,		/* asynch_evd_qlen */
6829e39c5baSBill Taylor 	INOUT DAT_EVD_HANDLE *,	/* asynch_evd_handle */
6839e39c5baSBill Taylor 	OUT DAT_IA_HANDLE *,	/* ia_handle */
6849e39c5baSBill Taylor 	IN	boolean_t);	/* ro_aware_client */
6859e39c5baSBill Taylor 
6869e39c5baSBill Taylor extern DAT_RETURN
6879e39c5baSBill Taylor dapl_ia_close(
6889e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
6899e39c5baSBill Taylor 	IN DAT_CLOSE_FLAGS);	/* ia_flags */
6909e39c5baSBill Taylor 
6919e39c5baSBill Taylor 
6929e39c5baSBill Taylor extern DAT_RETURN
6939e39c5baSBill Taylor dapl_ia_query(
6949e39c5baSBill Taylor 	IN DAT_IA_HANDLE,		/* ia handle */
6959e39c5baSBill Taylor 	OUT DAT_EVD_HANDLE *,		/* async_evd_handle */
6969e39c5baSBill Taylor 	IN DAT_IA_ATTR_MASK,		/* ia_params_mask */
6979e39c5baSBill Taylor 	OUT DAT_IA_ATTR *,		/* ia_params */
6989e39c5baSBill Taylor 	IN DAT_PROVIDER_ATTR_MASK,	/* provider_params_mask */
6999e39c5baSBill Taylor 	OUT DAT_PROVIDER_ATTR *);	/* provider_params */
7009e39c5baSBill Taylor 
7019e39c5baSBill Taylor 
7029e39c5baSBill Taylor /* helper functions */
7039e39c5baSBill Taylor extern DAT_RETURN
7049e39c5baSBill Taylor dapl_set_consumer_context(
7059e39c5baSBill Taylor 	IN DAT_HANDLE,		/* dat handle */
7069e39c5baSBill Taylor 	IN DAT_CONTEXT);	/* context */
7079e39c5baSBill Taylor 
7089e39c5baSBill Taylor extern DAT_RETURN
7099e39c5baSBill Taylor dapl_get_consumer_context(
7109e39c5baSBill Taylor 	IN DAT_HANDLE,		/* dat handle */
7119e39c5baSBill Taylor 	OUT DAT_CONTEXT *);	/* context */
7129e39c5baSBill Taylor 
7139e39c5baSBill Taylor extern DAT_RETURN
7149e39c5baSBill Taylor dapl_get_handle_type(
7159e39c5baSBill Taylor 	IN DAT_HANDLE,
7169e39c5baSBill Taylor 	OUT DAT_HANDLE_TYPE *);
7179e39c5baSBill Taylor 
7189e39c5baSBill Taylor 
7199e39c5baSBill Taylor /* CNO functions */
7209e39c5baSBill Taylor extern DAT_RETURN
7219e39c5baSBill Taylor dapl_cno_create(
7229e39c5baSBill Taylor 	IN DAT_IA_HANDLE,		/* ia_handle */
7239e39c5baSBill Taylor 	IN DAT_OS_WAIT_PROXY_AGENT,	/* agent */
7249e39c5baSBill Taylor 	OUT DAT_CNO_HANDLE *);		/* cno_handle */
7259e39c5baSBill Taylor 
7269e39c5baSBill Taylor extern DAT_RETURN
7279e39c5baSBill Taylor dapl_cno_modify_agent(
7289e39c5baSBill Taylor 	IN DAT_CNO_HANDLE,		/* cno_handle */
7299e39c5baSBill Taylor 	IN DAT_OS_WAIT_PROXY_AGENT);	/* agent */
7309e39c5baSBill Taylor 
7319e39c5baSBill Taylor extern DAT_RETURN
7329e39c5baSBill Taylor dapl_cno_query(
7339e39c5baSBill Taylor 	IN DAT_CNO_HANDLE,	/* cno_handle */
7349e39c5baSBill Taylor 	IN DAT_CNO_PARAM_MASK,	/* cno_param_mask */
7359e39c5baSBill Taylor 	OUT DAT_CNO_PARAM *);	/* cno_param */
7369e39c5baSBill Taylor 
7379e39c5baSBill Taylor extern DAT_RETURN
7389e39c5baSBill Taylor dapl_cno_free(IN DAT_CNO_HANDLE);	/* cno_handle */
7399e39c5baSBill Taylor 
7409e39c5baSBill Taylor extern DAT_RETURN
7419e39c5baSBill Taylor dapl_cno_wait(
7429e39c5baSBill Taylor 	IN DAT_CNO_HANDLE,	/* cno_handle */
7439e39c5baSBill Taylor 	IN DAT_TIMEOUT,		/* timeout */
7449e39c5baSBill Taylor 	OUT DAT_EVD_HANDLE *);	/* evd_handle */
7459e39c5baSBill Taylor 
7469e39c5baSBill Taylor 
7479e39c5baSBill Taylor /* CR Functions */
7489e39c5baSBill Taylor extern DAT_RETURN
7499e39c5baSBill Taylor dapl_cr_query(
7509e39c5baSBill Taylor 	IN DAT_CR_HANDLE,	/* cr_handle */
7519e39c5baSBill Taylor 	IN DAT_CR_PARAM_MASK,	/* cr_args_mask */
7529e39c5baSBill Taylor 	OUT DAT_CR_PARAM *);	/* cwr_args */
7539e39c5baSBill Taylor 
7549e39c5baSBill Taylor extern DAT_RETURN
7559e39c5baSBill Taylor dapl_cr_accept(
7569e39c5baSBill Taylor 	IN DAT_CR_HANDLE,	/* cr_handle */
7579e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
7589e39c5baSBill Taylor 	IN DAT_COUNT,		/* private_data_size */
7599e39c5baSBill Taylor 	IN const DAT_PVOID);	/* private_data */
7609e39c5baSBill Taylor 
7619e39c5baSBill Taylor extern DAT_RETURN
7629e39c5baSBill Taylor dapl_cr_reject(IN DAT_CR_HANDLE);
7639e39c5baSBill Taylor 
7649e39c5baSBill Taylor extern DAT_RETURN
7659e39c5baSBill Taylor dapl_cr_handoff(
7669e39c5baSBill Taylor 	IN DAT_CR_HANDLE,	/* cr_handle */
7679e39c5baSBill Taylor 	IN DAT_CONN_QUAL);	/* handoff */
7689e39c5baSBill Taylor 
7699e39c5baSBill Taylor /* EVD Functions */
7709e39c5baSBill Taylor extern DAT_RETURN
7719e39c5baSBill Taylor dapl_evd_create(
7729e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
7739e39c5baSBill Taylor 	IN DAT_COUNT,		/* evd_min_qlen */
7749e39c5baSBill Taylor 	IN DAT_CNO_HANDLE,	/* cno_handle */
7759e39c5baSBill Taylor 	IN DAT_EVD_FLAGS,	/* evd_flags */
7769e39c5baSBill Taylor 	OUT DAT_EVD_HANDLE *);	/* evd_handle */
7779e39c5baSBill Taylor 
7789e39c5baSBill Taylor extern DAT_RETURN
7799e39c5baSBill Taylor dapl_evd_query(
7809e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
7819e39c5baSBill Taylor 	IN DAT_EVD_PARAM_MASK,	/* evd_args_mask */
7829e39c5baSBill Taylor 	OUT DAT_EVD_PARAM *);	/* evd_args */
7839e39c5baSBill Taylor 
7849e39c5baSBill Taylor #if 0				/* kdapl */
7859e39c5baSBill Taylor extern DAT_RETURN
7869e39c5baSBill Taylor dapl_evd_modify_upcall(
7879e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
7889e39c5baSBill Taylor 	IN DAT_UPCALL_POLICY,	/* upcall_policy */
7899e39c5baSBill Taylor 	IN DAT_UPCALL_OBJECT);	/* upcall */
7909e39c5baSBill Taylor #else
7919e39c5baSBill Taylor 
7929e39c5baSBill Taylor extern DAT_RETURN
7939e39c5baSBill Taylor dapl_evd_modify_cno(
7949e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
7959e39c5baSBill Taylor 	IN DAT_CNO_HANDLE);	/* cno_handle */
7969e39c5baSBill Taylor 
7979e39c5baSBill Taylor extern DAT_RETURN
7989e39c5baSBill Taylor dapl_evd_enable(IN DAT_EVD_HANDLE);	/* evd_handle */
7999e39c5baSBill Taylor 
8009e39c5baSBill Taylor extern DAT_RETURN
8019e39c5baSBill Taylor dapl_evd_disable(IN DAT_EVD_HANDLE);	/* evd_handle */
8029e39c5baSBill Taylor 
8039e39c5baSBill Taylor extern DAT_RETURN
8049e39c5baSBill Taylor dapl_evd_wait(
8059e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
8069e39c5baSBill Taylor 	IN DAT_TIMEOUT,		/* timeout */
8079e39c5baSBill Taylor 	IN DAT_COUNT,		/* threshold */
8089e39c5baSBill Taylor 	OUT DAT_EVENT *,	/* event */
8099e39c5baSBill Taylor 	OUT DAT_COUNT *);	/* nmore */
8109e39c5baSBill Taylor #endif
8119e39c5baSBill Taylor 
8129e39c5baSBill Taylor extern DAT_RETURN
8139e39c5baSBill Taylor dapl_evd_resize(
8149e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
8159e39c5baSBill Taylor 	IN DAT_COUNT);		/* evd_qlen */
8169e39c5baSBill Taylor 
8179e39c5baSBill Taylor extern DAT_RETURN
8189e39c5baSBill Taylor dapl_evd_wait(
8199e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
8209e39c5baSBill Taylor 	IN DAT_TIMEOUT,		/* timeout */
8219e39c5baSBill Taylor 	IN DAT_COUNT,		/* threshold */
8229e39c5baSBill Taylor 	OUT DAT_EVENT *,	/* event */
8239e39c5baSBill Taylor 	OUT DAT_COUNT *);	/* nmore */
8249e39c5baSBill Taylor 
8259e39c5baSBill Taylor extern DAT_RETURN
8269e39c5baSBill Taylor dapl_evd_post_se(
8279e39c5baSBill Taylor 	DAT_EVD_HANDLE,		/* evd_handle */
8289e39c5baSBill Taylor 	const DAT_EVENT *);	/* event */
8299e39c5baSBill Taylor 
8309e39c5baSBill Taylor extern DAT_RETURN
8319e39c5baSBill Taylor dapl_evd_dequeue(
8329e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
8339e39c5baSBill Taylor 	OUT DAT_EVENT *);	/* event */
8349e39c5baSBill Taylor 
8359e39c5baSBill Taylor extern DAT_RETURN
8369e39c5baSBill Taylor dapl_evd_free(IN DAT_EVD_HANDLE);
8379e39c5baSBill Taylor 
8389e39c5baSBill Taylor extern DAT_RETURN
8399e39c5baSBill Taylor dapl_evd_set_unwaitable(IN DAT_EVD_HANDLE evd_handle);
8409e39c5baSBill Taylor 
8419e39c5baSBill Taylor extern DAT_RETURN
8429e39c5baSBill Taylor dapl_evd_clear_unwaitable(IN DAT_EVD_HANDLE evd_handle);
8439e39c5baSBill Taylor 
8449e39c5baSBill Taylor 
8459e39c5baSBill Taylor /* EP functions */
8469e39c5baSBill Taylor extern DAT_RETURN
8479e39c5baSBill Taylor dapl_ep_create(
8489e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
8499e39c5baSBill Taylor 	IN DAT_PZ_HANDLE,	/* pz_handle */
8509e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* in_dto_completion_evd_handle */
8519e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* out_dto_completion_evd_handle */
8529e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* connect_evd_handle */
8539e39c5baSBill Taylor 	IN const DAT_EP_ATTR *,	/* ep_parameters */
8549e39c5baSBill Taylor 	OUT DAT_EP_HANDLE *);	/* ep_handle */
8559e39c5baSBill Taylor 
8569e39c5baSBill Taylor extern DAT_RETURN
8579e39c5baSBill Taylor dapl_ep_query(
8589e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
8599e39c5baSBill Taylor 	IN DAT_EP_PARAM_MASK,	/* ep_args_mask */
8609e39c5baSBill Taylor 	OUT DAT_EP_PARAM *);	/* ep_args */
8619e39c5baSBill Taylor 
8629e39c5baSBill Taylor extern DAT_RETURN
8639e39c5baSBill Taylor dapl_ep_modify(
8649e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
8659e39c5baSBill Taylor 	IN DAT_EP_PARAM_MASK,		/* ep_args_mask */
8669e39c5baSBill Taylor 	IN const DAT_EP_PARAM *);	/* ep_args */
8679e39c5baSBill Taylor 
8689e39c5baSBill Taylor extern DAT_RETURN
8699e39c5baSBill Taylor dapl_ep_connect(
8709e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
8719e39c5baSBill Taylor 	IN DAT_IA_ADDRESS_PTR,	/* remote_ia_address */
8729e39c5baSBill Taylor 	IN DAT_CONN_QUAL,	/* remote_conn_qual */
8739e39c5baSBill Taylor 	IN DAT_TIMEOUT,		/* timeout */
8749e39c5baSBill Taylor 	IN DAT_COUNT,		/* private_data_size */
8759e39c5baSBill Taylor 	IN const DAT_PVOID,	/* private_data  */
8769e39c5baSBill Taylor 	IN DAT_QOS,		/* quality_of_service */
8779e39c5baSBill Taylor 	IN DAT_CONNECT_FLAGS);	/* connect_flags */
8789e39c5baSBill Taylor 
8799e39c5baSBill Taylor extern DAT_RETURN
8809e39c5baSBill Taylor dapl_ep_dup_connect(
8819e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
8829e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_dup_handle */
8839e39c5baSBill Taylor 	IN DAT_TIMEOUT,		/* timeout */
8849e39c5baSBill Taylor 	IN DAT_COUNT,		/* private_data_size */
8859e39c5baSBill Taylor 	IN const DAT_PVOID,	/* private_data */
8869e39c5baSBill Taylor 	IN DAT_QOS);		/* quality_of_service */
8879e39c5baSBill Taylor 
8889e39c5baSBill Taylor extern DAT_RETURN
8899e39c5baSBill Taylor dapl_ep_disconnect(
8909e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
8919e39c5baSBill Taylor 	IN DAT_CLOSE_FLAGS);	/* completion_flags */
8929e39c5baSBill Taylor 
8939e39c5baSBill Taylor extern DAT_RETURN
8949e39c5baSBill Taylor dapl_ep_post_send(
8959e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
8969e39c5baSBill Taylor 	IN DAT_COUNT,			/* num_segments */
8979e39c5baSBill Taylor 	IN DAT_LMR_TRIPLET *,		/* local_iov */
8989e39c5baSBill Taylor 	IN DAT_DTO_COOKIE,		/* user_cookie */
8999e39c5baSBill Taylor 	IN DAT_COMPLETION_FLAGS);	/* completion_flags */
9009e39c5baSBill Taylor 
9019e39c5baSBill Taylor extern DAT_RETURN
9029e39c5baSBill Taylor dapl_ep_post_recv(
9039e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
9049e39c5baSBill Taylor 	IN DAT_COUNT,			/* num_segments */
9059e39c5baSBill Taylor 	IN DAT_LMR_TRIPLET *,		/* local_iov */
9069e39c5baSBill Taylor 	IN DAT_DTO_COOKIE,		/* user_cookie */
9079e39c5baSBill Taylor 	IN DAT_COMPLETION_FLAGS);	/* completion_flags */
9089e39c5baSBill Taylor 
9099e39c5baSBill Taylor extern DAT_RETURN
9109e39c5baSBill Taylor dapl_ep_post_rdma_read(
9119e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
9129e39c5baSBill Taylor 	IN DAT_COUNT,			/* num_segments */
9139e39c5baSBill Taylor 	IN DAT_LMR_TRIPLET *,		/* local_iov */
9149e39c5baSBill Taylor 	IN DAT_DTO_COOKIE,		/* user_cookie */
9159e39c5baSBill Taylor 	IN const DAT_RMR_TRIPLET *,	/* remote_iov */
9169e39c5baSBill Taylor 	IN DAT_COMPLETION_FLAGS);	/* completion_flags */
9179e39c5baSBill Taylor 
9189e39c5baSBill Taylor extern DAT_RETURN
9199e39c5baSBill Taylor dapl_ep_post_rdma_write(
9209e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
9219e39c5baSBill Taylor 	IN DAT_COUNT,			/* num_segments */
9229e39c5baSBill Taylor 	IN DAT_LMR_TRIPLET *,		/* local_iov */
9239e39c5baSBill Taylor 	IN DAT_DTO_COOKIE,		/* user_cookie */
9249e39c5baSBill Taylor 	IN const DAT_RMR_TRIPLET *,	/* remote_iov */
9259e39c5baSBill Taylor 	IN DAT_COMPLETION_FLAGS);	/* completion_flags */
9269e39c5baSBill Taylor 
9279e39c5baSBill Taylor extern DAT_RETURN
9289e39c5baSBill Taylor dapl_ep_get_status(
9299e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
9309e39c5baSBill Taylor 	OUT DAT_EP_STATE *,	/* ep_state */
9319e39c5baSBill Taylor 	OUT DAT_BOOLEAN *,	/* in_dto_idle */
9329e39c5baSBill Taylor 	OUT DAT_BOOLEAN *);	/* out_dto_idle */
9339e39c5baSBill Taylor 
9349e39c5baSBill Taylor extern DAT_RETURN
9359e39c5baSBill Taylor dapl_ep_free(IN DAT_EP_HANDLE);		/* ep_handle */
9369e39c5baSBill Taylor 
9379e39c5baSBill Taylor extern DAT_RETURN
9389e39c5baSBill Taylor dapl_ep_reset(IN DAT_EP_HANDLE);	/* ep_handle */
9399e39c5baSBill Taylor 
9409e39c5baSBill Taylor 
9419e39c5baSBill Taylor /* LMR functions */
9429e39c5baSBill Taylor extern DAT_RETURN
9439e39c5baSBill Taylor dapl_lmr_create(
9449e39c5baSBill Taylor 	IN DAT_IA_HANDLE,		/* ia_handle */
9459e39c5baSBill Taylor 	IN DAT_MEM_TYPE,		/* mem_type */
9469e39c5baSBill Taylor 	IN DAT_REGION_DESCRIPTION,	/* region_description */
9479e39c5baSBill Taylor 	IN DAT_VLEN,			/* length */
9489e39c5baSBill Taylor 	IN DAT_PZ_HANDLE,		/* pz_handle */
9499e39c5baSBill Taylor 	IN DAT_MEM_PRIV_FLAGS,		/* privileges */
9509e39c5baSBill Taylor 	OUT DAT_LMR_HANDLE *,		/* lmr_handle */
9519e39c5baSBill Taylor 	OUT DAT_LMR_CONTEXT *,		/* lmr_context */
9529e39c5baSBill Taylor 	OUT DAT_RMR_CONTEXT *,		/* rmr_context */
9539e39c5baSBill Taylor 	OUT DAT_VLEN *,			/* registered_length */
9549e39c5baSBill Taylor 	OUT DAT_VADDR *);		/* registered_address */
9559e39c5baSBill Taylor 
9569e39c5baSBill Taylor extern DAT_RETURN
9579e39c5baSBill Taylor dapl_lmr_query(
9589e39c5baSBill Taylor 	IN DAT_LMR_HANDLE,
9599e39c5baSBill Taylor 	IN DAT_LMR_PARAM_MASK,
9609e39c5baSBill Taylor 	OUT DAT_LMR_PARAM *);
9619e39c5baSBill Taylor 
9629e39c5baSBill Taylor extern DAT_RETURN
9639e39c5baSBill Taylor dapl_lmr_free(IN DAT_LMR_HANDLE);
9649e39c5baSBill Taylor 
9659e39c5baSBill Taylor 
9669e39c5baSBill Taylor /* RMR Functions */
9679e39c5baSBill Taylor extern DAT_RETURN
9689e39c5baSBill Taylor dapl_rmr_create(
9699e39c5baSBill Taylor 	IN DAT_PZ_HANDLE,	/* pz_handle */
9709e39c5baSBill Taylor 	OUT DAT_RMR_HANDLE *);	/* rmr_handle */
9719e39c5baSBill Taylor 
9729e39c5baSBill Taylor extern DAT_RETURN
9739e39c5baSBill Taylor dapl_rmr_query(
9749e39c5baSBill Taylor 	IN DAT_RMR_HANDLE,	/* rmr_handle */
9759e39c5baSBill Taylor 	IN DAT_RMR_PARAM_MASK,	/* rmr_args_mask */
9769e39c5baSBill Taylor 	OUT DAT_RMR_PARAM *);	/* rmr_args */
9779e39c5baSBill Taylor 
9789e39c5baSBill Taylor extern DAT_RETURN
9799e39c5baSBill Taylor dapl_rmr_bind(
9809e39c5baSBill Taylor 	IN DAT_RMR_HANDLE,		/* rmr_handle */
9819e39c5baSBill Taylor 	IN const DAT_LMR_TRIPLET *,	/* lmr_triplet */
9829e39c5baSBill Taylor 	IN DAT_MEM_PRIV_FLAGS,		/* mem_priv */
9839e39c5baSBill Taylor 	IN DAT_EP_HANDLE,		/* ep_handle */
9849e39c5baSBill Taylor 	IN DAT_RMR_COOKIE,		/* user_cookie */
9859e39c5baSBill Taylor 	IN DAT_COMPLETION_FLAGS,	/* completion_flags */
9869e39c5baSBill Taylor 	INOUT DAT_RMR_CONTEXT *);	/* context */
9879e39c5baSBill Taylor 
9889e39c5baSBill Taylor extern DAT_RETURN
9899e39c5baSBill Taylor dapl_rmr_free(IN DAT_RMR_HANDLE);
9909e39c5baSBill Taylor 
9919e39c5baSBill Taylor 
9929e39c5baSBill Taylor /* PSP Functions */
9939e39c5baSBill Taylor extern DAT_RETURN
9949e39c5baSBill Taylor dapl_psp_create(
9959e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
9969e39c5baSBill Taylor 	IN DAT_CONN_QUAL,	/* conn_qual */
9979e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
9989e39c5baSBill Taylor 	IN DAT_PSP_FLAGS,	/* psp_flags */
9999e39c5baSBill Taylor 	OUT DAT_PSP_HANDLE *);	/* psp_handle */
10009e39c5baSBill Taylor 
10019e39c5baSBill Taylor extern DAT_RETURN
10029e39c5baSBill Taylor dapl_psp_create_any(
10039e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
10049e39c5baSBill Taylor 	OUT DAT_CONN_QUAL *,	/* conn_qual */
10059e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
10069e39c5baSBill Taylor 	IN DAT_PSP_FLAGS,	/* psp_flags */
10079e39c5baSBill Taylor 	OUT DAT_PSP_HANDLE *);	/* psp_handle */
10089e39c5baSBill Taylor 
10099e39c5baSBill Taylor extern DAT_RETURN
10109e39c5baSBill Taylor dapl_psp_query(
10119e39c5baSBill Taylor 	IN DAT_PSP_HANDLE,
10129e39c5baSBill Taylor 	IN DAT_PSP_PARAM_MASK,
10139e39c5baSBill Taylor 	OUT DAT_PSP_PARAM *);
10149e39c5baSBill Taylor 
10159e39c5baSBill Taylor extern DAT_RETURN
10169e39c5baSBill Taylor dapl_psp_free(IN DAT_PSP_HANDLE);	/* psp_handle */
10179e39c5baSBill Taylor 
10189e39c5baSBill Taylor 
10199e39c5baSBill Taylor /* RSP Functions */
10209e39c5baSBill Taylor extern DAT_RETURN
10219e39c5baSBill Taylor dapl_rsp_create(
10229e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
10239e39c5baSBill Taylor 	IN DAT_CONN_QUAL,	/* conn_qual */
10249e39c5baSBill Taylor 	IN DAT_EP_HANDLE,	/* ep_handle */
10259e39c5baSBill Taylor 	IN DAT_EVD_HANDLE,	/* evd_handle */
10269e39c5baSBill Taylor 	OUT DAT_RSP_HANDLE *);	/* rsp_handle */
10279e39c5baSBill Taylor 
10289e39c5baSBill Taylor extern DAT_RETURN
10299e39c5baSBill Taylor dapl_rsp_query(
10309e39c5baSBill Taylor 	IN DAT_RSP_HANDLE,
10319e39c5baSBill Taylor 	IN DAT_RSP_PARAM_MASK,
10329e39c5baSBill Taylor 	OUT DAT_RSP_PARAM *);
10339e39c5baSBill Taylor 
10349e39c5baSBill Taylor extern DAT_RETURN
10359e39c5baSBill Taylor dapl_rsp_free(IN DAT_RSP_HANDLE);	/* rsp_handle */
10369e39c5baSBill Taylor 
10379e39c5baSBill Taylor 
10389e39c5baSBill Taylor /* PZ Functions */
10399e39c5baSBill Taylor extern DAT_RETURN
10409e39c5baSBill Taylor dapl_pz_create(
10419e39c5baSBill Taylor 	IN DAT_IA_HANDLE,	/* ia_handle */
10429e39c5baSBill Taylor 	OUT DAT_PZ_HANDLE *);	/* pz_handle */
10439e39c5baSBill Taylor 
10449e39c5baSBill Taylor extern DAT_RETURN
10459e39c5baSBill Taylor dapl_pz_query(