1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 /*
27  * This header file contains definations for APIs which are exported by
28  * sol_uverbs for use by sol_ucma
29  */
30 #ifndef	_SYS_IB_CLIENTS_OF_SOL_UVERBS_SOL_UVERBS2UCMA_H
31 #define	_SYS_IB_CLIENTS_OF_SOL_UVERBS_SOL_UVERBS2UCMA_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define	SOL_UCMA_UVERBS_PATH	"/ib/sol_uverbs@0:ucma"
38 
39 /*
40  * This API returns the IB & iWARP client handles that sol_uverbs uses
41  * to interact with Solaris IBTF and iWARP frameworks.
42  */
43 #define	SOL_UVERBS_GET_CLNT_HDL	"sol_uverbs_get_clnt_hdl"
44 typedef void	(*uverbs_get_clnt_hdl_t) (void **, void **);
45 
46 /*
47  * This API returns the QP handle used by Solaris IBTF / iWARP framework
48  * for an QP. The QP number is the input for this API. NULL is returned
49  * for QP not allocated by sol_uverbs.
50  */
51 #define	SOL_UVERBS_QPNUM2QPHDL	"sol_uverbs_qpnum2qphdl"
52 typedef void	*(*uverbs_qpnum2qphdl_t) (uint32_t);
53 
54 /*
55  * This API disables user QP modifies for an QP specified by the input
56  * QP number. It returns 0 on succcess and non-0 on failure.
57  */
58 #define	SOL_UVERBS_DISABLE_UQPN_MODIFY	"sol_uverbs_disable_uqpn_modify"
59 typedef int	(*uverbs_disable_uqpn_mod_t)(uint32_t);
60 
61 /*
62  * This API enables / disables CQ notification for all CQs assosiated
63  * with the QP. This is done to ensure that the first completion event
64  * is send to userland *after* connection is established.
65  */
66 typedef enum {
67 	SOL_UVERBS2UCMA_CQ_NOTIFY_NOT_SET = 0,
68 	SOL_UVERBS2UCMA_CQ_NOTIFY_ENABLE,
69 	SOL_UVERBS2UCMA_CQ_NOTIFY_DISABLE
70 } sol_uverbs_cq_ctrl_t;
71 #define	SOL_UVERBS_UQPN_CQ_CTRL	"sol_uverbs_uqpn_cq_ctrl"
72 typedef int	(*uverbs_uqpn_cq_ctrl_t)(uint32_t, sol_uverbs_cq_ctrl_t);
73 
74 /*
75  * This API sets the QP free state. The uint32_t uqpid is passed for
76  * disabling QP free and void *qphdl is passed for enabling QP free.
77  */
78 typedef enum {
79 	SOL_UVERBS2UCMA_ENABLE_QP_FREE,
80 	SOL_UVERBS2UCMA_DISABLE_QP_FREE,
81 	SOL_UVERBS2UCMA_FREE_PENDING
82 } sol_uverbs_qp_free_state_t;
83 #define	SOL_UVERBS_SET_QPFREE_STATE	"sol_uverbs_set_qp_free_state"
84 typedef void	(*uverbs_set_qp_free_state_t)(sol_uverbs_qp_free_state_t,
85     uint32_t, void *);
86 
87 /*
88  * This API flushes the QP specified by the QP num
89  */
90 #define	SOL_UVERBS_FLUSH_QP		"sol_uverbs_flush_qp"
91 typedef void	(*uverbs_flush_qp_t)(uint32_t);
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* _SYS_IB_CLIENTS_OF_SOL_UVERBS_SOL_UVERBS2UCMA_H */
98