17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*03494a98SBill Taylor  * Common Development and Distribution License (the "License").
6*03494a98SBill Taylor  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
227c478bd9Sstevel@tonic-gate  * Copyright (c) 2002-2004, Network Appliance, Inc. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26*03494a98SBill Taylor  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef	_DAT_H_
317c478bd9Sstevel@tonic-gate #define	_DAT_H_
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate /*
347c478bd9Sstevel@tonic-gate  *
357c478bd9Sstevel@tonic-gate  * HEADER: dat.h
367c478bd9Sstevel@tonic-gate  *
377c478bd9Sstevel@tonic-gate  * PURPOSE: defines the common DAT API for uDAPL and kDAPL.
387c478bd9Sstevel@tonic-gate  *
397c478bd9Sstevel@tonic-gate  * Description: Header file for "uDAPL: User Direct Access Programming
407c478bd9Sstevel@tonic-gate  *		Library, Version: 1.2"
417c478bd9Sstevel@tonic-gate  *
427c478bd9Sstevel@tonic-gate  * Mapping rules:
437c478bd9Sstevel@tonic-gate  *      All global symbols are prepended with "DAT_" or "dat_"
447c478bd9Sstevel@tonic-gate  *      All DAT objects have an 'api' tag which, such as 'ep' or 'lmr'
457c478bd9Sstevel@tonic-gate  *      The method table is in the provider definition structure.
467c478bd9Sstevel@tonic-gate  *
477c478bd9Sstevel@tonic-gate  *
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #ifdef __cplusplus
517c478bd9Sstevel@tonic-gate extern "C" {
527c478bd9Sstevel@tonic-gate #endif
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #include <dat/dat_error.h>
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate /* Generic DAT types */
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate typedef char *DAT_NAME_PTR;   /* Format for ia_name and attributes */
597c478bd9Sstevel@tonic-gate #define	DAT_NAME_MAX_LENGTH	256
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Used for provider, vendor, transport, hardware specific attributes
637c478bd9Sstevel@tonic-gate  * definitions.
647c478bd9Sstevel@tonic-gate  */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate typedef struct dat_named_attr {
677c478bd9Sstevel@tonic-gate 	const char	*name;   /* Name of attribute  */
687c478bd9Sstevel@tonic-gate 	const char	*value;  /* Value of attribute */
697c478bd9Sstevel@tonic-gate } DAT_NAMED_ATTR;
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate typedef enum dat_boolean {
727c478bd9Sstevel@tonic-gate 	DAT_FALSE = 0,
737c478bd9Sstevel@tonic-gate 	DAT_TRUE = 1
747c478bd9Sstevel@tonic-gate } DAT_BOOLEAN;
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate typedef union dat_context {
777c478bd9Sstevel@tonic-gate 	DAT_PVOID	as_ptr;
787c478bd9Sstevel@tonic-gate 	DAT_UINT64	as_64;
797c478bd9Sstevel@tonic-gate 	DAT_UVERYLONG	as_index;
807c478bd9Sstevel@tonic-gate } DAT_CONTEXT;
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate typedef DAT_CONTEXT	DAT_DTO_COOKIE;
837c478bd9Sstevel@tonic-gate typedef DAT_CONTEXT	DAT_RMR_COOKIE;
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate typedef enum dat_completion_flags {
867c478bd9Sstevel@tonic-gate 	/* Completes with notification					*/
877c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_DEFAULT_FLAG			= 0x00,
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate 	/* Completions suppressed if successful				*/
907c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_SUPPRESS_FLAG			= 0x01,
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate 	/* Sender controlled notification for recv completion		*/
937c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_SOLICITED_WAIT_FLAG		= 0x02,
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate 	/* Completions with unsignaled notifications			*/
967c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_UNSIGNALLED_FLAG			= 0x04,
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate 	/* Do not start processing until all previous RDMA reads complete. */
997c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_BARRIER_FENCE_FLAG		= 0x08,
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate 	/*
1027c478bd9Sstevel@tonic-gate 	 * Only valid for uDAPL as EP attribute for Recv Completion flags.
1037c478bd9Sstevel@tonic-gate 	 * Waiter unblocking is controlled by Threshold value of dat_evd_wait.
1047c478bd9Sstevel@tonic-gate 	 * UNSIGNALLED for RECV not allowed when EP has this attribute
1057c478bd9Sstevel@tonic-gate 	 */
1067c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_EVD_THRESHOLD_FLAG		= 0x10
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate } DAT_COMPLETION_FLAGS;
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate typedef	DAT_UINT32	DAT_TIMEOUT;		/* microseconds */
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate /* timeout = infinity */
1147c478bd9Sstevel@tonic-gate #define	DAT_TIMEOUT_INFINITE	((DAT_TIMEOUT) ~0)
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /* dat handles */
1177c478bd9Sstevel@tonic-gate typedef DAT_PVOID	DAT_HANDLE;
1187c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_CR_HANDLE;
1197c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_EP_HANDLE;
1207c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_EVD_HANDLE;
1217c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_IA_HANDLE;
1227c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_LMR_HANDLE;
1237c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_PSP_HANDLE;
1247c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_PZ_HANDLE;
1257c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_RMR_HANDLE;
1267c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_RSP_HANDLE;
1277c478bd9Sstevel@tonic-gate typedef DAT_HANDLE	DAT_SRQ_HANDLE;
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate /* dat NULL handles */
1317c478bd9Sstevel@tonic-gate #define	DAT_HANDLE_NULL	((DAT_HANDLE)NULL)
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate typedef DAT_SOCK_ADDR   *DAT_IA_ADDRESS_PTR;
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate typedef DAT_UINT64	DAT_CONN_QUAL;
1367c478bd9Sstevel@tonic-gate typedef DAT_UINT64	DAT_PORT_QUAL;
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate /* QOS definitions */
1397c478bd9Sstevel@tonic-gate typedef enum dat_qos {
1407c478bd9Sstevel@tonic-gate 	DAT_QOS_BEST_EFFORT		= 0x00,
1417c478bd9Sstevel@tonic-gate 	DAT_QOS_HIGH_THROUGHPUT		= 0x01,
1427c478bd9Sstevel@tonic-gate 	DAT_QOS_LOW_LATENCY		= 0x02,
1437c478bd9Sstevel@tonic-gate 	/* not low latency, nor high throughput   */
1447c478bd9Sstevel@tonic-gate 	DAT_QOS_ECONOMY			= 0x04,
1457c478bd9Sstevel@tonic-gate 	/* both low latency and high throughput   */
1467c478bd9Sstevel@tonic-gate 	DAT_QOS_PREMIUM			= 0x08
1477c478bd9Sstevel@tonic-gate } DAT_QOS;
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate /*
1507c478bd9Sstevel@tonic-gate  * FLAGS
1517c478bd9Sstevel@tonic-gate  */
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate typedef enum dat_connect_flags {
1547c478bd9Sstevel@tonic-gate 	DAT_CONNECT_DEFAULT_FLAG	= 0x00,
1557c478bd9Sstevel@tonic-gate 	DAT_CONNECT_MULTIPATH_FLAG	= 0x01
1567c478bd9Sstevel@tonic-gate } DAT_CONNECT_FLAGS;
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate typedef enum dat_close_flags {
1597c478bd9Sstevel@tonic-gate 	DAT_CLOSE_ABRUPT_FLAG		= 0x00,
1607c478bd9Sstevel@tonic-gate 	DAT_CLOSE_GRACEFUL_FLAG		= 0x01
1617c478bd9Sstevel@tonic-gate } DAT_CLOSE_FLAGS;
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate #define	DAT_CLOSE_DEFAULT	DAT_CLOSE_ABRUPT_FLAG
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate typedef enum dat_evd_flags {
1667c478bd9Sstevel@tonic-gate 	DAT_EVD_SOFTWARE_FLAG		= 0x001,
1677c478bd9Sstevel@tonic-gate 	DAT_EVD_CR_FLAG			= 0x010,
1687c478bd9Sstevel@tonic-gate 	DAT_EVD_DTO_FLAG		= 0x020,
1697c478bd9Sstevel@tonic-gate 	DAT_EVD_CONNECTION_FLAG		= 0x040,
1707c478bd9Sstevel@tonic-gate 	DAT_EVD_RMR_BIND_FLAG		= 0x080,
1717c478bd9Sstevel@tonic-gate 	DAT_EVD_ASYNC_FLAG		= 0x100,
1727c478bd9Sstevel@tonic-gate 	/* DAT events only, no software events */
1737c478bd9Sstevel@tonic-gate 	DAT_EVD_DEFAULT_FLAG		= 0x1F0
1747c478bd9Sstevel@tonic-gate } DAT_EVD_FLAGS;
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate typedef enum dat_psp_flags {
1777c478bd9Sstevel@tonic-gate 	DAT_PSP_CONSUMER_FLAG	= 0x00, /*  Consumer creates an endpoint */
1787c478bd9Sstevel@tonic-gate 	DAT_PSP_PROVIDER_FLAG	= 0x01  /*  Provider creates an endpoint */
1797c478bd9Sstevel@tonic-gate } DAT_PSP_FLAGS;
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate /*
1827c478bd9Sstevel@tonic-gate  * Memory Buffers
1837c478bd9Sstevel@tonic-gate  *
1847c478bd9Sstevel@tonic-gate  * Both LMR and RMR triplets specify 64-bit addresses in the local host's byte
1857c478bd9Sstevel@tonic-gate  * order, even when that exceeds the size of a DAT_PVOID for the host
1867c478bd9Sstevel@tonic-gate  * architecture.
1877c478bd9Sstevel@tonic-gate  */
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate /*
1907c478bd9Sstevel@tonic-gate  * Both LMR and RMR Triplets specify 64-bit addresses in the local host
1917c478bd9Sstevel@tonic-gate  * order, even when that exceeds the size of a void pointer for the host
1927c478bd9Sstevel@tonic-gate  * architecture. The DAT_VADDR type that represents addresses is in the
1937c478bd9Sstevel@tonic-gate  * native byte-order of the local host. Helper macros that allow Consumers
1947c478bd9Sstevel@tonic-gate  * to convert DAT_VADDR into various orders that might be useful for
1957c478bd9Sstevel@tonic-gate  * inclusion of RMR Triplets into a payload of a message follow.
1967c478bd9Sstevel@tonic-gate  *
1977c478bd9Sstevel@tonic-gate  * DAT defines the following macros to convert the fields on an RMR Triplet
1987c478bd9Sstevel@tonic-gate  * to defined byte orders to allow their export by the Consumer over wire
1997c478bd9Sstevel@tonic-gate  * protocols. DAT does not define how the two peers decide which byte should be
2007c478bd9Sstevel@tonic-gate  * used.
2017c478bd9Sstevel@tonic-gate  *
2027c478bd9Sstevel@tonic-gate  * DAT_LMRC_TO_LSB(lmrc) returns the supplied LMR Context in ls-byte
2037c478bd9Sstevel@tonic-gate  * order.
2047c478bd9Sstevel@tonic-gate  * DAT_LMRC_TO_MSB(lmrc) returns the supplied LMR Context in ms-byte
2057c478bd9Sstevel@tonic-gate  * order.
2067c478bd9Sstevel@tonic-gate  * DAT_RMRC_TO_LSB(rmrc) returns the supplied RMR Context in ls-byte
2077c478bd9Sstevel@tonic-gate  * order.
2087c478bd9Sstevel@tonic-gate  * DAT_RMRC_TO_MSB(rmrc) returns the supplied RMR Context in ms-byte
2097c478bd9Sstevel@tonic-gate  * order.
2107c478bd9Sstevel@tonic-gate  * DAT_VADDR_TO_LSB(vaddr) returns the supplied Virtual Address in ls-byte
2117c478bd9Sstevel@tonic-gate  * order.
2127c478bd9Sstevel@tonic-gate  * DAT_VADDR_TO_MSB(vaddr) returns the supplied Virtual Address in
2137c478bd9Sstevel@tonic-gate  * ms-byte order.
2147c478bd9Sstevel@tonic-gate  * DAT_VLEN_TO_LSB(vlen) returns the supplied length in ls-byte order.
2157c478bd9Sstevel@tonic-gate  * DAT_VLEN_TO_MSB(vlen) returns the supplied length in ms-byte order.
2167c478bd9Sstevel@tonic-gate  *
2177c478bd9Sstevel@tonic-gate  * Consumers are free to use 64-bit or 32-bit arithmetic for local or remote
2187c478bd9Sstevel@tonic-gate  * memory address and length manipulation in their preferred byte-order. Only
2197c478bd9Sstevel@tonic-gate  * the LMR and RMR Triplets passed to a Provider as part of a Posted DTO are
2207c478bd9Sstevel@tonic-gate  * required to be in 64-bit address and local host order formats. Providers
2217c478bd9Sstevel@tonic-gate  * shall convert RMR_Triplets to a Transport-required wire format.
2227c478bd9Sstevel@tonic-gate  *
2237c478bd9Sstevel@tonic-gate  * For the best performance, Consumers should align each buffer segment to
2247c478bd9Sstevel@tonic-gate  * the boundary specified by the dat_optimal_alignment.
2257c478bd9Sstevel@tonic-gate  */
2267c478bd9Sstevel@tonic-gate typedef	DAT_UINT32	DAT_LMR_CONTEXT;
2277c478bd9Sstevel@tonic-gate typedef DAT_UINT32	DAT_RMR_CONTEXT;
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate typedef DAT_UINT64	DAT_VLEN;
2307c478bd9Sstevel@tonic-gate typedef DAT_UINT64	DAT_VADDR;
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate typedef struct dat_provider_attr	DAT_PROVIDER_ATTR;
2337c478bd9Sstevel@tonic-gate typedef struct dat_evd_param		DAT_EVD_PARAM;
2347c478bd9Sstevel@tonic-gate typedef struct dat_lmr_param		DAT_LMR_PARAM;
2357c478bd9Sstevel@tonic-gate 
2367c478bd9Sstevel@tonic-gate /*
2377c478bd9Sstevel@tonic-gate  * It is legal for Consumer to specify zero for segment_length
2387c478bd9Sstevel@tonic-gate  * of the dat_lmr_triplet. When 0 is specified for the
2397c478bd9Sstevel@tonic-gate  * segment_length then the other two elements of the
2407c478bd9Sstevel@tonic-gate  * dat_lmr_triplet are irrelevant and can be invalid.
2417c478bd9Sstevel@tonic-gate  */
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate typedef struct dat_lmr_triplet {
2447c478bd9Sstevel@tonic-gate 	DAT_LMR_CONTEXT		lmr_context;
2457c478bd9Sstevel@tonic-gate 	DAT_UINT32		pad;
2467c478bd9Sstevel@tonic-gate 	DAT_VADDR		virtual_address;
2477c478bd9Sstevel@tonic-gate 	DAT_VLEN		segment_length;
2487c478bd9Sstevel@tonic-gate } DAT_LMR_TRIPLET;
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate typedef struct dat_rmr_triplet {
2517c478bd9Sstevel@tonic-gate 	DAT_RMR_CONTEXT		rmr_context;
2527c478bd9Sstevel@tonic-gate 	DAT_UINT32		pad;
2537c478bd9Sstevel@tonic-gate 	DAT_VADDR		target_address;
2547c478bd9Sstevel@tonic-gate 	DAT_VLEN		segment_length;
2557c478bd9Sstevel@tonic-gate } DAT_RMR_TRIPLET;
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /*
2587c478bd9Sstevel@tonic-gate  * The extra padding ensures that context, address, and length parameters are
2597c478bd9Sstevel@tonic-gate  * aligned on 64-bit boundaries.
2607c478bd9Sstevel@tonic-gate  */
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate /* Memory privileges */
2637c478bd9Sstevel@tonic-gate 
2647c478bd9Sstevel@tonic-gate typedef enum dat_mem_priv_flags {
2657c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_NONE_FLAG		= 0x00,
2667c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_LOCAL_READ_FLAG	= 0x01,
2677c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_REMOTE_READ_FLAG	= 0x02,
2687c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_LOCAL_WRITE_FLAG	= 0x10,
2697c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_REMOTE_WRITE_FLAG	= 0x20,
270*03494a98SBill Taylor 	DAT_MEM_PRIV_ALL_FLAG		= 0x33,
271*03494a98SBill Taylor 	DAT_MEM_PRIV_RO_DISABLE_FLAG	= 0x100
2727c478bd9Sstevel@tonic-gate } DAT_MEM_PRIV_FLAGS;
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate /*
2757c478bd9Sstevel@tonic-gate  * For backwards compatibility with DAT-1.0 memory privileges values
2767c478bd9Sstevel@tonic-gate  * are supported
2777c478bd9Sstevel@tonic-gate  */
2787c478bd9Sstevel@tonic-gate #define	DAT_MEM_PRIV_READ_FLAG  (DAT_MEM_PRIV_LOCAL_READ_FLAG |		\
2797c478bd9Sstevel@tonic-gate 					DAT_MEM_PRIV_REMOTE_READ_FLAG)
2807c478bd9Sstevel@tonic-gate #define	DAT_MEM_PRIV_WRITE_FLAG (DAT_MEM_PRIV_LOCAL_WRITE_FLAG |	\
2817c478bd9Sstevel@tonic-gate 					DAT_MEM_PRIV_REMOTE_WRITE_FLAG)
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate /* LMR Arguments Mask */
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate typedef enum dat_lmr_param_mask {
2867c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_IA_HANDLE			= 0x001,
2877c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_MEM_TYPE			= 0x002,
2887c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_REGION_DESC		= 0x004,
2897c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_LENGTH			= 0x008,
2907c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_PZ_HANDLE			= 0x010,
2917c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_MEM_PRIV			= 0x020,
2927c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_LMR_CONTEXT		= 0x040,
2937c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_RMR_CONTEXT		= 0x080,
2947c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_REGISTERED_SIZE		= 0x100,
2957c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_REGISTERED_ADDRESS	= 0x200,
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate 	DAT_LMR_FIELD_ALL			= 0x3FF
2987c478bd9Sstevel@tonic-gate } DAT_LMR_PARAM_MASK;
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate /* RMR Argumments & RMR Arguments Mask */
3017c478bd9Sstevel@tonic-gate 
3027c478bd9Sstevel@tonic-gate typedef struct dat_rmr_param {
3037c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE		ia_handle;
3047c478bd9Sstevel@tonic-gate 	DAT_PZ_HANDLE		pz_handle;
3057c478bd9Sstevel@tonic-gate 	DAT_LMR_TRIPLET		lmr_triplet;
3067c478bd9Sstevel@tonic-gate 	DAT_MEM_PRIV_FLAGS	mem_priv;
3077c478bd9Sstevel@tonic-gate 	DAT_RMR_CONTEXT		rmr_context;
3087c478bd9Sstevel@tonic-gate } DAT_RMR_PARAM;
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate typedef enum dat_rmr_param_mask {
3117c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_IA_HANDLE		= 0x01,
3127c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_PZ_HANDLE		= 0x02,
3137c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_LMR_TRIPLET	= 0x04,
3147c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_MEM_PRIV		= 0x08,
3157c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_RMR_CONTEXT	= 0x10,
3167c478bd9Sstevel@tonic-gate 
3177c478bd9Sstevel@tonic-gate 	DAT_RMR_FIELD_ALL		= 0x1F
3187c478bd9Sstevel@tonic-gate } DAT_RMR_PARAM_MASK;
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate /* Provider attributes */
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate typedef enum dat_iov_ownership {
3237c478bd9Sstevel@tonic-gate 	/* Not modification by provider, consumer can use anytime.	*/
3247c478bd9Sstevel@tonic-gate 	DAT_IOV_CONSUMER		= 0x0,
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate 	/* Provider does not modify returned IOV DTO on completion.	*/
3277c478bd9Sstevel@tonic-gate 	DAT_IOV_PROVIDER_NOMOD		= 0x1,
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate 	/* Provider may modify IOV DTO on completion, can't trust it.	*/
3307c478bd9Sstevel@tonic-gate 	DAT_IOV_PROVIDER_MOD		= 0x2
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate } DAT_IOV_OWNERSHIP;
3337c478bd9Sstevel@tonic-gate 
3347c478bd9Sstevel@tonic-gate typedef enum dat_ep_creator_for_psp {
3357c478bd9Sstevel@tonic-gate 	DAT_PSP_CREATES_EP_NEVER,	/* provider never creates endpoint    */
3367c478bd9Sstevel@tonic-gate 	DAT_PSP_CREATES_EP_IFASKED,	/* provider creates endpoint if asked */
3377c478bd9Sstevel@tonic-gate 	DAT_PSP_CREATES_EP_ALWAYS	/* provider always creates endpoint   */
3387c478bd9Sstevel@tonic-gate } DAT_EP_CREATOR_FOR_PSP;
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate /* General Interface Adapter attributes. These apply to both udat and kdat. */
3417c478bd9Sstevel@tonic-gate 
3427c478bd9Sstevel@tonic-gate /* To support backwards compatibility for DAPL-1.0 */
3437c478bd9Sstevel@tonic-gate #define	max_rdma_read_per_ep 		max_rdma_read_per_ep_in
3447c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_DTO_PER_OP 	DAT_IA_FIELD_IA_ MAX_DTO_PER_EP_IN
3457c478bd9Sstevel@tonic-gate 
3467c478bd9Sstevel@tonic-gate /* to support backwards compatibility for DAPL-1.0 & DAPL-1.1 */
3477c478bd9Sstevel@tonic-gate #define	max_mtu_size max_message_size
3487c478bd9Sstevel@tonic-gate 
3497c478bd9Sstevel@tonic-gate typedef struct dat_ia_attr
3507c478bd9Sstevel@tonic-gate {
3517c478bd9Sstevel@tonic-gate 	char				adapter_name[DAT_NAME_MAX_LENGTH];
3527c478bd9Sstevel@tonic-gate 	char				vendor_name[DAT_NAME_MAX_LENGTH];
3537c478bd9Sstevel@tonic-gate 	DAT_UINT32			hardware_version_major;
3547c478bd9Sstevel@tonic-gate 	DAT_UINT32			hardware_version_minor;
3557c478bd9Sstevel@tonic-gate 	DAT_UINT32			firmware_version_major;
3567c478bd9Sstevel@tonic-gate 	DAT_UINT32			firmware_version_minor;
3577c478bd9Sstevel@tonic-gate 	DAT_IA_ADDRESS_PTR		ia_address_ptr;
3587c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_eps;
3597c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_dto_per_ep;
3607c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_per_ep_in;
3617c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_per_ep_out;
3627c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_evds;
3637c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_evd_qlen;
3647c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_iov_segments_per_dto;
3657c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_lmrs;
3667c478bd9Sstevel@tonic-gate 	DAT_VLEN			max_lmr_block_size;
3677c478bd9Sstevel@tonic-gate 	DAT_VADDR			max_lmr_virtual_address;
3687c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_pzs;
3697c478bd9Sstevel@tonic-gate 	DAT_VLEN			max_message_size;
3707c478bd9Sstevel@tonic-gate 	DAT_VLEN			max_rdma_size;
3717c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rmrs;
3727c478bd9Sstevel@tonic-gate 	DAT_VADDR			max_rmr_target_address;
3737c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_srqs;
3747c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_ep_per_srq;
3757c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_recv_per_srq;
3767c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_iov_segments_per_rdma_read;
3777c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_iov_segments_per_rdma_write;
3787c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_in;
3797c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_out;
3807c478bd9Sstevel@tonic-gate 	DAT_BOOLEAN			max_rdma_read_per_ep_in_guaranteed;
3817c478bd9Sstevel@tonic-gate 	DAT_BOOLEAN			max_rdma_read_per_ep_out_guaranteed;
3827c478bd9Sstevel@tonic-gate 	DAT_COUNT			num_transport_attr;
3837c478bd9Sstevel@tonic-gate 	DAT_NAMED_ATTR			*transport_attr;
3847c478bd9Sstevel@tonic-gate 	DAT_COUNT			num_vendor_attr;
3857c478bd9Sstevel@tonic-gate 	DAT_NAMED_ATTR			*vendor_attr;
3867c478bd9Sstevel@tonic-gate } DAT_IA_ATTR;
3877c478bd9Sstevel@tonic-gate 
3887c478bd9Sstevel@tonic-gate /* To support backwards compatibility for DAPL-1.0 & DAPL-1.1 */
3897c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_MTU_SIZE	DAT_IA_FIELD_IA_MAX_MESSAGE_SIZE
3907c478bd9Sstevel@tonic-gate 
3917c478bd9Sstevel@tonic-gate typedef DAT_UINT64 DAT_IA_ATTR_MASK;
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_ADAPTER_NAME			UINT64_C(0x000000001)
3947c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_VENDOR_NAME			UINT64_C(0x000000002)
3957c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_HARDWARE_MAJOR_VERSION		UINT64_C(0x000000004)
3967c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_HARDWARE_MINOR_VERSION		UINT64_C(0x000000008)
3977c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_FIRMWARE_MAJOR_VERSION		UINT64_C(0x000000010)
3987c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_FIRMWARE_MINOR_VERSION		UINT64_C(0x000000020)
3997c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_ADDRESS_PTR			UINT64_C(0x000000040)
4007c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_EPS				UINT64_C(0x000000080)
4017c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_DTO_PER_EP			UINT64_C(0x000000100)
4027c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_IN		UINT64_C(0x000000200)
4037c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_OUT	UINT64_C(0x000000400)
4047c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_EVDS			UINT64_C(0x000000800)
4057c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_EVD_QLEN			UINT64_C(0x000001000)
4067c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_IOV_SEGMENTS_PER_DTO	UINT64_C(0x000002000)
4077c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_LMRS			UINT64_C(0x000004000)
4087c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_LMR_BLOCK_SIZE		UINT64_C(0x000008000)
4097c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_LMR_VIRTUAL_ADDRESS		UINT64_C(0x000010000)
4107c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_PZS				UINT64_C(0x000020000)
4117c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_MESSAGE_SIZE		UINT64_C(0x000040000)
4127c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_SIZE			UINT64_C(0x000080000)
4137c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RMRS			UINT64_C(0x000100000)
4147c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RMR_TARGET_ADDRESS		UINT64_C(0x000200000)
4157c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_SRQS			UINT64_C(0x000400000)
4167c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_EP_PER_SRQ			UINT64_C(0x000800000)
4177c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RECV_PER_SRQ		UINT64_C(0x001000000)
4187c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_IOV_SEGMENTS_PER_RDMA_READ	UINT64_C(0x002000000)
4197c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_IOV_SEGMENTS_PER_RDMA_WRITE	UINT64_C(0x004000000)
4207c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_IN		UINT64_C(0x008000000)
4217c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_OUT		UINT64_C(0x010000000)
4227c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_IN_GUARANTEED \
4237c478bd9Sstevel@tonic-gate 							UINT64_C(0x020000000)
4247c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_OUT_GUARANTEED \
4257c478bd9Sstevel@tonic-gate 							UINT64_C(0x040000000)
4267c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_NUM_TRANSPORT_ATTR		UINT64_C(0x080000000)
4277c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_TRANSPORT_ATTR			UINT64_C(0x100000000)
4287c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_NUM_VENDOR_ATTR			UINT64_C(0x200000000)
4297c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_IA_VENDOR_ATTR			UINT64_C(0x400000000)
4307c478bd9Sstevel@tonic-gate 
4317c478bd9Sstevel@tonic-gate /* To support backwards compatibility for DAPL-1.0 & DAPL-1.1 */
4327c478bd9Sstevel@tonic-gate #define	DAT_IA_ALL 					DAT_IA_FIELD_ALL
4337c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_ALL				UINT64_C(0x7FFFFFFFF)
4347c478bd9Sstevel@tonic-gate #define	DAT_IA_FIELD_NONE				UINT64_C(0x0)
4357c478bd9Sstevel@tonic-gate 
4367c478bd9Sstevel@tonic-gate /* Endpoint attributes */
4377c478bd9Sstevel@tonic-gate 
4387c478bd9Sstevel@tonic-gate typedef enum dat_service_type {
4397c478bd9Sstevel@tonic-gate 	DAT_SERVICE_TYPE_RC		/* reliable connections */
4407c478bd9Sstevel@tonic-gate } DAT_SERVICE_TYPE;
4417c478bd9Sstevel@tonic-gate 
4427c478bd9Sstevel@tonic-gate typedef struct dat_ep_attr {
4437c478bd9Sstevel@tonic-gate 	DAT_SERVICE_TYPE		service_type;
4447c478bd9Sstevel@tonic-gate 	DAT_VLEN			max_message_size;
4457c478bd9Sstevel@tonic-gate 	DAT_VLEN			max_rdma_size;
4467c478bd9Sstevel@tonic-gate 	DAT_QOS				qos;
4477c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_FLAGS		recv_completion_flags;
4487c478bd9Sstevel@tonic-gate 	DAT_COMPLETION_FLAGS		request_completion_flags;
4497c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_recv_dtos;
4507c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_request_dtos;
4517c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_recv_iov;
4527c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_request_iov;
4537c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_in;
4547c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_out;
4557c478bd9Sstevel@tonic-gate 	DAT_COUNT			srq_soft_hw;
4567c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_read_iov;
4577c478bd9Sstevel@tonic-gate 	DAT_COUNT			max_rdma_write_iov;
4587c478bd9Sstevel@tonic-gate 	DAT_COUNT			ep_transport_specific_count;
4597c478bd9Sstevel@tonic-gate 	DAT_NAMED_ATTR *		ep_transport_specific;
4607c478bd9Sstevel@tonic-gate 	DAT_COUNT			ep_provider_specific_count;
4617c478bd9Sstevel@tonic-gate 	DAT_NAMED_ATTR *		ep_provider_specific;
4627c478bd9Sstevel@tonic-gate } DAT_EP_ATTR;
4637c478bd9Sstevel@tonic-gate 
4647c478bd9Sstevel@tonic-gate /* Endpoint Parameters */
4657c478bd9Sstevel@tonic-gate 
4667c478bd9Sstevel@tonic-gate /* For backwards compatability */
4677c478bd9Sstevel@tonic-gate #define	DAT_EP_STATE_ERROR	DAT_EP_STATE_DISCONNECTED
4687c478bd9Sstevel@tonic-gate 
4697c478bd9Sstevel@tonic-gate typedef enum dat_ep_state {
4707c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_UNCONNECTED,	/* quiescent state */
4717c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_UNCONFIGURED_UNCONNECTED,
4727c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_RESERVED,
4737c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_UNCONFIGURED_RESERVED,
4747c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_PASSIVE_CONNECTION_PENDING,
4757c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_UNCONFIGURED_PASSIVE,
4767c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_ACTIVE_CONNECTION_PENDING,
4777c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING,
4787c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_UNCONFIGURED_TENTATIVE,
4797c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_CONNECTED,
4807c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_DISCONNECT_PENDING,
4817c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_DISCONNECTED,
4827c478bd9Sstevel@tonic-gate 	DAT_EP_STATE_COMPLETION_PENDING
4837c478bd9Sstevel@tonic-gate } DAT_EP_STATE;
4847c478bd9Sstevel@tonic-gate 
4857c478bd9Sstevel@tonic-gate typedef struct dat_ep_param {
4867c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE			ia_handle;
4877c478bd9Sstevel@tonic-gate 	DAT_EP_STATE			ep_state;
4887c478bd9Sstevel@tonic-gate 	DAT_IA_ADDRESS_PTR		local_ia_address_ptr;
4897c478bd9Sstevel@tonic-gate 	DAT_PORT_QUAL			local_port_qual;
4907c478bd9Sstevel@tonic-gate 	DAT_IA_ADDRESS_PTR		remote_ia_address_ptr;
4917c478bd9Sstevel@tonic-gate 	DAT_PORT_QUAL			remote_port_qual;
4927c478bd9Sstevel@tonic-gate 	DAT_PZ_HANDLE			pz_handle;
4937c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE			recv_evd_handle;
4947c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE			request_evd_handle;
4957c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE			connect_evd_handle;
4967c478bd9Sstevel@tonic-gate 	DAT_SRQ_HANDLE			srq_handle;
4977c478bd9Sstevel@tonic-gate 	DAT_EP_ATTR			ep_attr;
4987c478bd9Sstevel@tonic-gate } DAT_EP_PARAM;
4997c478bd9Sstevel@tonic-gate 
5007c478bd9Sstevel@tonic-gate typedef DAT_UINT64 DAT_EP_PARAM_MASK;
5017c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_IA_HANDLE				UINT64_C(0x00000001)
5027c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_STATE				UINT64_C(0x00000002)
5037c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_LOCAL_IA_ADDRESS_PTR		UINT64_C(0x00000004)
5047c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_LOCAL_PORT_QUAL			UINT64_C(0x00000008)
5057c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_REMOTE_IA_ADDRESS_PTR		UINT64_C(0x00000010)
5067c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_REMOTE_PORT_QUAL			UINT64_C(0x00000020)
5077c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_PZ_HANDLE				UINT64_C(0x00000040)
5087c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_RECV_EVD_HANDLE			UINT64_C(0x00000080)
5097c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_REQUEST_EVD_HANDLE			UINT64_C(0x00000100)
5107c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_CONNECT_EVD_HANDLE			UINT64_C(0x00000200)
5117c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_SRQ_HANDLE				UINT64_C(0x00000400)
5127c478bd9Sstevel@tonic-gate 
5137c478bd9Sstevel@tonic-gate 	/* Remainder of values from EP_ATTR, 0x00001000 and up */
5147c478bd9Sstevel@tonic-gate 
5157c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_SERVICE_TYPE		UINT64_C(0x00001000)
5167c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_MESSAGE_SIZE		UINT64_C(0x00002000)
5177c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RDMA_SIZE		UINT64_C(0x00004000)
5187c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_QOS			UINT64_C(0x00008000)
5197c478bd9Sstevel@tonic-gate 
5207c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_RECV_COMPLETION_FLAGS	UINT64_C(0x00010000)
5217c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_REQUEST_COMPLETION_FLAGS	UINT64_C(0x00020000)
5227c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RECV_DTOS		UINT64_C(0x00040000)
5237c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_DTOS		UINT64_C(0x00080000)
5247c478bd9Sstevel@tonic-gate 
5257c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RECV_IOV		UINT64_C(0x00100000)
5267c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_IOV		UINT64_C(0x00200000)
5277c478bd9Sstevel@tonic-gate 
5287c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RDMA_READ_IN		UINT64_C(0x00400000)
5297c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RDMA_READ_OUT		UINT64_C(0x00800000)
5307c478bd9Sstevel@tonic-gate 
5317c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_SRQ_SOFT_HW		UINT64_C(0x01000000)
5327c478bd9Sstevel@tonic-gate 
5337c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RDMA_READ_IOV		UINT64_C(0x02000000)
5347c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_MAX_RDMA_WRITE_IOV		UINT64_C(0x04000000)
5357c478bd9Sstevel@tonic-gate 
5367c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_NUM_TRANSPORT_ATTR		UINT64_C(0x08000000)
5377c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_TRANSPORT_SPECIFIC_ATTR	UINT64_C(0x10000000)
5387c478bd9Sstevel@tonic-gate 
5397c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_NUM_PROVIDER_ATTR		UINT64_C(0x20000000)
5407c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_PROVIDER_SPECIFIC_ATTR	UINT64_C(0x40000000)
5417c478bd9Sstevel@tonic-gate 
5427c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_EP_ATTR_ALL			UINT64_C(0x7FFFF000)
5437c478bd9Sstevel@tonic-gate #define	DAT_EP_FIELD_ALL				UINT64_C(0x7FFFF7FF)
5447c478bd9Sstevel@tonic-gate 
5457c478bd9Sstevel@tonic-gate #define	DAT_WATERMARK_INFINITE ((DAT_COUNT)~0)
5467c478bd9Sstevel@tonic-gate 
5477c478bd9Sstevel@tonic-gate #define	DAT_HW_DEFAULT DAT_WATERMARK_INFINITE
5487c478bd9Sstevel@tonic-gate 
5497c478bd9Sstevel@tonic-gate #define	DAT_SRQ_LW_DEFAULT 0x0
5507c478bd9Sstevel@tonic-gate 
5517c478bd9Sstevel@tonic-gate typedef enum dat_srq_state {
5527c478bd9Sstevel@tonic-gate 	DAT_SRQ_STATE_OPERATIONAL,
5537c478bd9Sstevel@tonic-gate 	DAT_SRQ_STATE_ERROR
5547c478bd9Sstevel@tonic-gate } DAT_SRQ_STATE;
5557c478bd9Sstevel@tonic-gate 
5567c478bd9Sstevel@tonic-gate #define	DAT_VALUE_UNKNOWN	(((DAT_COUNT) ~0)-1)
5577c478bd9Sstevel@tonic-gate 
5587c478bd9Sstevel@tonic-gate typedef struct dat_srq_attr {
5597c478bd9Sstevel@tonic-gate 	DAT_COUNT	max_recv_dtos;
5607c478bd9Sstevel@tonic-gate 	DAT_COUNT	max_recv_iov;
5617c478bd9Sstevel@tonic-gate 	DAT_COUNT	low_watermark;
5627c478bd9Sstevel@tonic-gate } DAT_SRQ_ATTR;
5637c478bd9Sstevel@tonic-gate 
5647c478bd9Sstevel@tonic-gate typedef struct dat_srq_param {
5657c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE		ia_handle;
5667c478bd9Sstevel@tonic-gate 	DAT_SRQ_STATE		srq_state;
5677c478bd9Sstevel@tonic-gate 	DAT_PZ_HANDLE		pz_handle;
5687c478bd9Sstevel@tonic-gate 	DAT_COUNT		max_recv_dtos;
5697c478bd9Sstevel@tonic-gate 	DAT_COUNT		max_recv_iov;
5707c478bd9Sstevel@tonic-gate 	DAT_COUNT		low_watermark;
5717c478bd9Sstevel@tonic-gate 	DAT_COUNT 		available_dto_count;
5727c478bd9Sstevel@tonic-gate 	DAT_COUNT		outstanding_dto_count;
5737c478bd9Sstevel@tonic-gate } DAT_SRQ_PARAM;
5747c478bd9Sstevel@tonic-gate 
5757c478bd9Sstevel@tonic-gate typedef enum dat_srq_param_mask {
5767c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_IA_HANDLE				= 0x001,
5777c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_SRQ_STATE				= 0x002,
5787c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_PZ_HANDLE				= 0x004,
5797c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_MAX_RECV_DTO			= 0x008,
5807c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_MAX_RECV_IOV			= 0x010,
5817c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_LOW_WATERMARK			= 0x020,
5827c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_AVAILABLE_DTO_COUNT		= 0x040,
5837c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_OUTSTANDING_DTO_COUNT		= 0x080,
5847c478bd9Sstevel@tonic-gate 
5857c478bd9Sstevel@tonic-gate 	DAT_SRQ_FIELD_ALL				= 0x0FF
5867c478bd9Sstevel@tonic-gate } DAT_SRQ_PARAM_MASK;
5877c478bd9Sstevel@tonic-gate 
5887c478bd9Sstevel@tonic-gate /* PZ Parameters */
5897c478bd9Sstevel@tonic-gate 
5907c478bd9Sstevel@tonic-gate typedef struct dat_pz_param {
5917c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE		ia_handle;
5927c478bd9Sstevel@tonic-gate } DAT_PZ_PARAM;
5937c478bd9Sstevel@tonic-gate 
5947c478bd9Sstevel@tonic-gate typedef enum dat_pz_param_mask {
5957c478bd9Sstevel@tonic-gate     DAT_PZ_FIELD_IA_HANDLE	= 0x01,
5967c478bd9Sstevel@tonic-gate 
5977c478bd9Sstevel@tonic-gate     DAT_PZ_FIELD_ALL		= 0x01
5987c478bd9Sstevel@tonic-gate } DAT_PZ_PARAM_MASK;
5997c478bd9Sstevel@tonic-gate 
6007c478bd9Sstevel@tonic-gate /* PSP Parameters */
6017c478bd9Sstevel@tonic-gate 
6027c478bd9Sstevel@tonic-gate typedef struct dat_psp_param {
6037c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE		ia_handle;
6047c478bd9Sstevel@tonic-gate 	DAT_CONN_QUAL		conn_qual;
6057c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE		evd_handle;
6067c478bd9Sstevel@tonic-gate 	DAT_PSP_FLAGS		psp_flags;
6077c478bd9Sstevel@tonic-gate } DAT_PSP_PARAM;
6087c478bd9Sstevel@tonic-gate 
6097c478bd9Sstevel@tonic-gate typedef enum dat_psp_param_mask {
6107c478bd9Sstevel@tonic-gate     DAT_PSP_FIELD_IA_HANDLE	= 0x01,
6117c478bd9Sstevel@tonic-gate     DAT_PSP_FIELD_CONN_QUAL	= 0x02,
6127c478bd9Sstevel@tonic-gate     DAT_PSP_FIELD_EVD_HANDLE	= 0x04,
6137c478bd9Sstevel@tonic-gate     DAT_PSP_FIELD_PSP_FLAGS	= 0x08,
6147c478bd9Sstevel@tonic-gate 
6157c478bd9Sstevel@tonic-gate     DAT_PSP_FIELD_ALL		= 0x0F
6167c478bd9Sstevel@tonic-gate } DAT_PSP_PARAM_MASK;
6177c478bd9Sstevel@tonic-gate 
6187c478bd9Sstevel@tonic-gate /* RSP Parameters */
6197c478bd9Sstevel@tonic-gate 
6207c478bd9Sstevel@tonic-gate typedef struct dat_rsp_param {
6217c478bd9Sstevel@tonic-gate 	DAT_IA_HANDLE		ia_handle;
6227c478bd9Sstevel@tonic-gate 	DAT_CONN_QUAL		conn_qual;
6237c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE		evd_handle;
6247c478bd9Sstevel@tonic-gate 	DAT_EP_HANDLE		ep_handle;
6257c478bd9Sstevel@tonic-gate } DAT_RSP_PARAM;
6267c478bd9Sstevel@tonic-gate 
6277c478bd9Sstevel@tonic-gate typedef enum dat_rsp_param_mask {
6287c478bd9Sstevel@tonic-gate 	DAT_RSP_FIELD_IA_HANDLE		= 0x01,
6297c478bd9Sstevel@tonic-gate 	DAT_RSP_FIELD_CONN_QUAL		= 0x02,
6307c478bd9Sstevel@tonic-gate 	DAT_RSP_FIELD_EVD_HANDLE	= 0x04,
6317c478bd9Sstevel@tonic-gate 	DAT_RSP_FIELD_EP_HANDLE		= 0x08,
6327c478bd9Sstevel@tonic-gate 
6337c478bd9Sstevel@tonic-gate 	DAT_RSP_FIELD_ALL		= 0x0F
6347c478bd9Sstevel@tonic-gate } DAT_RSP_PARAM_MASK;
6357c478bd9Sstevel@tonic-gate 
6367c478bd9Sstevel@tonic-gate /*
6377c478bd9Sstevel@tonic-gate  * Connection Request Parameters.
6387c478bd9Sstevel@tonic-gate  *
6397c478bd9Sstevel@tonic-gate  * The Connection Request does not provide Remote Endpoint attributes.
6407c478bd9Sstevel@tonic-gate  * If a local Consumer needs this information, the remote Consumer should
6417c478bd9Sstevel@tonic-gate  * encode it into Private Data.
6427c478bd9Sstevel@tonic-gate  */
6437c478bd9Sstevel@tonic-gate 
6447c478bd9Sstevel@tonic-gate typedef struct dat_cr_param {
6457c478bd9Sstevel@tonic-gate 	/* Remote IA whose Endpoint requested the connection.		*/
6467c478bd9Sstevel@tonic-gate 	DAT_IA_ADDRESS_PTR	remote_ia_address_ptr;
6477c478bd9Sstevel@tonic-gate 
6487c478bd9Sstevel@tonic-gate 	/* Port qualifier of the remote Endpoint of the requested connection. */
6497c478bd9Sstevel@tonic-gate 	DAT_PORT_QUAL		remote_port_qual;
6507c478bd9Sstevel@tonic-gate 
6517c478bd9Sstevel@tonic-gate 	/* Size of the Private Data.					*/
6527c478bd9Sstevel@tonic-gate 	DAT_COUNT		private_data_size;
6537c478bd9Sstevel@tonic-gate 
6547c478bd9Sstevel@tonic-gate 	/*
6557c478bd9Sstevel@tonic-gate 	 * Pointer to the Private Data passed by remote side in the Connection
6567c478bd9Sstevel@tonic-gate 	 * Request.
6577c478bd9Sstevel@tonic-gate 	 */
6587c478bd9Sstevel@tonic-gate 	DAT_PVOID		private_data;
6597c478bd9Sstevel@tonic-gate 
6607c478bd9Sstevel@tonic-gate 	/*
6617c478bd9Sstevel@tonic-gate 	 * The local Endpoint provided by the Service Point for the requested
6627c478bd9Sstevel@tonic-gate 	 * connection. It is the only Endpoint that can accept a Connection
6637c478bd9Sstevel@tonic-gate 	 * Request on this Service Point. The value DAT_HANDLE_NULL represents
6647c478bd9Sstevel@tonic-gate 	 * that there is no associated local Endpoint for the requested
6657c478bd9Sstevel@tonic-gate 	 * connection.
6667c478bd9Sstevel@tonic-gate 	 */
6677c478bd9Sstevel@tonic-gate 	DAT_EP_HANDLE			local_ep_handle;
6687c478bd9Sstevel@tonic-gate 
6697c478bd9Sstevel@tonic-gate } DAT_CR_PARAM;
6707c478bd9Sstevel@tonic-gate 
6717c478bd9Sstevel@tonic-gate typedef enum dat_cr_param_mask {
6727c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_REMOTE_IA_ADDRESS_PTR	= 0x01,
6737c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_REMOTE_PORT_QUAL		= 0x02,
6747c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_PRIVATE_DATA_SIZE		= 0x04,
6757c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_PRIVATE_DATA		= 0x08,
6767c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_LOCAL_EP_HANDLE		= 0x10,
6777c478bd9Sstevel@tonic-gate 
6787c478bd9Sstevel@tonic-gate 	DAT_CR_FIELD_ALL			= 0x1F
6797c478bd9Sstevel@tonic-gate } DAT_CR_PARAM_MASK;
6807c478bd9Sstevel@tonic-gate 
6817c478bd9Sstevel@tonic-gate /*
6827c478bd9Sstevel@tonic-gate  * *********************** Events *****************************************
6837c478bd9Sstevel@tonic-gate  */
6847c478bd9Sstevel@tonic-gate 
6857c478bd9Sstevel@tonic-gate /* Completion status flags */
6867c478bd9Sstevel@tonic-gate 
6877c478bd9Sstevel@tonic-gate /* dto completion status */
6887c478bd9Sstevel@tonic-gate 
6897c478bd9Sstevel@tonic-gate /* For backwards compatability */
6907c478bd9Sstevel@tonic-gate #define	DAT_DTO_LENGTH_ERROR    DAT_DTO_ERR_LOCAL_LENGTH
6917c478bd9Sstevel@tonic-gate #define	DAT_DTO_FAILURE		DAT_DTO_ERR_FLUSHED
6927c478bd9Sstevel@tonic-gate 
6937c478bd9Sstevel@tonic-gate typedef enum dat_dto_completion_status {
6947c478bd9Sstevel@tonic-gate 	DAT_DTO_SUCCESS			= 0,
6957c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_FLUSHED		= 1,
6967c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_LOCAL_LENGTH	= 2,
6977c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_LOCAL_EP		= 3,
6987c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_LOCAL_PROTECTION	= 4,
6997c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_BAD_RESPONSE	= 5,
7007c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_REMOTE_ACCESS	= 6,
7017c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_REMOTE_RESPONDER	= 7,
7027c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_TRANSPORT		= 8,
7037c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_RECEIVER_NOT_READY	= 9,
7047c478bd9Sstevel@tonic-gate 	DAT_DTO_ERR_PARTIAL_PACKET	= 10,
7057c478bd9Sstevel@tonic-gate 	DAT_RMR_OPERATION_FAILED	= 11
7067c478bd9Sstevel@tonic-gate } DAT_DTO_COMPLETION_STATUS;
7077c478bd9Sstevel@tonic-gate 
7087c478bd9Sstevel@tonic-gate /* RMR completion status */
7097c478bd9Sstevel@tonic-gate 
7107c478bd9Sstevel@tonic-gate /* For backwards compatability */
7117c478bd9Sstevel@tonic-gate #define	DAT_RMR_BIND_SUCCESS    DAT_DTO_SUCCESS
7127c478bd9Sstevel@tonic-gate #define	DAT_RMR_BIND_FAILURE    DAT_DTO_ERR_FLUSHED
7137c478bd9Sstevel@tonic-gate 
7147c478bd9Sstevel@tonic-gate #define	DAT_RMR_BIND_COMPLETION_STATUS DAT_DTO_COMPLETION_STATUS
7157c478bd9Sstevel@tonic-gate 
7167c478bd9Sstevel@tonic-gate /* Completion group structs (six total) */
7177c478bd9Sstevel@tonic-gate 
7187c478bd9Sstevel@tonic-gate /* DTO completion event data */
7197c478bd9Sstevel@tonic-gate /* transferred_length is not defined if status is not DAT_SUCCESS */
7207c478bd9Sstevel@tonic-gate typedef struct dat_dto_completion_event_data {
7217c478bd9Sstevel@tonic-gate 	DAT_EP_HANDLE				ep_handle;
7227c478bd9Sstevel@tonic-gate 	DAT_DTO_COOKIE				user_cookie;
7237c478bd9Sstevel@tonic-gate 	DAT_DTO_COMPLETION_STATUS		status;
7247c478bd9Sstevel@tonic-gate 	DAT_VLEN				transfered_length;
7257c478bd9Sstevel@tonic-gate } DAT_DTO_COMPLETION_EVENT_DATA;
7267c478bd9Sstevel@tonic-gate 
7277c478bd9Sstevel@tonic-gate /* RMR bind completion event data */
7287c478bd9Sstevel@tonic-gate typedef struct dat_rmr_bind_completion_event_data {
7297c478bd9Sstevel@tonic-gate 	DAT_RMR_HANDLE				rmr_handle;
7307c478bd9Sstevel@tonic-gate 	DAT_RMR_COOKIE				user_cookie;
7317c478bd9Sstevel@tonic-gate 	DAT_RMR_BIND_COMPLETION_STATUS		status;
7327c478bd9Sstevel@tonic-gate } DAT_RMR_BIND_COMPLETION_EVENT_DATA;
7337c478bd9Sstevel@tonic-gate 
7347c478bd9Sstevel@tonic-gate typedef union dat_sp_handle {
7357c478bd9Sstevel@tonic-gate 	DAT_RSP_HANDLE		rsp_handle;
7367c478bd9Sstevel@tonic-gate 	DAT_PSP_HANDLE		psp_handle;
7377c478bd9Sstevel@tonic-gate } DAT_SP_HANDLE;
7387c478bd9Sstevel@tonic-gate 
7397c478bd9Sstevel@tonic-gate /* Connection Request Arrival event data */
7407c478bd9Sstevel@tonic-gate typedef struct dat_cr_arrival_event_data {
7417c478bd9Sstevel@tonic-gate 	/*
7427c478bd9Sstevel@tonic-gate 	 * Handle to the Service Point that received the Connection Request
7437c478bd9Sstevel@tonic-gate 	 * from the remote side. If the Service Point was Reserved, sp is
7447c478bd9Sstevel@tonic-gate 	 * DAT_HANDLE_NULL because the reserved Service Point is automatically
7457c478bd9Sstevel@tonic-gate 	 * destroyed upon generating this event. Can be PSP or RSP.
7467c478bd9Sstevel@tonic-gate 	 */
7477c478bd9Sstevel@tonic-gate 	DAT_SP_HANDLE			sp_handle;
7487c478bd9Sstevel@tonic-gate 
7497c478bd9Sstevel@tonic-gate 	/* Address of the IA on which the Connection Request arrived. */
7507c478bd9Sstevel@tonic-gate 	DAT_IA_ADDRESS_PTR		local_ia_address_ptr;
7517c478bd9Sstevel@tonic-gate 
7527c478bd9Sstevel@tonic-gate 	/*
7537c478bd9Sstevel@tonic-gate 	 * Connection Qualifier of the IA on which the Service Point received a
7547c478bd9Sstevel@tonic-gate 	 * Connection Request.
7557c478bd9Sstevel@tonic-gate 	 */
7567c478bd9Sstevel@tonic-gate 	DAT_CONN_QUAL			conn_qual;
7577c478bd9Sstevel@tonic-gate 
7587c478bd9Sstevel@tonic-gate 	/*
7597c478bd9Sstevel@tonic-gate 	 * The Connection Request instance created by a Provider for the
7607c478bd9Sstevel@tonic-gate 	 * arrived Connection Request. Consumers can find out private_data
7617c478bd9Sstevel@tonic-gate 	 * passed by a remote Consumer from cr_handle. It is up to a Consumer
7627c478bd9Sstevel@tonic-gate 	 * to dat_cr_accept or dat_cr_reject of the Connection Request.
7637c478bd9Sstevel@tonic-gate 	 */
7647c478bd9Sstevel@tonic-gate 	DAT_CR_HANDLE			cr_handle;
7657c478bd9Sstevel@tonic-gate 
7667c478bd9Sstevel@tonic-gate } DAT_CR_ARRIVAL_EVENT_DATA;
7677c478bd9Sstevel@tonic-gate 
7687c478bd9Sstevel@tonic-gate 
7697c478bd9Sstevel@tonic-gate /* Connection event data */
7707c478bd9Sstevel@tonic-gate typedef struct dat_connection_event_data {
7717c478bd9Sstevel@tonic-gate 	DAT_EP_HANDLE		ep_handle;
7727c478bd9Sstevel@tonic-gate 	DAT_COUNT		private_data_size;
7737c478bd9Sstevel@tonic-gate 	DAT_PVOID		private_data;
7747c478bd9Sstevel@tonic-gate } DAT_CONNECTION_EVENT_DATA;
7757c478bd9Sstevel@tonic-gate 
7767c478bd9Sstevel@tonic-gate /* Async Error event data */
7777c478bd9Sstevel@tonic-gate /*
7787c478bd9Sstevel@tonic-gate  * For unaffiliated asynchronous event dat_handle is ia_handle. For Endpoint
7797c478bd9Sstevel@tonic-gate  * affiliated asynchronous event dat_handle is ep_handle. For EVD affiliated
7807c478bd9Sstevel@tonic-gate  * asynchronous event dat_handle is evd_handle. For SRQ affiliated asynchronous
7817c478bd9Sstevel@tonic-gate  * event dat_handle is srq_handle. For Memory affiliated asynchronous event
7827c478bd9Sstevel@tonic-gate  * dat_handle is either lmr_handle, rmr_handle or pz_handle.
7837c478bd9Sstevel@tonic-gate  */
7847c478bd9Sstevel@tonic-gate typedef struct dat_asynch_error_event_data {
7857c478bd9Sstevel@tonic-gate 	DAT_HANDLE		dat_handle;	/* either IA, EP, EVD, SRQ */
7867c478bd9Sstevel@tonic-gate 						/* LMR, RMR, or PZ handle  */
7877c478bd9Sstevel@tonic-gate 	DAT_COUNT		reason;		/* object specific	   */
7887c478bd9Sstevel@tonic-gate } DAT_ASYNCH_ERROR_EVENT_DATA;
7897c478bd9Sstevel@tonic-gate 
7907c478bd9Sstevel@tonic-gate /* The reason is object type specific and its values are defined below */
7917c478bd9Sstevel@tonic-gate typedef enum ia_async_error_reason {
7927c478bd9Sstevel@tonic-gate 	DAT_IA_CATASTROPHIC_ERROR,
7937c478bd9Sstevel@tonic-gate 	DAT_IA_OTHER_ERROR
7947c478bd9Sstevel@tonic-gate } DAT_IA_ASYNC_ERROR_REASON;
7957c478bd9Sstevel@tonic-gate 
7967c478bd9Sstevel@tonic-gate typedef enum ep_async_error_reason {
7977c478bd9Sstevel@tonic-gate 	DAT_EP_TRANSFER_TO_ERROR,
7987c478bd9Sstevel@tonic-gate 	DAT_EP_OTHER_ERROR,
7997c478bd9Sstevel@tonic-gate 	DAT_SRQ_SOFT_HIGH_WATERMARK_EVENT
8007c478bd9Sstevel@tonic-gate } DAT_EP_ASYNC_ERROR_REASON;
8017c478bd9Sstevel@tonic-gate 
8027c478bd9Sstevel@tonic-gate typedef enum ep_evd_error_reason {
8037c478bd9Sstevel@tonic-gate 	DAT_EVD_OVERFLOW_ERROR,
8047c478bd9Sstevel@tonic-gate 	DAT_EVD_OTHER_ERROR
8057c478bd9Sstevel@tonic-gate } DAT_EVD_ASYNC_ERROR_REASON;
8067c478bd9Sstevel@tonic-gate 
8077c478bd9Sstevel@tonic-gate typedef enum ep_srq_error_reason {
8087c478bd9Sstevel@tonic-gate 	DAT_SRQ_TRANSFER_TO_ERROR,
8097c478bd9Sstevel@tonic-gate 	DAT_SRQ_OTHER_ERROR,
8107c478bd9Sstevel@tonic-gate 	DAT_SRQ_LOW_WATERMARK_EVENT
8117c478bd9Sstevel@tonic-gate } DAT_SRQ_ASYNC_ERROR_REASON;
8127c478bd9Sstevel@tonic-gate 
8137c478bd9Sstevel@tonic-gate typedef enum lmr_async_error_reason {
8147c478bd9Sstevel@tonic-gate 	DAT_LMR_OTHER_ERROR
8157c478bd9Sstevel@tonic-gate } DAT_LMR_ASYNC_ERROR_REASON;
8167c478bd9Sstevel@tonic-gate 
8177c478bd9Sstevel@tonic-gate typedef enum rmr_async_error_reason {
8187c478bd9Sstevel@tonic-gate 	DAT_RMR_OTHER_ERROR
8197c478bd9Sstevel@tonic-gate } DAT_RMR_ASYNC_ERROR_REASON;
8207c478bd9Sstevel@tonic-gate 
8217c478bd9Sstevel@tonic-gate typedef enum pz_async_error_reason {
8227c478bd9Sstevel@tonic-gate 	DAT_PZ_OTHER_ERROR
8237c478bd9Sstevel@tonic-gate } DAT_PZ_ASYNC_ERROR_REASON;
8247c478bd9Sstevel@tonic-gate 
8257c478bd9Sstevel@tonic-gate 
8267c478bd9Sstevel@tonic-gate /* Software event data */
8277c478bd9Sstevel@tonic-gate typedef struct dat_software_event_data {
8287c478bd9Sstevel@tonic-gate 	DAT_PVOID	pointer;
8297c478bd9Sstevel@tonic-gate } DAT_SOFTWARE_EVENT_DATA;
8307c478bd9Sstevel@tonic-gate 
8317c478bd9Sstevel@tonic-gate typedef enum dat_event_number {
8327c478bd9Sstevel@tonic-gate 	DAT_DTO_COMPLETION_EVENT				= 0x00001,
8337c478bd9Sstevel@tonic-gate 
8347c478bd9Sstevel@tonic-gate 	DAT_RMR_BIND_COMPLETION_EVENT				= 0x01001,
8357c478bd9Sstevel@tonic-gate 
8367c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_REQUEST_EVENT				= 0x02001,
8377c478bd9Sstevel@tonic-gate 
8387c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_ESTABLISHED			= 0x04001,
8397c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_PEER_REJECTED			= 0x04002,
8407c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_NON_PEER_REJECTED			= 0x04003,
8417c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_ACCEPT_COMPLETION_ERROR		= 0x04004,
8427c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_DISCONNECTED			= 0x04005,
8437c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_BROKEN				= 0x04006,
8447c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_TIMED_OUT				= 0x04007,
8457c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_UNREACHABLE			= 0x04008,
8467c478bd9Sstevel@tonic-gate 
8477c478bd9Sstevel@tonic-gate 	DAT_ASYNC_ERROR_EVD_OVERFLOW				= 0x08001,
8487c478bd9Sstevel@tonic-gate 	DAT_ASYNC_ERROR_IA_CATASTROPHIC				= 0x08002,
8497c478bd9Sstevel@tonic-gate 	DAT_ASYNC_ERROR_EP_BROKEN				= 0x08003,
8507c478bd9Sstevel@tonic-gate 	DAT_ASYNC_ERROR_TIMED_OUT				= 0x08004,
8517c478bd9Sstevel@tonic-gate 	DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR			= 0x08005,
8527c478bd9Sstevel@tonic-gate 
8537c478bd9Sstevel@tonic-gate 	DAT_SOFTWARE_EVENT					= 0x10001
8547c478bd9Sstevel@tonic-gate } DAT_EVENT_NUMBER;
8557c478bd9Sstevel@tonic-gate 
8567c478bd9Sstevel@tonic-gate /* Union for event Data */
8577c478bd9Sstevel@tonic-gate 
8587c478bd9Sstevel@tonic-gate typedef union dat_event_data {
8597c478bd9Sstevel@tonic-gate 	DAT_DTO_COMPLETION_EVENT_DATA		dto_completion_event_data;
8607c478bd9Sstevel@tonic-gate 	DAT_RMR_BIND_COMPLETION_EVENT_DATA	rmr_completion_event_data;
8617c478bd9Sstevel@tonic-gate 	DAT_CR_ARRIVAL_EVENT_DATA		cr_arrival_event_data;
8627c478bd9Sstevel@tonic-gate 	DAT_CONNECTION_EVENT_DATA		connect_event_data;
8637c478bd9Sstevel@tonic-gate 	DAT_ASYNCH_ERROR_EVENT_DATA		asynch_error_event_data;
8647c478bd9Sstevel@tonic-gate 	DAT_SOFTWARE_EVENT_DATA			software_event_data;
8657c478bd9Sstevel@tonic-gate } DAT_EVENT_DATA;
8667c478bd9Sstevel@tonic-gate 
8677c478bd9Sstevel@tonic-gate /* Event struct that holds all event information */
8687c478bd9Sstevel@tonic-gate 
8697c478bd9Sstevel@tonic-gate typedef struct dat_event {
8707c478bd9Sstevel@tonic-gate 	DAT_EVENT_NUMBER	event_number;
8717c478bd9Sstevel@tonic-gate 	DAT_EVD_HANDLE		evd_handle;
8727c478bd9Sstevel@tonic-gate 	DAT_EVENT_DATA		event_data;
8737c478bd9Sstevel@tonic-gate } DAT_EVENT;
8747c478bd9Sstevel@tonic-gate 
8757c478bd9Sstevel@tonic-gate /* Provider/registration info */
8767c478bd9Sstevel@tonic-gate 
8777c478bd9Sstevel@tonic-gate typedef struct dat_provider_info {
8787c478bd9Sstevel@tonic-gate 	char			ia_name[DAT_NAME_MAX_LENGTH];
8797c478bd9Sstevel@tonic-gate 	DAT_UINT32		dapl_version_major;
8807c478bd9Sstevel@tonic-gate 	DAT_UINT32		dapl_version_minor;
8817c478bd9Sstevel@tonic-gate 	DAT_BOOLEAN		is_thread_safe;
8827c478bd9Sstevel@tonic-gate } DAT_PROVIDER_INFO;
8837c478bd9Sstevel@tonic-gate 
8847c478bd9Sstevel@tonic-gate /*
8857c478bd9Sstevel@tonic-gate  * FUNCTION PROTOTYPES
8867c478bd9Sstevel@tonic-gate  */
8877c478bd9Sstevel@tonic-gate /*
8887c478bd9Sstevel@tonic-gate  * IA functions
8897c478bd9Sstevel@tonic-gate  *
8907c478bd9Sstevel@tonic-gate  * Note that there are actual 'dat_ia_open' and 'dat_ia_close'
8917c478bd9Sstevel@tonic-gate  * functions, it is not just a re-directing #define. That is
8927c478bd9Sstevel@tonic-gate  * because the functions may have to ensure that the provider
8937c478bd9Sstevel@tonic-gate  * library is loaded before it can call it, and may choose to
8947c478bd9Sstevel@tonic-gate  * unload the library after the last close.
8957c478bd9Sstevel@tonic-gate  */
8967c478bd9Sstevel@tonic-gate 
8977c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ia_openv(
8987c478bd9Sstevel@tonic-gate 	IN	const DAT_NAME_PTR,	/* provider		*/
8997c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* asynch_evd_min_qlen  */
9007c478bd9Sstevel@tonic-gate 	INOUT	DAT_EVD_HANDLE *,	/* asynch_evd_handle    */
9017c478bd9Sstevel@tonic-gate 	OUT	DAT_IA_HANDLE *,	/* ia_handle		*/
9027c478bd9Sstevel@tonic-gate 	IN	DAT_UINT32,		/* dat major version number */
9037c478bd9Sstevel@tonic-gate 	IN	DAT_UINT32,		/* dat minor version number */
9047c478bd9Sstevel@tonic-gate 	IN	DAT_BOOLEAN);		/* dat thread safety */
9057c478bd9Sstevel@tonic-gate 
9067c478bd9Sstevel@tonic-gate #define	dat_ia_open(name, qlen, async_evd, ia) \
9077c478bd9Sstevel@tonic-gate 	dat_ia_openv((name), (qlen), (async_evd), (ia), \
9087c478bd9Sstevel@tonic-gate 		DAT_VERSION_MAJOR, DAT_VERSION_MINOR, \
9097c478bd9Sstevel@tonic-gate 		DAT_THREADSAFE)
9107c478bd9Sstevel@tonic-gate 
9117c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ia_query(
9127c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia handle		*/
9137c478bd9Sstevel@tonic-gate 	OUT	DAT_EVD_HANDLE *,	/* async_evd_handle	*/
9147c478bd9Sstevel@tonic-gate 	IN	DAT_IA_ATTR_MASK,	/* ia_attr_mask		*/
9157c478bd9Sstevel@tonic-gate 	OUT	DAT_IA_ATTR *,		/* ia_attr		*/
9167c478bd9Sstevel@tonic-gate 	IN	DAT_PROVIDER_ATTR_MASK,	/* provider_attr_mask	*/
9177c478bd9Sstevel@tonic-gate 	OUT	DAT_PROVIDER_ATTR *);	/* provider_attr	*/
9187c478bd9Sstevel@tonic-gate 
9197c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ia_close(
9207c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
9217c478bd9Sstevel@tonic-gate 	IN	DAT_CLOSE_FLAGS);	/* close_flags		*/
9227c478bd9Sstevel@tonic-gate 
9237c478bd9Sstevel@tonic-gate /* helper functions */
9247c478bd9Sstevel@tonic-gate 
9257c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_set_consumer_context(
9267c478bd9Sstevel@tonic-gate 	IN	DAT_HANDLE,		/* dat handle		*/
9277c478bd9Sstevel@tonic-gate 	IN	DAT_CONTEXT);		/* context		*/
9287c478bd9Sstevel@tonic-gate 
9297c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_get_consumer_context(
9307c478bd9Sstevel@tonic-gate 	IN	DAT_HANDLE,		/* dat handle		*/
9317c478bd9Sstevel@tonic-gate 	OUT	DAT_CONTEXT *);		/* context		*/
9327c478bd9Sstevel@tonic-gate 
9337c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_get_handle_type(
9347c478bd9Sstevel@tonic-gate 	IN	DAT_HANDLE,		/* dat_handle		*/
9357c478bd9Sstevel@tonic-gate 	OUT	DAT_HANDLE_TYPE *);	/* handle_type		*/
9367c478bd9Sstevel@tonic-gate 
9377c478bd9Sstevel@tonic-gate /* CR Functions */
9387c478bd9Sstevel@tonic-gate 
9397c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_cr_query(
9407c478bd9Sstevel@tonic-gate 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
9417c478bd9Sstevel@tonic-gate 	IN	DAT_CR_PARAM_MASK,	/* cr_param_mask	*/
9427c478bd9Sstevel@tonic-gate 	OUT	DAT_CR_PARAM *);	/* cr_param		*/
9437c478bd9Sstevel@tonic-gate 
9447c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_cr_accept(
9457c478bd9Sstevel@tonic-gate 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
9467c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
9477c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* private_data_size	*/
9487c478bd9Sstevel@tonic-gate 	IN	const DAT_PVOID);	/* private_data		*/
9497c478bd9Sstevel@tonic-gate 
9507c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_cr_reject(
9517c478bd9Sstevel@tonic-gate 	IN	DAT_CR_HANDLE);
9527c478bd9Sstevel@tonic-gate 
9537c478bd9Sstevel@tonic-gate /*
9547c478bd9Sstevel@tonic-gate  * For DAT-1.1 and above, this function is defined for both uDAPL and kDAPL.
9557c478bd9Sstevel@tonic-gate  * For DAT-1.0 it was only defined for uDAPL.
9567c478bd9Sstevel@tonic-gate  */
9577c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_cr_handoff(
9587c478bd9Sstevel@tonic-gate 	IN	DAT_CR_HANDLE,		/* cr_handle		*/
9597c478bd9Sstevel@tonic-gate 	IN	DAT_CONN_QUAL);		/* handoff		*/
9607c478bd9Sstevel@tonic-gate 
9617c478bd9Sstevel@tonic-gate /* EVD Functions */
9627c478bd9Sstevel@tonic-gate 
9637c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_evd_resize(
9647c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
9657c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT);		/* evd_min_qlen		*/
9667c478bd9Sstevel@tonic-gate 
9677c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_evd_post_se(
9687c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
9697c478bd9Sstevel@tonic-gate 	IN	const DAT_EVENT *);	/* event		*/
9707c478bd9Sstevel@tonic-gate 
9717c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_evd_dequeue(
9727c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
9737c478bd9Sstevel@tonic-gate 	OUT	DAT_EVENT *);		/* event		*/
9747c478bd9Sstevel@tonic-gate 
9757c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_evd_query(
9767c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
9777c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_PARAM_MASK,	/* evd_param_mask	*/
9787c478bd9Sstevel@tonic-gate 	OUT	DAT_EVD_PARAM *);	/* evd_param		*/
9797c478bd9Sstevel@tonic-gate 
9807c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_evd_free(
9817c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE);	/* evd_handle		*/
9827c478bd9Sstevel@tonic-gate 
9837c478bd9Sstevel@tonic-gate /* EP functions */
9847c478bd9Sstevel@tonic-gate 
9857c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_create(
9867c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
9877c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
9887c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* recv_completion_evd_handle */
9897c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* request_completion_evd_handle */
9907c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* connect_evd_handle   */
9917c478bd9Sstevel@tonic-gate 	IN	const DAT_EP_ATTR *,	/* ep_attributes	*/
9927c478bd9Sstevel@tonic-gate 	OUT	DAT_EP_HANDLE *);	/* ep_handle		*/
9937c478bd9Sstevel@tonic-gate 
9947c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_query(
9957c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
9967c478bd9Sstevel@tonic-gate 	IN	DAT_EP_PARAM_MASK,	/* ep_param_mask	*/
9977c478bd9Sstevel@tonic-gate 	OUT	DAT_EP_PARAM *);	/* ep_param		*/
9987c478bd9Sstevel@tonic-gate 
9997c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_modify(
10007c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10017c478bd9Sstevel@tonic-gate 	IN	DAT_EP_PARAM_MASK,	/* ep_param_mask	*/
10027c478bd9Sstevel@tonic-gate 	IN	const DAT_EP_PARAM *);	/* ep_param		*/
10037c478bd9Sstevel@tonic-gate 
10047c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_connect(
10057c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10067c478bd9Sstevel@tonic-gate 	IN	DAT_IA_ADDRESS_PTR,	/* remote_ia_address	*/
10077c478bd9Sstevel@tonic-gate 	IN	DAT_CONN_QUAL,		/* remote_conn_qual	*/
10087c478bd9Sstevel@tonic-gate 	IN	DAT_TIMEOUT,		/* timeout		*/
10097c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* private_data_size	*/
10107c478bd9Sstevel@tonic-gate 	IN	const DAT_PVOID,	/* private_data		*/
10117c478bd9Sstevel@tonic-gate 	IN	DAT_QOS,		/* quality_of_service	*/
10127c478bd9Sstevel@tonic-gate 	IN	DAT_CONNECT_FLAGS);	/* connect_flags	*/
10137c478bd9Sstevel@tonic-gate 
10147c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_dup_connect(
10157c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10167c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_dup_handle	*/
10177c478bd9Sstevel@tonic-gate 	IN	DAT_TIMEOUT,		/* timeout		*/
10187c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* private_data_size	*/
10197c478bd9Sstevel@tonic-gate 	IN	const DAT_PVOID,	/* private_data		*/
10207c478bd9Sstevel@tonic-gate 	IN	DAT_QOS);		/* quality_of_service	*/
10217c478bd9Sstevel@tonic-gate 
10227c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_disconnect(
10237c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10247c478bd9Sstevel@tonic-gate 	IN	DAT_CLOSE_FLAGS);	/* close_flags		*/
10257c478bd9Sstevel@tonic-gate 
10267c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_post_send(
10277c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10287c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* num_segments		*/
10297c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
10307c478bd9Sstevel@tonic-gate 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
10317c478bd9Sstevel@tonic-gate 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
10327c478bd9Sstevel@tonic-gate 
10337c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_post_recv(
10347c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10357c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* num_segments		*/
10367c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
10377c478bd9Sstevel@tonic-gate 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
10387c478bd9Sstevel@tonic-gate 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
10397c478bd9Sstevel@tonic-gate 
10407c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_post_rdma_read(
10417c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10427c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* num_segments		*/
10437c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
10447c478bd9Sstevel@tonic-gate 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
10457c478bd9Sstevel@tonic-gate 	IN	const DAT_RMR_TRIPLET *,	/* remote_iov		*/
10467c478bd9Sstevel@tonic-gate 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
10477c478bd9Sstevel@tonic-gate 
10487c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_post_rdma_write(
10497c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10507c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* num_segments		*/
10517c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_TRIPLET *,	/* local_iov		*/
10527c478bd9Sstevel@tonic-gate 	IN	DAT_DTO_COOKIE,		/* user_cookie		*/
10537c478bd9Sstevel@tonic-gate 	IN	const DAT_RMR_TRIPLET *,	/* remote_iov		*/
10547c478bd9Sstevel@tonic-gate 	IN	DAT_COMPLETION_FLAGS);	/* completion_flags	*/
10557c478bd9Sstevel@tonic-gate 
10567c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_get_status(
10577c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
10587c478bd9Sstevel@tonic-gate 	OUT	DAT_EP_STATE *,		/* ep_state		*/
10597c478bd9Sstevel@tonic-gate 	OUT	DAT_BOOLEAN *,		/* recv_idle		*/
10607c478bd9Sstevel@tonic-gate 	OUT	DAT_BOOLEAN *);		/* request_idle		*/
10617c478bd9Sstevel@tonic-gate 
10627c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_free(
10637c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE);		/* ep_handle		*/
10647c478bd9Sstevel@tonic-gate 
10657c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_reset(
10667c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE);		/* ep_handle		*/
10677c478bd9Sstevel@tonic-gate 
10687c478bd9Sstevel@tonic-gate /* LMR functions */
10697c478bd9Sstevel@tonic-gate 
10707c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_lmr_query(
10717c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_HANDLE,		/* lmr_handle		*/
10727c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_PARAM_MASK,	/* lmr_param_mask	*/
10737c478bd9Sstevel@tonic-gate 	OUT	DAT_LMR_PARAM *);	/* lmr_param		*/
10747c478bd9Sstevel@tonic-gate 
10757c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_lmr_free(
10767c478bd9Sstevel@tonic-gate 	IN	DAT_LMR_HANDLE);	/* lmr_handle		*/
10777c478bd9Sstevel@tonic-gate 
10787c478bd9Sstevel@tonic-gate /* Non-coherent memory functions */
10797c478bd9Sstevel@tonic-gate 
10807c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_lmr_sync_rdma_read(
10817c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
10827c478bd9Sstevel@tonic-gate 	IN 	const DAT_LMR_TRIPLET *, /* local_segments	*/
10837c478bd9Sstevel@tonic-gate 	IN	DAT_VLEN);		/* num_segments		*/
10847c478bd9Sstevel@tonic-gate 
10857c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_lmr_sync_rdma_write(
10867c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
10877c478bd9Sstevel@tonic-gate 	IN 	const DAT_LMR_TRIPLET *, /* local_segments	*/
10887c478bd9Sstevel@tonic-gate 	IN	DAT_VLEN);		/* num_segments		*/
10897c478bd9Sstevel@tonic-gate 
10907c478bd9Sstevel@tonic-gate /* RMR Functions */
10917c478bd9Sstevel@tonic-gate 
10927c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rmr_create(
10937c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
10947c478bd9Sstevel@tonic-gate 	OUT	DAT_RMR_HANDLE *);	/* rmr_handle		*/
10957c478bd9Sstevel@tonic-gate 
10967c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rmr_query(
10977c478bd9Sstevel@tonic-gate 	IN	DAT_RMR_HANDLE,		/* rmr_handle		*/
10987c478bd9Sstevel@tonic-gate 	IN	DAT_RMR_PARAM_MASK,	/* rmr_param_mask	*/
10997c478bd9Sstevel@tonic-gate 	OUT	DAT_RMR_PARAM *);	/* rmr_param		*/
11007c478bd9Sstevel@tonic-gate 
11017c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rmr_bind(
11027c478bd9Sstevel@tonic-gate 	IN	DAT_RMR_HANDLE,		/* rmr_handle		*/
11037c478bd9Sstevel@tonic-gate 	IN	const DAT_LMR_TRIPLET *,	/* lmr_triplet		*/
11047c478bd9Sstevel@tonic-gate 	IN	DAT_MEM_PRIV_FLAGS,	/* mem_priv		*/
11057c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
11067c478bd9Sstevel@tonic-gate 	IN	DAT_RMR_COOKIE,		/* user_cookie		*/
11077c478bd9Sstevel@tonic-gate 	IN	DAT_COMPLETION_FLAGS,	/* completion_flags	*/
11087c478bd9Sstevel@tonic-gate 	OUT	DAT_RMR_CONTEXT *);	/* context		*/
11097c478bd9Sstevel@tonic-gate 
11107c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rmr_free(
11117c478bd9Sstevel@tonic-gate 	IN	DAT_RMR_HANDLE);	/* rmr_handle		*/
11127c478bd9Sstevel@tonic-gate 
11137c478bd9Sstevel@tonic-gate /* PSP Functions */
11147c478bd9Sstevel@tonic-gate 
11157c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_psp_create(
11167c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11177c478bd9Sstevel@tonic-gate 	IN	DAT_CONN_QUAL,		/* conn_qual		*/
11187c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
11197c478bd9Sstevel@tonic-gate 	IN	DAT_PSP_FLAGS,		/* psp_flags		*/
11207c478bd9Sstevel@tonic-gate 	OUT	DAT_PSP_HANDLE *);	/* psp_handle		*/
11217c478bd9Sstevel@tonic-gate 
11227c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_psp_create_any(
11237c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11247c478bd9Sstevel@tonic-gate 	OUT	DAT_CONN_QUAL *,	/* conn_qual		*/
11257c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
11267c478bd9Sstevel@tonic-gate 	IN	DAT_PSP_FLAGS,		/* psp_flags		*/
11277c478bd9Sstevel@tonic-gate 	OUT	DAT_PSP_HANDLE *);	/* psp_handle		*/
11287c478bd9Sstevel@tonic-gate 
11297c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_psp_query(
11307c478bd9Sstevel@tonic-gate 	IN	DAT_PSP_HANDLE,		/* psp_handle		*/
11317c478bd9Sstevel@tonic-gate 	IN	DAT_PSP_PARAM_MASK,	/* psp_param_mask	*/
11327c478bd9Sstevel@tonic-gate 	OUT	DAT_PSP_PARAM *);	/* psp_param		*/
11337c478bd9Sstevel@tonic-gate 
11347c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_psp_free(
11357c478bd9Sstevel@tonic-gate 	IN	DAT_PSP_HANDLE);	/* psp_handle		*/
11367c478bd9Sstevel@tonic-gate 
11377c478bd9Sstevel@tonic-gate /* RSP Functions */
11387c478bd9Sstevel@tonic-gate 
11397c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rsp_create(
11407c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11417c478bd9Sstevel@tonic-gate 	IN	DAT_CONN_QUAL,		/* conn_qual		*/
11427c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
11437c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* evd_handle		*/
11447c478bd9Sstevel@tonic-gate 	OUT	DAT_RSP_HANDLE *);	/* rsp_handle		*/
11457c478bd9Sstevel@tonic-gate 
11467c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rsp_query(
11477c478bd9Sstevel@tonic-gate 	IN	DAT_RSP_HANDLE,		/* rsp_handle		*/
11487c478bd9Sstevel@tonic-gate 	IN	DAT_RSP_PARAM_MASK,	/* rsp_param_mask	*/
11497c478bd9Sstevel@tonic-gate 	OUT	DAT_RSP_PARAM *);	/* rsp_param		*/
11507c478bd9Sstevel@tonic-gate 
11517c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_rsp_free(
11527c478bd9Sstevel@tonic-gate 	IN	DAT_RSP_HANDLE);	/* rsp_handle		*/
11537c478bd9Sstevel@tonic-gate 
11547c478bd9Sstevel@tonic-gate /* PZ Functions */
11557c478bd9Sstevel@tonic-gate 
11567c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_pz_create(
11577c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11587c478bd9Sstevel@tonic-gate 	OUT	DAT_PZ_HANDLE *);	/* pz_handle		*/
11597c478bd9Sstevel@tonic-gate 
11607c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_pz_query(
11617c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
11627c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_PARAM_MASK,	/* pz_param_mask	*/
11637c478bd9Sstevel@tonic-gate 	OUT	DAT_PZ_PARAM *);	/* pz_param		*/
11647c478bd9Sstevel@tonic-gate 
11657c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_pz_free(
11667c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE);		/* pz_handle		*/
11677c478bd9Sstevel@tonic-gate 
11687c478bd9Sstevel@tonic-gate /*
11697c478bd9Sstevel@tonic-gate  * SRQ functions
11707c478bd9Sstevel@tonic-gate  */
11717c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_create_with_srq(
11727c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11737c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
11747c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* recv_evd_handle	*/
11757c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* request_evd_handle	*/
11767c478bd9Sstevel@tonic-gate 	IN	DAT_EVD_HANDLE,		/* connect_evd_handle	*/
11777c478bd9Sstevel@tonic-gate 	IN	DAT_SRQ_HANDLE,		/* srq_handle 		*/
11787c478bd9Sstevel@tonic-gate 	IN	const DAT_EP_ATTR *,	/* ep_attributes	*/
11797c478bd9Sstevel@tonic-gate 	OUT	DAT_EP_HANDLE *);	/* ep_handle		*/
11807c478bd9Sstevel@tonic-gate 
11817c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_recv_query(
11827c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
11837c478bd9Sstevel@tonic-gate 	OUT	DAT_COUNT *,		/* nbufs_allocated	*/
11847c478bd9Sstevel@tonic-gate 	OUT	DAT_COUNT *);		/* bufs_alloc_span	*/
11857c478bd9Sstevel@tonic-gate 
11867c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_ep_set_watermark(
11877c478bd9Sstevel@tonic-gate 	IN	DAT_EP_HANDLE,		/* ep_handle		*/
11887c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT,		/* soft_high_watermark	*/
11897c478bd9Sstevel@tonic-gate 	IN	DAT_COUNT);		/* hard_high_watermark	*/
11907c478bd9Sstevel@tonic-gate 
11917c478bd9Sstevel@tonic-gate extern DAT_RETURN dat_srq_create(
11927c478bd9Sstevel@tonic-gate 	IN	DAT_IA_HANDLE,		/* ia_handle		*/
11937c478bd9Sstevel@tonic-gate 	IN	DAT_PZ_HANDLE,		/* pz_handle		*/
11947c478bd9Sstevel@tonic-gate 	IN	DAT_SRQ_ATTR *,		/* srq_attr		*/
1195