1*9e39c5baSBill Taylor /*
2*9e39c5baSBill Taylor  * CDDL HEADER START
3*9e39c5baSBill Taylor  *
4*9e39c5baSBill Taylor  * The contents of this file are subject to the terms of the
5*9e39c5baSBill Taylor  * Common Development and Distribution License (the "License").
6*9e39c5baSBill Taylor  * You may not use this file except in compliance with the License.
7*9e39c5baSBill Taylor  *
8*9e39c5baSBill Taylor  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*9e39c5baSBill Taylor  * or http://www.opensolaris.org/os/licensing.
10*9e39c5baSBill Taylor  * See the License for the specific language governing permissions
11*9e39c5baSBill Taylor  * and limitations under the License.
12*9e39c5baSBill Taylor  *
13*9e39c5baSBill Taylor  * When distributing Covered Code, include this CDDL HEADER in each
14*9e39c5baSBill Taylor  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*9e39c5baSBill Taylor  * If applicable, add the following below this CDDL HEADER, with the
16*9e39c5baSBill Taylor  * fields enclosed by brackets "[]" replaced with your own identifying
17*9e39c5baSBill Taylor  * information: Portions Copyright [yyyy] [name of copyright owner]
18*9e39c5baSBill Taylor  *
19*9e39c5baSBill Taylor  * CDDL HEADER END
20*9e39c5baSBill Taylor  */
21*9e39c5baSBill Taylor 
22*9e39c5baSBill Taylor /*
23*9e39c5baSBill Taylor  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*9e39c5baSBill Taylor  * Use is subject to license terms.
25*9e39c5baSBill Taylor  */
26*9e39c5baSBill Taylor 
27*9e39c5baSBill Taylor #ifndef	_DAPL_IF_H_
28*9e39c5baSBill Taylor #define	_DAPL_IF_H_
29*9e39c5baSBill Taylor 
30*9e39c5baSBill Taylor #ifdef __cplusplus
31*9e39c5baSBill Taylor extern "C" {
32*9e39c5baSBill Taylor #endif
33*9e39c5baSBill Taylor 
34*9e39c5baSBill Taylor /* change this "version" everytime the interface changes */
35*9e39c5baSBill Taylor #define	DAPL_IF_VERSION			(0x05302007)
36*9e39c5baSBill Taylor 
37*9e39c5baSBill Taylor #define	DAPL_IOC			(0x0da9 << 16)
38*9e39c5baSBill Taylor #define	DAPL_TYPE_IA			(DAPL_IOC | 0x11 << 8)
39*9e39c5baSBill Taylor #define	DAPL_TYPE_EVD			(DAPL_IOC | 0x12 << 8)
40*9e39c5baSBill Taylor #define	DAPL_TYPE_EP			(DAPL_IOC | 0x13 << 8)
41*9e39c5baSBill Taylor #define	DAPL_TYPE_MR			(DAPL_IOC | 0x14 << 8)
42*9e39c5baSBill Taylor #define	DAPL_TYPE_PD			(DAPL_IOC | 0x15 << 8)
43*9e39c5baSBill Taylor #define	DAPL_TYPE_SP			(DAPL_IOC | 0x16 << 8)
44*9e39c5baSBill Taylor #define	DAPL_TYPE_CNO			(DAPL_IOC | 0x17 << 8)
45*9e39c5baSBill Taylor #define	DAPL_TYPE_MW			(DAPL_IOC | 0x18 << 8)
46*9e39c5baSBill Taylor #define	DAPL_TYPE_MISC			(DAPL_IOC | 0x19 << 8)
47*9e39c5baSBill Taylor #define	DAPL_TYPE_SRQ			(DAPL_IOC | 0x1a << 8)
48*9e39c5baSBill Taylor #define	DAPL_TYPE_NONE			(DAPL_IOC | 0x1f << 8)
49*9e39c5baSBill Taylor #define	DAPL_TYPE_MASK			(0xffffff00)
50*9e39c5baSBill Taylor 
51*9e39c5baSBill Taylor /* NONE */
52*9e39c5baSBill Taylor #define	DAPL_IA_CREATE			(DAPL_TYPE_NONE | 0x01)
53*9e39c5baSBill Taylor 
54*9e39c5baSBill Taylor /* MISC */
55*9e39c5baSBill Taylor #define	DAPL_CR_ACCEPT			(DAPL_TYPE_MISC | 0x01)
56*9e39c5baSBill Taylor #define	DAPL_CR_REJECT			(DAPL_TYPE_MISC | 0x02)
57*9e39c5baSBill Taylor #define	DAPL_IA_QUERY			(DAPL_TYPE_MISC | 0x03)
58*9e39c5baSBill Taylor #define	DAPL_CR_HANDOFF			(DAPL_TYPE_MISC | 0x04)
59*9e39c5baSBill Taylor 
60*9e39c5baSBill Taylor /* EP */
61*9e39c5baSBill Taylor #define	DAPL_EP_CREATE			(DAPL_TYPE_EP | 0x01)
62*9e39c5baSBill Taylor #define	DAPL_EP_FREE			(DAPL_TYPE_EP | 0x02)
63*9e39c5baSBill Taylor #define	DAPL_EP_CONNECT			(DAPL_TYPE_EP | 0x03)
64*9e39c5baSBill Taylor #define	DAPL_EP_MODIFY			(DAPL_TYPE_EP | 0x04)
65*9e39c5baSBill Taylor #define	DAPL_EP_DISCONNECT		(DAPL_TYPE_EP | 0x05)
66*9e39c5baSBill Taylor #define	DAPL_EP_REINIT			(DAPL_TYPE_EP | 0x06)
67*9e39c5baSBill Taylor 
68*9e39c5baSBill Taylor /* EVD */
69*9e39c5baSBill Taylor #define	DAPL_EVD_CREATE			(DAPL_TYPE_EVD | 0x01)
70*9e39c5baSBill Taylor #define	DAPL_CQ_RESIZE			(DAPL_TYPE_EVD | 0x02)
71*9e39c5baSBill Taylor #define	DAPL_EVD_FREE			(DAPL_TYPE_EVD | 0x03)
72*9e39c5baSBill Taylor #define	DAPL_EVENT_POLL			(DAPL_TYPE_EVD | 0x04)
73*9e39c5baSBill Taylor #define	DAPL_EVENT_WAKEUP		(DAPL_TYPE_EVD | 0x05)
74*9e39c5baSBill Taylor #define	DAPL_EVD_MODIFY_CNO		(DAPL_TYPE_EVD | 0x06)
75*9e39c5baSBill Taylor 
76*9e39c5baSBill Taylor /* MR */
77*9e39c5baSBill Taylor #define	DAPL_MR_REGISTER		(DAPL_TYPE_MR | 0x01)
78*9e39c5baSBill Taylor #define	DAPL_MR_REGISTER_LMR		(DAPL_TYPE_MR | 0x02)
79*9e39c5baSBill Taylor #define	DAPL_MR_REGISTER_SHARED		(DAPL_TYPE_MR | 0x03)
80*9e39c5baSBill Taylor #define	DAPL_MR_DEREGISTER		(DAPL_TYPE_MR | 0x04)
81*9e39c5baSBill Taylor #define	DAPL_MR_SYNC			(DAPL_TYPE_MR | 0x05)
82*9e39c5baSBill Taylor 
83*9e39c5baSBill Taylor /* MW */
84*9e39c5baSBill Taylor #define	DAPL_MW_ALLOC			(DAPL_TYPE_MW | 0x01)
85*9e39c5baSBill Taylor #define	DAPL_MW_FREE			(DAPL_TYPE_MW | 0x02)
86*9e39c5baSBill Taylor 
87*9e39c5baSBill Taylor /* CNO */
88*9e39c5baSBill Taylor #define	DAPL_CNO_ALLOC			(DAPL_TYPE_CNO | 0x01)
89*9e39c5baSBill Taylor #define	DAPL_CNO_FREE			(DAPL_TYPE_CNO | 0x02)
90*9e39c5baSBill Taylor #define	DAPL_CNO_WAIT			(DAPL_TYPE_CNO | 0x03)
91*9e39c5baSBill Taylor 
92*9e39c5baSBill Taylor /* PD */
93*9e39c5baSBill Taylor #define	DAPL_PD_ALLOC			(DAPL_TYPE_PD | 0x01)
94*9e39c5baSBill Taylor #define	DAPL_PD_FREE			(DAPL_TYPE_PD | 0x02)
95*9e39c5baSBill Taylor 
96*9e39c5baSBill Taylor /* SP */
97*9e39c5baSBill Taylor #define	DAPL_SERVICE_REGISTER		(DAPL_TYPE_SP | 0x01)
98*9e39c5baSBill Taylor #define	DAPL_SERVICE_DEREGISTER		(DAPL_TYPE_SP | 0x02)
99*9e39c5baSBill Taylor 
100*9e39c5baSBill Taylor /* SRQ */
101*9e39c5baSBill Taylor #define	DAPL_SRQ_CREATE			(DAPL_TYPE_SRQ	| 0x01)
102*9e39c5baSBill Taylor #define	DAPL_SRQ_FREE			(DAPL_TYPE_SRQ	| 0x02)
103*9e39c5baSBill Taylor #define	DAPL_SRQ_RESIZE			(DAPL_TYPE_SRQ	| 0x03)
104*9e39c5baSBill Taylor 
105*9e39c5baSBill Taylor /*
106*9e39c5baSBill Taylor  * Drivers name and minor name.
107*9e39c5baSBill Taylor  */
108*9e39c5baSBill Taylor #define	DAPLKA_DRV_NAME		"daplt"
109*9e39c5baSBill Taylor #define	DAPLKA_MINOR_NAME	"daplt"
110*9e39c5baSBill Taylor #define	DAPLKA_DEFAULT_PATH	"/devices/ib/daplt@0:daplt"
111*9e39c5baSBill Taylor #define	DAPLKA_DRIVER_MINOR	0
112*9e39c5baSBill Taylor 
113*9e39c5baSBill Taylor /*
114*9e39c5baSBill Taylor  * Upper limit on number of events that can be polled per event_poll ioctl
115*9e39c5baSBill Taylor  * Since we allocate memory in kernel there needs to be an upper bound.
116*9e39c5baSBill Taylor  */
117*9e39c5baSBill Taylor #define	DAPL_EVD_MAX_EVENTS	16384
118*9e39c5baSBill Taylor /*
119*9e39c5baSBill Taylor  * Number of events that we generally poll for in event_poll.
120*9e39c5baSBill Taylor  */
121*9e39c5baSBill Taylor #define	NUM_EVENTS_PER_POLL	16
122*9e39c5baSBill Taylor 
123*9e39c5baSBill Taylor /* duplicated from dat.h */
124*9e39c5baSBill Taylor #ifndef _DAT_H_
125*9e39c5baSBill Taylor typedef enum dat_evd_flags {
126*9e39c5baSBill Taylor 	DAT_EVD_SOFTWARE_FLAG	= 0x01,
127*9e39c5baSBill Taylor 	DAT_EVD_CR_FLAG		= 0x10,
128*9e39c5baSBill Taylor 	DAT_EVD_DTO_FLAG	= 0x20,
129*9e39c5baSBill Taylor 	DAT_EVD_CONNECTION_FLAG	= 0x40,
130*9e39c5baSBill Taylor 	DAT_EVD_RMR_BIND_FLAG	= 0x80,
131*9e39c5baSBill Taylor 	DAT_EVD_ASYNC_FLAG	= 0x100,
132*9e39c5baSBill Taylor 	/* DAT events only, no software events */
133*9e39c5baSBill Taylor 	DAT_EVD_DEFAULT_FLAG	= 0x1F0
134*9e39c5baSBill Taylor } DAT_EVD_FLAGS;
135*9e39c5baSBill Taylor #endif /* _DAT_H_ */
136*9e39c5baSBill Taylor 
138*9e39c5baSBill Taylor #define	DAPL_ATS_NBYTES			16	/* SA record data length */
139*9e39c5baSBill Taylor 
140*9e39c5baSBill Taylor /*
141*9e39c5baSBill Taylor  * All structures defined herein are used for ioctls. On amd64,
142*9e39c5baSBill Taylor  * use pack(4) to make structures match the x86 alignment rules.
143*9e39c5baSBill Taylor  */
144*9e39c5baSBill Taylor 
145*9e39c5baSBill Taylor #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
146*9e39c5baSBill Taylor #pragma pack(4)
147*9e39c5baSBill Taylor #endif
148*9e39c5baSBill Taylor 
149*9e39c5baSBill Taylor /*
150*9e39c5baSBill Taylor  *				      Byte     Offset
151*9e39c5baSBill Taylor  * uDAPL client's private data		64	00
152*9e39c5baSBill Taylor  * Base Sockets Direct Header (BSDH)	 4	64
153*9e39c5baSBill Taylor  * Extended Header				68
154*9e39c5baSBill Taylor  *  Hello Message (HH)			24
155*9e39c5baSBill Taylor  *
156*9e39c5baSBill Taylor  *   bits	32-24		23-16		15-8	7-0
157*9e39c5baSBill Taylor  * bytes
158*9e39c5baSBill Taylor  * 00-63	uDAPL client's private data
159*9e39c5baSBill Taylor  * 64-67	MID             client_msg_len	checksum
160*9e39c5baSBill Taylor  * 68-72	MajV MinV       IPV 		rsvd1
161*9e39c5baSBill Taylor  * 73-75	rsvd2				LocalPort
162*9e39c5baSBill Taylor  * 76-79	SrcIP(127-96)
163*9e39c5baSBill Taylor  * 80-83	SrcIP(95-64)
164*9e39c5baSBill Taylor  * 84-87	SrcIP(63-32)
165*9e39c5baSBill Taylor  * 88-92	SrcIP(31-00)
166*9e39c5baSBill Taylor  *
167*9e39c5baSBill Taylor  */
168*9e39c5baSBill Taylor typedef union dapl_ia_addr_s {
169*9e39c5baSBill Taylor 	struct {
170*9e39c5baSBill Taylor 		uint32_t	iad_pad[3];
171*9e39c5baSBill Taylor 		struct in_addr	iad_v4data;
172*9e39c5baSBill Taylor 	} iad_v4_s;			/* IPv4 format */
173*9e39c5baSBill Taylor 	in6_addr_t	iad_v6data;	/* IPv6 format */
174*9e39c5baSBill Taylor 	uint8_t		iad_sadata[DAPL_ATS_NBYTES]; /* SA format */
175*9e39c5baSBill Taylor 	uint32_t	iad_src;	/* alignment */
176*9e39c5baSBill Taylor } dapl_ia_addr_t;
177*9e39c5baSBill Taylor #define	iad_v4		iad_v4_s.iad_v4data
178*9e39c5baSBill Taylor #define	iad_v4pad	iad_v4_s.iad_pad
179*9e39c5baSBill Taylor #define	iad_v6		iad_v6data
180*9e39c5baSBill Taylor #define	iad_sa		iad_sadata
181*9e39c5baSBill Taylor 
182*9e39c5baSBill Taylor typedef struct dapl_hello_msg {
183*9e39c5baSBill Taylor 	uint16_t	hi_checksum;	/* checksum */
184*9e39c5baSBill Taylor 	uint8_t		hi_clen;	/* client private data len */
185*9e39c5baSBill Taylor 	uint8_t		hi_mid;		/* command - not use */
186*9e39c5baSBill Taylor 	uint16_t	hi_rsvd1;
187*9e39c5baSBill Taylor 	uint8_t		hi_ipv;		/* IP family ipv4 or ipv6 */
188*9e39c5baSBill Taylor 	uint8_t		hi_vers;	/* hello message version number */
189*9e39c5baSBill Taylor 	in_port_t	hi_port;	/* IP port number */
190*9e39c5baSBill Taylor 	uint16_t	hi_rsvd2;
191*9e39c5baSBill Taylor 	dapl_ia_addr_t	_hi_ipaddr;	/* IP address */
192*9e39c5baSBill Taylor } DAPL_HELLO_MSG;
193*9e39c5baSBill Taylor /* different views of the address field */
194*9e39c5baSBill Taylor #define	hi_v4ipaddr	_hi_ipaddr.iad_v4	/* IPv4 */
195*9e39c5baSBill Taylor #define	hi_v4pad	_hi_ipaddr.iad_v4pad
196*9e39c5baSBill Taylor #define	hi_v6ipaddr	_hi_ipaddr.iad_v6	/* IPv6 */
197*9e39c5baSBill Taylor #define	hi_saaddr	_hi_ipaddr.iad_sa	/* 16 bytes SA record */
198*9e39c5baSBill Taylor 
199*9e39c5baSBill Taylor #define	DAPL_CHECKSUM		0xbeef		/* use as magic number */
200*9e39c5baSBill Taylor #define	DAPL_HELLO_MSG_VERS	0x10		/* major 1 minor 0 */
201*9e39c5baSBill Taylor /* DAPL_PRIVATE used to pass private data in a connection */
202*9e39c5baSBill Taylor #define	DAPL_CONSUMER_MAX_PRIVATE_DATA_SIZE	64
203*9e39c5baSBill Taylor typedef struct dapl_private {
204*9e39c5baSBill Taylor 	unsigned char private_data[DAPL_CONSUMER_MAX_PRIVATE_DATA_SIZE];
205*9e39c5baSBill Taylor 	DAPL_HELLO_MSG hello_msg;
206*9e39c5baSBill Taylor } DAPL_PRIVATE;
207*9e39c5baSBill Taylor 
208*9e39c5baSBill Taylor /* EP ioctl interfaces */
209*9e39c5baSBill Taylor 
210*9e39c5baSBill Taylor /*
211*9e39c5baSBill Taylor  * Definitions used by DAPL for HCA specific "data out" information.  This
212*9e39c5baSBill Taylor  * data is opaque to daplt, and is consumed by HCA specific code in the
213*9e39c5baSBill Taylor  * userland library.
214*9e39c5baSBill Taylor  *
215*9e39c5baSBill Taylor  * The sizes (in units of uint64_t) need to be big enough for all HCAs
216*9e39c5baSBill Taylor  * supported.  Although 16 is large enough, since we never want to have
217*9e39c5baSBill Taylor  * to change our interface version just because we undersized this, we
218*9e39c5baSBill Taylor  * have chosen 24.
219*9e39c5baSBill Taylor  */
220*9e39c5baSBill Taylor #define	DAPL_CQ_DATA_OUT_SIZE	24
221*9e39c5baSBill Taylor #define	DAPL_QP_DATA_OUT_SIZE	24
222*9e39c5baSBill Taylor #define	DAPL_SRQ_DATA_OUT_SIZE	24
223*9e39c5baSBill Taylor 
224*9e39c5baSBill Taylor typedef uint64_t dapl_cq_data_out_t[DAPL_QP_DATA_OUT_SIZE];
225*9e39c5baSBill Taylor typedef uint64_t dapl_qp_data_out_t[DAPL_CQ_DATA_OUT_SIZE];
226*9e39c5baSBill Taylor typedef uint64_t dapl_srq_data_out_t[DAPL_SRQ_DATA_OUT_SIZE];
227*9e39c5baSBill Taylor 
228*9e39c5baSBill Taylor /*
229*9e39c5baSBill Taylor  * Channel sizes struct, copy of ibt_chan_sizes_t so that it can work
230*9e39c5baSBill Taylor  * fine for both 32/64 bit library
231*9e39c5baSBill Taylor  */
232*9e39c5baSBill Taylor typedef struct dapl_chan_sizes_s {
233*9e39c5baSBill Taylor 	uint_t	dcs_sq;		/* SendQ size. */
234*9e39c5baSBill Taylor 	uint_t	dcs_rq;		/* ReceiveQ size. */
235*9e39c5baSBill Taylor 	uint_t	dcs_sq_sgl;	/* Max SGL elements in a SQ WR. */
236*9e39c5baSBill Taylor 	uint_t	dcs_rq_sgl;	/* Max SGL elements in a RQ Wr. */
237*9e39c5baSBill Taylor } dapl_chan_sizes_t;
238*9e39c5baSBill Taylor 
239*9e39c5baSBill Taylor /*
240*9e39c5baSBill Taylor  * EP create ioctl message structure
241*9e39c5baSBill Taylor  */
242*9e39c5baSBill Taylor typedef struct dapl_ep_create_s {
243*9e39c5baSBill Taylor 	uint64_t		ep_hkey;	  /* hash key of the EP */
244*9e39c5baSBill Taylor 	uint64_t		ep_pd_hkey;	  /* PD hash key */
245*9e39c5baSBill Taylor 	uint64_t		ep_rcv_evd_hkey;  /* Recv evd hash key */
246*9e39c5baSBill Taylor 	uint64_t		ep_snd_evd_hkey;  /* Send evd hash key */
247*9e39c5baSBill Taylor 	uint64_t		ep_conn_evd_hkey; /* Conn evd hash key */
248*9e39c5baSBill Taylor 	uint64_t		ep_srq_hkey;	  /* SRQ hash key	*/
249*9e39c5baSBill Taylor 	uint32_t		ep_srq_attached;  /* EP with SRQ - 1 or 0 */
250*9e39c5baSBill Taylor 	uint64_t		ep_cookie;	  /* Userland EP pointer */
251*9e39c5baSBill Taylor 	dapl_chan_sizes_t	ep_ch_sizes;	  /* Requested RC params */
252*9e39c5baSBill Taylor 	dapl_chan_sizes_t	ep_ch_real_sizes; /* Allocated RC params */
253*9e39c5baSBill Taylor 	dapl_qp_data_out_t	ep_qp_data_out;
254*9e39c5baSBill Taylor } dapl_ep_create_t;
255*9e39c5baSBill Taylor 
256*9e39c5baSBill Taylor /*
257*9e39c5baSBill Taylor  * Modify is not yet completely implemented
258*9e39c5baSBill Taylor  */
259*9e39c5baSBill Taylor typedef struct dapl_ep_modify_s {
260*9e39c5baSBill Taylor 	uint64_t		epm_hkey;
261*9e39c5baSBill Taylor 	ibt_cep_modify_flags_t	epm_flags;
262*9e39c5baSBill Taylor 	uint8_t			epm_rdma_ra_out;
263*9e39c5baSBill Taylor 	uint8_t			epm_rdma_ra_in;
264*9e39c5baSBill Taylor } dapl_ep_modify_t;
265*9e39c5baSBill Taylor 
266*9e39c5baSBill Taylor /*
267*9e39c5baSBill Taylor  * EP Connect ioctl message
268*9e39c5baSBill Taylor  */
269*9e39c5baSBill Taylor typedef struct dapl_ep_connect_s {
270*9e39c5baSBill Taylor 	uint64_t		epc_hkey;	/* EP hash key		*/
271*9e39c5baSBill Taylor 	ib_gid_t		epc_dgid;	/* destination gid	*/
272*9e39c5baSBill Taylor 	uint64_t		epc_sid;	/* service id		*/
273*9e39c5baSBill Taylor 	uint64_t		epc_timeout;	/* timeout		*/
274*9e39c5baSBill Taylor 	uint32_t		epc_priv_sz;	/* private data size	*/
275*9e39c5baSBill Taylor 	dapl_ia_addr_t		epc_raddr_sadata; /* remote addr in SA format */
276*9e39c5baSBill Taylor 	uchar_t			epc_priv[DAPL_MAX_PRIVATE_DATA_SIZE];
277*9e39c5baSBill Taylor } dapl_ep_connect_t;
278*9e39c5baSBill Taylor 
279*9e39c5baSBill Taylor typedef struct dapl_ep_disconnect_s {
280*9e39c5baSBill Taylor 	uint64_t		epd_hkey;	/* EP hash key */
281*9e39c5baSBill Taylor } dapl_ep_disconnect_t;
282*9e39c5baSBill Taylor 
283*9e39c5baSBill Taylor /*
284*9e39c5baSBill Taylor  * EP reinit ioctl called to recycle the RC
285*9e39c5baSBill Taylor  */
286*9e39c5baSBill Taylor typedef struct dapl_ep_reinit_s {
287*9e39c5baSBill Taylor 	uint64_t		epri_hkey;	 /* EP hash key */
288*9e39c5baSBill Taylor 	uint64_t		epri_map_offset; /* Mapping offset of new QP */
289*9e39c5baSBill Taylor 	uint64_t		epri_map_len;	 /* Map len of new QP	*/
290*9e39c5baSBill Taylor 	uint32_t		epri_qpnum;	 /* QPnum of the new QP */
291*9e39c5baSBill Taylor 	uint32_t		epri_rq_offset;  /* New RecvQ offset in buf */
292*9e39c5baSBill Taylor 	uint32_t		epri_rq_desc_addr; /* New RecvQ kernel addr */
293*9e39c5baSBill Taylor 	uint32_t		epri_rq_numwqe;
294*9e39c5baSBill Taylor 	uint32_t		epri_rq_wqesz;
295*9e39c5baSBill Taylor 	uint32_t		epri_sq_offset;  /* New SendQ offset in buf */
296*9e39c5baSBill Taylor 	uint32_t		epri_sq_desc_addr; /* New SendQ kernel addr */
297*9e39c5baSBill Taylor 	uint32_t		epri_sq_numwqe;
298*9e39c5baSBill Taylor 	uint32_t		epri_sq_wqesz;
299*9e39c5baSBill Taylor } dapl_ep_reinit_t;
300*9e39c5baSBill Taylor 
301*9e39c5baSBill Taylor typedef struct dapl_ep_free_s {
302*9e39c5baSBill Taylor 	uint64_t		epf_hkey;	/* EP hash key */
303*9e39c5baSBill Taylor } dapl_ep_free_t;
304*9e39c5baSBill Taylor 
305*9e39c5baSBill Taylor /* EVD ioctl interfaces */
306*9e39c5baSBill Taylor 
307*9e39c5baSBill Taylor /*
308*9e39c5baSBill Taylor  * EVD create ioctl
309*9e39c5baSBill Taylor  */
310*9e39c5baSBill Taylor typedef struct dapl_evd_create_s {
311*9e39c5baSBill Taylor 	uint64_t		evd_hkey;	/* EVD hash key */
312*9e39c5baSBill Taylor 	DAT_EVD_FLAGS		evd_flags;	/* EVD streams flag */
313*9e39c5baSBill Taylor 	uint64_t		evd_cookie;	/* userland EVD pointer */
314*9e39c5baSBill Taylor 	uint64_t		evd_cno_hkey;	/* CNO hash key */
315*9e39c5baSBill Taylor 	uint32_t		evd_cq_size;	/* Requested CQ Size */
316*9e39c5baSBill Taylor 	uint32_t		evd_cq_real_size;  /* Allocated CQ size */
317*9e39c5baSBill Taylor 	dapl_cq_data_out_t	evd_cq_data_out;
318*9e39c5baSBill Taylor } dapl_evd_create_t;
319*9e39c5baSBill Taylor 
320*9e39c5baSBill Taylor /*
321*9e39c5baSBill Taylor  * If an EVD has a CQ this ioctl message is used to resize the CQ
322*9e39c5baSBill Taylor  */
323*9e39c5baSBill Taylor typedef struct dapl_cq_resize_s {
324*9e39c5baSBill Taylor 	uint64_t		cqr_evd_hkey;	  /* EVD hash key */
325*9e39c5baSBill Taylor 	uint32_t		cqr_cq_new_size;  /* New requested CQ size */
326*9e39c5baSBill Taylor 	uint32_t		cqr_cq_real_size; /* Allocated CQ size */
327*9e39c5baSBill Taylor 	dapl_cq_data_out_t	cqr_cq_data_out;
328*9e39c5baSBill Taylor } dapl_cq_resize_t;
329*9e39c5baSBill Taylor 
330*9e39c5baSBill Taylor /*
331*9e39c5baSBill Taylor  * Event type used while returning events from the kernel
332*9e39c5baSBill Taylor  */
333*9e39c5baSBill Taylor typedef enum {
334*9e39c5baSBill Taylor 	/* event family for the Async events */
335*9e39c5baSBill Taylor 	DAPL_ASYNC_EVENTS = 0x01,
336*9e39c5baSBill Taylor 	/* event family for events posted by the PASSIVE side cm_handler */
337*9e39c5baSBill Taylor 	DAPL_CR_EVENTS = 0x02,
338*9e39c5baSBill Taylor 	/* event family for events posted by the PASSIVE side cm_handler */
339*9e39c5baSBill Taylor 	DAPL_PASSIVE_CONNECTION_EVENTS = 0x04,
340*9e39c5baSBill Taylor 	/* event family for events posted by the ACTIVE side cm_handler */
341*9e39c5baSBill Taylor 	DAPL_ACTIVE_CONNECTION_EVENTS = 0x08
342*9e39c5baSBill Taylor } dapl_event_family_t;
343*9e39c5baSBill Taylor 
344*9e39c5baSBill Taylor /*
345*9e39c5baSBill Taylor  * Async event structure
346*9e39c5baSBill Taylor  */
347*9e39c5baSBill Taylor typedef struct dapl_ib_async_event_s {
348*9e39c5baSBill Taylor 	ibt_async_code_t	ibae_type;
349*9e39c5baSBill Taylor 	ib_guid_t		ibae_hca_guid; /* HCA node GUID */
350*9e39c5baSBill Taylor 	uint64_t		ibae_cookie; /* ep or cq pointer */
351*9e39c5baSBill Taylor 	uint8_t			ibae_port; /* HCA Port num unaffiliated evnt */
352*9e39c5baSBill Taylor } dapl_ib_async_event_t;
353*9e39c5baSBill Taylor 
354*9e39c5baSBill Taylor /*
355*9e39c5baSBill Taylor  * CM events definitions used to translate IBTF CM events to DAPL CM events
356*9e39c5baSBill Taylor  */
357*9e39c5baSBill Taylor typedef enum {
358*9e39c5baSBill Taylor 	/* IBT_CM_EVENT_CONN_EST */
359*9e39c5baSBill Taylor 	DAPL_IB_CME_CONNECTED = 1,
360*9e39c5baSBill Taylor 	/* IBT_CM_EVENT_CONN_CLOSED */
361*9e39c5baSBill Taylor 	DAPL_IB_CME_DISCONNECTED,
362*9e39c5baSBill Taylor 	/* IBT_CM_EVENT_REQ_RCV */
365*9e39c5baSBill Taylor 	/* IBT_CM_EVENT_FAILURE */
368*9e39c5baSBill Taylor 	/* Currently not mapped to IBTF CM events */
371*9e39c5baSBill Taylor 	DAPL_IB_CME_LOCAL_FAILURE,
372*9e39c5baSBill Taylor 	DAPL_IB_CME_TIMED_OUT,
374*9e39c5baSBill Taylor 	/*
375*9e39c5baSBill Taylor 	 * Not really a CM event but library uses CM events as reject reasons
376*9e39c5baSBill Taylor 	 * so to avoid any overlaps, make it part of this enum
377*9e39c5baSBill Taylor 	 */
379*9e39c5baSBill Taylor } dapl_ib_cm_event_type_t;
380*9e39c5baSBill Taylor 
381*9e39c5baSBill Taylor /*
382*9e39c5baSBill Taylor  * CM event structure
383*9e39c5baSBill Taylor  */
384*9e39c5baSBill Taylor typedef struct dapl_ib_cm_event_s {
385*9e39c5baSBill Taylor 	dapl_ib_cm_event_type_t	ibce_event;
386*9e39c5baSBill Taylor 	/* Userland PSP ptr for CR, EP ptr for CONNECTION */
387*9e39c5baSBill Taylor 	uint64_t		ibce_cookie;
388*9e39c5baSBill Taylor 	/* Unique CR cookie: tmstamp + Index in the connection pending table */
389*9e39c5baSBill Taylor 	uint64_t		ibce_psep_cookie;
390*9e39c5baSBill Taylor 	uint32_t		ibce_priv_data_size;
391*9e39c5baSBill Taylor 	uchar_t			ibce_priv_data_ptr[DAPL_MAX_PRIVATE_DATA_SIZE];
392*9e39c5baSBill Taylor } dapl_ib_cm_event_t;
393*9e39c5baSBill Taylor 
394*9e39c5baSBill Taylor /*
395*9e39c5baSBill Taylor  * Kernel Events structure used for returning CM or Async events
396*9e39c5baSBill Taylor  */
397*9e39c5baSBill Taylor typedef struct dapl_ib_event_s {
398*9e39c5baSBill Taylor 	dapl_event_family_t	ibe_ev_family;
399*9e39c5baSBill Taylor 	union {
400*9e39c5baSBill Taylor 		dapl_ib_async_event_t	ibe_async; /* Async event */
401*9e39c5baSBill Taylor 		dapl_ib_cm_event_t	ibe_ce;	   /* CM event    */
402*9e39c5baSBill Taylor 	} ev_data;
403*9e39c5baSBill Taylor #define	ibe_async	ev_data.ibe_async
404*9e39c5baSBill Taylor #define	ibe_ce		ev_data.ibe_ce
405*9e39c5baSBill Taylor } dapl_ib_event_t;
406*9e39c5baSBill Taylor 
407*9e39c5baSBill Taylor /*
408*9e39c5baSBill Taylor  * Event poll ioctl message
409*9e39c5baSBill Taylor  */
410*9e39c5baSBill Taylor typedef struct dapl_event_poll_s {
411*9e39c5baSBill Taylor 	uint64_t		evp_evd_hkey;  /* EVD hash key		*/
412*9e39c5baSBill Taylor 	uint64_t		evp_timeout;   /* Timeout value		*/
413*9e39c5baSBill Taylor 	uint_t			evp_threshold; /* Threshold passed in	*/
414*9e39c5baSBill Taylor 	dapl_ib_event_t		*evp_ep;    /* array of events to be filled */
415*9e39c5baSBill Taylor 	uint_t			evp_num_ev; /* array sz, possbly > threshold */
416*9e39c5baSBill Taylor 	uint_t			evp_num_polled; /* number of elements filled */
417*9e39c5baSBill Taylor } dapl_event_poll_t;
418*9e39c5baSBill Taylor 
419*9e39c5baSBill Taylor /*
420*9e39c5baSBill Taylor  * Event poll ioctl message
421*9e39c5baSBill Taylor  */
422*9e39c5baSBill Taylor typedef struct dapl_event_poll32_s {
423*9e39c5baSBill Taylor 	uint64_t		evp_evd_hkey;  /* EVD hash key		*/
424*9e39c5baSBill Taylor 	uint64_t		evp_timeout;   /* Timeout value		*/
425*9e39c5baSBill Taylor 	uint_t			evp_threshold; /* Threshold passed in	*/
426*9e39c5baSBill Taylor 	caddr32_t		evp_ep;    /* array of events to be filled */
427*9e39c5baSBill Taylor 	uint_t			evp_num_ev; /* array sz, possbly > threshold */
428*9e39c5baSBill Taylor 	uint_t			evp_num_polled; /* number of elements filled */
429*9e39c5baSBill Taylor } dapl_event_poll32_t;
430*9e39c5baSBill Taylor 
431*9e39c5baSBill Taylor /*
432*9e39c5baSBill Taylor  * EVD hash key to wakeup
433*9e39c5baSBill Taylor  */
434*9e39c5baSBill Taylor typedef struct dapl_event_wakeup_s {
435*9e39c5baSBill Taylor 	uint64_t		evw_hkey;	/* EVD hash key */
436*9e39c5baSBill Taylor } dapl_event_wakeup_t;
437*9e39c5baSBill Taylor 
438*9e39c5baSBill Taylor /*
439*9e39c5baSBill Taylor  * modify EVD to CNO association
440*9e39c5baSBill Taylor  */
441*9e39c5baSBill Taylor typedef struct dapl_evd_modify_cno_s {
442*9e39c5baSBill Taylor 	uint64_t		evmc_hkey;	/* EVD hash key */
443*9e39c5baSBill Taylor 	uint64_t		evmc_cno_hkey;	/* new CNO hash key */
444*9e39c5baSBill Taylor } dapl_evd_modify_cno_t;
445*9e39c5baSBill Taylor 
446*9e39c5baSBill Taylor 
447*9e39c5baSBill Taylor /*
448*9e39c5baSBill Taylor  * EVD hash key to free
449*9e39c5baSBill Taylor  */
450*9e39c5baSBill Taylor typedef struct dapl_evd_free_s {
451*9e39c5baSBill Taylor 	uint64_t		evf_hkey;	/* EVD hash key */
452*9e39c5baSBill Taylor } dapl_evd_free_t;
453*9e39c5baSBill Taylor 
454*9e39c5baSBill Taylor /* MR ioctl interfaces */
455*9e39c5baSBill Taylor 
456*9e39c5baSBill Taylor /*
457*9e39c5baSBill Taylor  * MR register ioctl message
458*9e39c5baSBill Taylor  */
459*9e39c5baSBill Taylor typedef struct dapl_mr_register_s {
460*9e39c5baSBill Taylor 	uint64_t		mr_hkey;    /* MR hash key		 */
461*9e39c5baSBill Taylor 	uint64_t		mr_pd_hkey; /* PD hash key		 */
462*9e39c5baSBill Taylor 	ib_vaddr_t		mr_vaddr; /* Virtual address to register */
463*9e39c5baSBill Taylor 	ib_memlen_t		mr_len;	  /* Length of region to register */
464*9e39c5baSBill Taylor 	ibt_mr_flags_t		mr_flags;
465*9e39c5baSBill Taylor 	ibt_lkey_t		mr_lkey;  /* Lkey returned from mr_register */
466*9e39c5baSBill Taylor 	ibt_rkey_t		mr_rkey;  /* Rkey returned from mr_register */
467*9e39c5baSBill Taylor } dapl_mr_register_t;
468*9e39c5baSBill Taylor 
469*9e39c5baSBill Taylor /*
470*9e39c5baSBill Taylor  * Shared MR cookie
471*9e39c5baSBill Taylor  */
472*9e39c5baSBill Taylor typedef union dapl_mr_cookie_u {
473*9e39c5baSBill Taylor 	uint64_t		mc_uint_arr[5];
474*9e39c5baSBill Taylor 	uchar_t			mc_byte_arr[40];
475*9e39c5baSBill Taylor } dapl_mr_cookie_t;
476*9e39c5baSBill Taylor 
477*9e39c5baSBill Taylor /*
478*9e39c5baSBill Taylor  * Shared MR register ioctl message
479*9e39c5baSBill Taylor  */
480*9e39c5baSBill Taylor typedef struct dapl_mr_register_shared_s {
481*9e39c5baSBill Taylor 	uint64_t		mrs_hkey;    /* MR hash key		 */
482*9e39c5baSBill Taylor 	uint64_t		mrs_pd_hkey; /* PD hash key		 */
483*9e39c5baSBill Taylor 	ib_vaddr_t		mrs_vaddr; /* Virtual address to register */
484*9e39c5baSBill Taylor 	ib_memlen_t		mrs_len;   /* Length of region to register */
485*9e39c5baSBill Taylor 	ibt_mr_flags_t		mrs_flags;
486*9e39c5baSBill Taylor 	ibt_lkey_t		mrs_lkey;  /* Lkey returned from mr_register */
487*9e39c5baSBill Taylor 	ibt_rkey_t		mrs_rkey;  /* Rkey returned from mr_register */
488*9e39c5baSBill Taylor 	dapl_mr_cookie_t	mrs_shm_cookie; /* shared mem cookie */
489*9e39c5baSBill Taylor } dapl_mr_register_shared_t;
490*9e39c5baSBill Taylor 
491*9e39c5baSBill Taylor /*
492*9e39c5baSBill Taylor  * MR based MR register ioctl message
493*9e39c5baSBill Taylor  */
494*9e39c5baSBill Taylor typedef struct dapl_mr_register_lmr_s {
495*9e39c5baSBill Taylor 	uint64_t		mrl_hkey; /* MR hash key */
496*9e39c5baSBill Taylor 	uint64_t		mrl_orig_hkey; /* hash key of Original MR */
497*9e39c5baSBill Taylor 	ibt_mr_flags_t		mrl_flags;
498*9e39c5baSBill Taylor 	ibt_lkey_t		mrl_lkey; /* Lkey returned from mr_register */
499*9e39c5baSBill Taylor 	ibt_rkey_t		mrl_rkey; /* Rkey returned from mr_register */
500*9e39c5baSBill Taylor } dapl_mr_register_lmr_t;
501*9e39c5baSBill Taylor 
502*9e39c5baSBill Taylor /*
503*9e39c5baSBill Taylor  * MR deregister ioctl message
504*9e39c5baSBill Taylor  */
505*9e39c5baSBill Taylor typedef struct dapl_mr_deregister_s {
506*9e39c5baSBill Taylor 	uint64_t		mrd_hkey; /* MR hash key */
507*9e39c5baSBill Taylor } dapl_mr_deregister_t;
508*9e39c5baSBill Taylor 
509*9e39c5baSBill Taylor /*
510*9e39c5baSBill Taylor  * MR RDMA sync ioctl message
511*9e39c5baSBill Taylor  */
512*9e39c5baSBill Taylor 
513*9e39c5baSBill Taylor #define	DAPL_MR_PER_SYNC 16
514*9e39c5baSBill Taylor #define	DAPL_MR_SYNC_RDMA_RD 0
515*9e39c5baSBill Taylor #define	DAPL_MR_SYNC_RDMA_WR 1
516*9e39c5baSBill Taylor 
517*9e39c5baSBill Taylor typedef struct dapl_mr_sync_vec_s {
518*9e39c5baSBill Taylor 	uint64_t	mrsv_hkey;	/* MR hash key */
519*9e39c5baSBill Taylor 	uint64_t	mrsv_va;	/* MR sync virtual addr */
520*9e39c5baSBill Taylor 	uint64_t	mrsv_len;	/* MR sync length */
521*9e39c5baSBill Taylor } dapl_mr_sync_vec_t;
522*9e39c5baSBill Taylor 
523*9e39c5baSBill Taylor typedef struct dapl_mr_sync_s {
524*9e39c5baSBill Taylor 	uint32_t		mrs_flags;	/* MR sync direction */
525*9e39c5baSBill Taylor 	uint64_t		mrs_numseg;	/* number of MR's */
526*9e39c5baSBill Taylor 	dapl_mr_sync_vec_t 	mrs_vec[DAPL_MR_PER_SYNC]; /* sync elements */
527*9e39c5baSBill Taylor } dapl_mr_sync_t;
528*9e39c5baSBill Taylor 
529*9e39c5baSBill Taylor /* IA ioctl interfaces */
530*9e39c5baSBill Taylor 
531*9e39c5baSBill Taylor /*
532*9e39c5baSBill Taylor  * IA create ioctl message
533*9e39c5baSBill Taylor  */
534*9e39c5baSBill Taylor typedef struct dapl_ia_create_s {
535*9e39c5baSBill Taylor 	uint32_t		ia_version; /* ioctl interface version	*/
536*9e39c5baSBill Taylor 	ib_guid_t		ia_guid;    /* HCA guid			*/
537*9e39c5baSBill Taylor 	uint32_t		ia_port;    /* port number		*/
538*9e39c5baSBill Taylor 	uint32_t		ia_pkey;    /* pkey of the ibd instance */
539*9e39c5baSBill Taylor 	uint32_t		ia_resnum;  /* resource num in resrc table */
540*9e39c5baSBill Taylor 	uint8_t			ia_sadata[DAPL_ATS_NBYTES]; /* SA data record */
541*9e39c5baSBill Taylor } dapl_ia_create_t;
542*9e39c5baSBill Taylor 
543*9e39c5baSBill Taylor /*
544*9e39c5baSBill Taylor  * This structure is pretty much a copy of ibt_hca_attr_t but only
545*9e39c5baSBill Taylor  * relevant fields are present and the data types are such that
546*9e39c5baSBill Taylor  * its safe to use it in both in 32 and 64 bit libraries
547*9e39c5baSBill Taylor  * For detailed description refer to ibt_hca_attr_t in ibtl_types.h
548*9e39c5baSBill Taylor  */
549*9e39c5baSBill Taylor typedef struct dapl_hca_attr_s {
550*9e39c5baSBill Taylor 	uint32_t	dhca_vendor_id:24;
551*9e39c5baSBill Taylor 	uint16_t	dhca_device_id;
552*9e39c5baSBill Taylor 	uint32_t	dhca_version_id;
553*9e39c5baSBill Taylor 	uint_t		dhca_max_chans;
554*9e39c5baSBill Taylor 	uint_t		dhca_max_chan_sz;
555*9e39c5baSBill Taylor 	uint_t		dhca_max_sgl;
556*9e39c5baSBill Taylor 	uint_t		dhca_max_cq;
557*9e39c5baSBill Taylor 	uint_t		dhca_max_cq_sz;
558*9e39c5baSBill Taylor 	uint_t		dhca_max_memr;
559*9e39c5baSBill Taylor 	ib_memlen_t	dhca_max_memr_len;
560*9e39c5baSBill Taylor 	uint_t		dhca_max_mem_win;
561*9e39c5baSBill Taylor 	uint8_t		dhca_max_rdma_in_chan;
562*9e39c5baSBill Taylor 	uint8_t		dhca_max_rdma_out_chan;
563*9e39c5baSBill Taylor 	uint16_t	dhca_max_partitions;
564*9e39c5baSBill Taylor 	uint8_t		dhca_nports;
565*9e39c5baSBill Taylor 	ib_guid_t	dhca_node_guid;
566*9e39c5baSBill Taylor 	uint_t		dhca_max_pd;
567*9e39c5baSBill Taylor 	uint_t		dhca_max_srqs;
568*9e39c5baSBill Taylor 	uint_t		dhca_max_srqs_sz;
569*9e39c5baSBill Taylor 	uint_t		dhca_max_srq_sgl;
570*9e39c5baSBill Taylor } dapl_hca_attr_t;
571*9e39c5baSBill Taylor 
572*9e39c5baSBill Taylor /*
573*9e39c5baSBill Taylor  * IA query ioctl message
574*9e39c5baSBill Taylor  */
575*9e39c5baSBill Taylor typedef struct dapl_ia_query_s {
576*9e39c5baSBill Taylor 	dapl_hca_attr_t		hca_attr;
577*9e39c5baSBill Taylor } dapl_ia_query_t;
578*9e39c5baSBill Taylor 
579*9e39c5baSBill Taylor #define	DAPL_MAX_IA	64
580*9e39c5baSBill Taylor /*
581*9e39c5baSBill Taylor  * IA enum ioctl message
582*9e39c5baSBill Taylor  */
583*9e39c5baSBill Taylor typedef struct dapl_ia_enum_s {
584*9e39c5baSBill Taylor 	uint32_t		ia_count;	/* number of IAs */
585*9e39c5baSBill Taylor 	uint16_t		ia_devnum[DAPL_MAX_IA]; /* devnum of IAs */
586*9e39c5baSBill Taylor } dapl_ia_enum_t;
587*9e39c5baSBill Taylor 
588*9e39c5baSBill Taylor /* PD ioctl interfaces */
589*9e39c5baSBill Taylor 
590*9e39c5baSBill Taylor typedef struct dapl_pd_alloc_s {
591*9e39c5baSBill Taylor 	uint64_t		pda_hkey;
592*9e39c5baSBill Taylor } dapl_pd_alloc_t;
593*9e39c5baSBill Taylor 
594*9e39c5baSBill Taylor typedef struct dapl_pd_free_s {
595*9e39c5baSBill Taylor 	uint64_t		pdf_hkey;
596*9e39c5baSBill Taylor } dapl_pd_free_t;
597*9e39c5baSBill Taylor 
598*9e39c5baSBill Taylor /* MW ioctl interfaces */
599*9e39c5baSBill Taylor 
600*9e39c5baSBill Taylor typedef struct dapl_mw_alloc_s {
601*9e39c5baSBill Taylor 	uint64_t		mw_pd_hkey;
602*9e39c5baSBill Taylor 	uint64_t		mw_hkey;
603*9e39c5baSBill Taylor 	ibt_rkey_t		mw_rkey;
604*9e39c5baSBill Taylor } dapl_mw_alloc_t;
605*9e39c5baSBill Taylor 
606*9e39c5baSBill Taylor typedef struct dapl_mw_free_s {
607*9e39c5baSBill Taylor 	uint64_t		mw_hkey;
608*9e39c5baSBill Taylor } dapl_mw_free_t;
609*9e39c5baSBill Taylor 
610*9e39c5baSBill Taylor /* Passive Side ioctl interfaces */
611*9e39c5baSBill Taylor 
612*9e39c5baSBill Taylor /*
613*9e39c5baSBill Taylor  * Service register ioctl message
614*9e39c5baSBill Taylor  */
615*9e39c5baSBill Taylor typedef struct dapl_service_register_s {
616*9e39c5baSBill Taylor 	ib_svc_id_t		sr_sid;		/* Requested service id */
617*9e39c5baSBill Taylor 	uint64_t		sr_evd_hkey;	/* CR EVD hash key	*/
618*9e39c5baSBill Taylor 	uint64_t		sr_sp_hkey;	/* SP hash key		*/
619*9e39c5baSBill Taylor 	uint64_t		sr_sp_cookie;	/* Userland xSP ptr	*/
620*9e39c5baSBill Taylor 	ib_svc_id_t		sr_retsid;	/* Returned service id  */
621*9e39c5baSBill Taylor } dapl_service_register_t;
622*9e39c5baSBill Taylor 
623*9e39c5baSBill Taylor /*
624*9e39c5baSBill Taylor  * Service deregister ioctl message
625*9e39c5baSBill Taylor  */
626*9e39c5baSBill Taylor typedef struct dapl_service_deregister_s {
627*9e39c5baSBill Taylor 	uint64_t		sdr_sp_hkey;
628*9e39c5baSBill Taylor } dapl_service_deregister_t;
629*9e39c5baSBill Taylor 
630*9e39c5baSBill Taylor /*
631*9e39c5baSBill Taylor  * Connection request accept ioctl message
632*9e39c5baSBill Taylor  */
633*9e39c5baSBill Taylor typedef struct dapl_cr_accept_s {
634*9e39c5baSBill Taylor 	uint64_t	cra_sp_hkey;	/* xSP hash key */
635*9e39c5baSBill Taylor 	uint64_t	cra_ep_hkey;	/* EP hash key */
636*9e39c5baSBill Taylor 	uint64_t	cra_bkl_cookie;	/* CR timestamp + SP backlog index */
637*9e39c5baSBill Taylor 	uint32_t	cra_priv_sz;	/* private data and size */
638*9e39c5baSBill Taylor 	uchar_t		cra_priv[DAPL_MAX_PRIVATE_DATA_SIZE];
639*9e39c5baSBill Taylor } dapl_cr_accept_t;
640*9e39c5baSBill Taylor 
641*9e39c5baSBill Taylor /*
642*9e39c5baSBill Taylor  * Connection request reject ioctl message
643*9e39c5baSBill Taylor  */
644*9e39c5baSBill Taylor typedef struct dapl_cr_reject_s {
645*9e39c5baSBill Taylor 	uint64_t	crr_sp_hkey;	/* xSP hash key */
646*9e39c5baSBill Taylor 	uint64_t	crr_bkl_cookie;  /* CR timestamp + SP backlog index */
647*9e39c5baSBill Taylor 	int		crr_reason;	/* Reason for rejecting the CR */
648*9e39c5baSBill Taylor } dapl_cr_reject_t;
649*9e39c5baSBill Taylor 
650*9e39c5baSBill Taylor /*
651*9e39c5baSBill Taylor  * Connection request handoff ioctl message
652*9e39c5baSBill Taylor  */
653*9e39c5baSBill Taylor typedef struct dapl_cr_handoff_s {
654*9e39c5baSBill Taylor 	uint64_t	crh_sp_hkey;	/* xSP hash key */
655*9e39c5baSBill Taylor 	uint64_t	crh_bkl_cookie;  /* CR timestamp + SP backlog index */
656*9e39c5baSBill Taylor 	ib_svc_id_t	crh_conn_qual;  /* Service id of destination SP */
657*9e39c5baSBill Taylor } dapl_cr_handoff_t;
658*9e39c5baSBill Taylor 
659*9e39c5baSBill Taylor /* CNO ioctl interfaces */
660*9e39c5baSBill Taylor 
661*9e39c5baSBill Taylor /*
662*9e39c5baSBill Taylor  * CNO alloc ioctl message
663*9e39c5baSBill Taylor  */
664*9e39c5baSBill Taylor typedef struct dapl_cno_alloc_s {
665*9e39c5baSBill Taylor 	uint64_t	cno_hkey;	/* CNO hash key */
666*9e39c5baSBill Taylor } dapl_cno_alloc_t;
667*9e39c5baSBill Taylor 
668*9e39c5baSBill Taylor /*
669*9e39c5baSBill Taylor  * CNO free ioctl message
670*9e39c5baSBill Taylor  */
671*9e39c5baSBill Taylor typedef struct dapl_cno_free_s {
672*9e39c5baSBill Taylor 	uint64_t	cnf_hkey;	/* CNO hash key */
673*9e39c5baSBill Taylor } dapl_cno_free_t;
674*9e39c5baSBill Taylor 
675*9e39c5baSBill Taylor /*
676*9e39c5baSBill Taylor  * CNO wait ioctl message
677*9e39c5baSBill Taylor  */
678*9e39c5baSBill Taylor typedef struct dapl_cno_wait_s {
679*9e39c5baSBill Taylor 	uint64_t	cnw_hkey;	/* CNO hash key */
680*9e39c5baSBill Taylor 	uint64_t	cnw_timeout;	/* CNO timeout */
681*9e39c5baSBill Taylor 	uint64_t	cnw_evd_cookie;
682*9e39c5baSBill Taylor } dapl_cno_wait_t;
683*9e39c5baSBill Taylor 
684*9e39c5baSBill Taylor /*
685*9e39c5baSBill Taylor  * SRQ related structures
686*9e39c5baSBill Taylor  */
687*9e39c5baSBill Taylor typedef struct dapl_srq_sizes_s {
688*9e39c5baSBill Taylor 	uint_t	srqs_sz;
689*9e39c5baSBill Taylor 	uint_t	srqs_sgl;
690*9e39c5baSBill Taylor } dapl_srq_sizes_t;
691*9e39c5baSBill Taylor 
692*9e39c5baSBill Taylor /*
693*9e39c5baSBill Taylor  * SRQ create ioctl message
694*9e39c5baSBill Taylor  */
695*9e39c5baSBill Taylor typedef struct dapl_srq_create_s {
696*9e39c5baSBill Taylor 	uint64_t		srqc_pd_hkey;	/* hash key of the assoc PD */
697*9e39c5baSBill Taylor 	dapl_srq_sizes_t	srqc_sizes;	/* Requested SRQ params	*/
698*9e39c5baSBill Taylor 	uint64_t		srqc_hkey;	/* hash key of allocated SRQ */
699*9e39c5baSBill Taylor 	dapl_srq_sizes_t	srqc_real_sizes; /* Allocated SRQ params */
700*9e39c5baSBill Taylor 	dapl_srq_data_out_t	srqc_data_out;
701*9e39c5baSBill Taylor } dapl_srq_create_t;
702*9e39c5baSBill Taylor 
703*9e39c5baSBill Taylor /*
704*9e39c5baSBill Taylor  * SRQ resize ioctl message
705*9e39c5baSBill Taylor  */
706*9e39c5baSBill Taylor typedef struct dapl_srq_resize_s {
707*9e39c5baSBill Taylor 	uint64_t		srqr_hkey;	/* hash key of the SRQ */
708*9e39c5baSBill Taylor 	uint32_t		srqr_new_size;	/* New SRQ size		*/
709*9e39c5baSBill Taylor 	uint32_t		srqr_real_size; /* Actual SRQ size	*/
710*9e39c5baSBill Taylor 	dapl_srq_data_out_t	srqr_data_out;
711*9e39c5baSBill Taylor } dapl_srq_resize_t;
712*9e39c5baSBill Taylor 
713*9e39c5baSBill Taylor /*
714*9e39c5baSBill Taylor  * SRQ free ioctl message
715*9e39c5baSBill Taylor  */
716*9e39c5baSBill Taylor typedef struct dapl_srq_free_s {
717*9e39c5baSBill Taylor 	uint64_t	srqf_hkey; /* hash key of the SRQ being freed */
718*9e39c5baSBill Taylor } dapl_srq_free_t;
719*9e39c5baSBill Taylor 
720*9e39c5baSBill Taylor #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
721*9e39c5baSBill Taylor #pragma pack()
722*9e39c5baSBill Taylor #endif
723*9e39c5baSBill Taylor 
724*9e39c5baSBill Taylor #ifdef __cplusplus
725*9e39c5baSBill Taylor }
726*9e39c5baSBill Taylor #endif
727*9e39c5baSBill Taylor 
728*9e39c5baSBill Taylor #endif	/* _DAPL_IF_H_ */