1 /*
2  * This file contains definitions used in the OFED defined user/kernel
3  * interfaces. These are imported from the OFED headers ib_mad.h, ib_cm.h
4  * and ib_sa.h. Oracle elects to have and use the contents of these headers
5  * under and governed  by the OpenIB.org BSD license (see below for full
6  * license text). However, the following notice accompanied the original
7  * version of these files:
8  */
9 
10 /* ib_mad.h */
11 
12 /*
13  * Copyright (c) 2004 Mellanox Technologies Ltd.  All rights reserved.
14  * Copyright (c) 2004 Infinicon Corporation.  All rights reserved.
15  * Copyright (c) 2004 Intel Corporation.  All rights reserved.
16  * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
17  * Copyright (c) 2004-2006 Voltaire Corporation.  All rights reserved.
18  *
19  * This software is available to you under a choice of one of two
20  * licenses.  You may choose to be licensed under the terms of the GNU
21  * General Public License (GPL) Version 2, available from the file
22  * COPYING in the main directory of this source tree, or the
23  * OpenIB.org BSD license below:
24  *
25  *     Redistribution and use in source and binary forms, with or
26  *     without modification, are permitted provided that the following
27  *     conditions are met:
28  *
29  *      - Redistributions of source code must retain the above
30  *        copyright notice, this list of conditions and the following
31  *        disclaimer.
32  *
33  *      - Redistributions in binary form must reproduce the above
34  *        copyright notice, this list of conditions and the following
35  *        disclaimer in the documentation and/or other materials
36  *        provided with the distribution.
37  *
38  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
42  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
43  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45  * SOFTWARE.
46  */
47 
48 /* ib_cm.h */
49 
50 /*
51  * Copyright (c) 2004, 2005 Intel Corporation.  All rights reserved.
52  * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
53  * Copyright (c) 2004 Voltaire Corporation.  All rights reserved.
54  * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
55  *
56  * This software is available to you under a choice of one of two
57  * licenses.  You may choose to be licensed under the terms of the GNU
58  * General Public License (GPL) Version 2, available from the file
59  * COPYING in the main directory of this source tree, or the
60  * OpenIB.org BSD license below:
61  *
62  *     Redistribution and use in source and binary forms, with or
63  *     without modification, are permitted provided that the following
64  *     conditions are met:
65  *
66  *      - Redistributions of source code must retain the above
67  *        copyright notice, this list of conditions and the following
68  *        disclaimer.
69  *
70  *      - Redistributions in binary form must reproduce the above
71  *        copyright notice, this list of conditions and the following
72  *        disclaimer in the documentation and/or other materials
73  *        provided with the distribution.
74  *
75  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
76  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
77  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
78  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
79  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
80  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
81  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
82  * SOFTWARE.
83  */
84 
85 /* ib_sa.h */
86 
87 /*
88  * Copyright (c) 2004 Topspin Communications.  All rights reserved.
89  * Copyright (c) 2005 Voltaire, Inc.  All rights reserved.
90  * Copyright (c) 2006 Intel Corporation.  All rights reserved.
91  *
92  * This software is available to you under a choice of one of two
93  * licenses.  You may choose to be licensed under the terms of the GNU
94  * General Public License (GPL) Version 2, available from the file
95  * COPYING in the main directory of this source tree, or the
96  * OpenIB.org BSD license below:
97  *
98  *     Redistribution and use in source and binary forms, with or
99  *     without modification, are permitted provided that the following
100  *     conditions are met:
101  *
102  *      - Redistributions of source code must retain the above
103  *        copyright notice, this list of conditions and the following
104  *        disclaimer.
105  *
106  *      - Redistributions in binary form must reproduce the above
107  *        copyright notice, this list of conditions and the following
108  *        disclaimer in the documentation and/or other materials
109  *        provided with the distribution.
110  *
111  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
112  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
113  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
114  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
115  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
116  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
117  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
118  * SOFTWARE.
119  */
120 #ifndef _SYS_IB_CLIENTS_OF_OFED_KERNEL_H
121 #define	_SYS_IB_CLIENTS_OF_OFED_KERNEL_H
122 #ifdef __cplusplus
123 extern "C" {
124 #endif
125 
126 #include <sys/ib/clients/of/ofa_solaris.h>
127 #include <sys/ib/clients/of/rdma/ib_verbs.h>
128 #include <sys/ib/clients/of/rdma/ib_user_verbs.h>
129 #include <sys/ib/clients/of/rdma/ib_user_mad.h>
130 
131 
132 /*
133  * From ib_mad.h
134  */
135 enum {
136 	IB_MGMT_MAD_HDR = 24,
137 	IB_MGMT_MAD_DATA = 232,
138 	IB_MGMT_RMPP_HDR = 36,
139 	IB_MGMT_RMPP_DATA = 220,
140 	IB_MGMT_VENDOR_HDR = 40,
141 	IB_MGMT_VENDOR_DATA = 216,
142 	IB_MGMT_SA_HDR = 56,
143 	IB_MGMT_SA_DATA = 200,
144 	IB_MGMT_DEVICE_HDR = 64,
145 	IB_MGMT_DEVICE_DATA = 192,
146 	IB_MGMT_SNMP_HDR = 56,
147 	IB_MGMT_SNMP_DATA = 64,
148 };
149 
150 /*
151  * From ib_cm.h
152  */
153 enum ib_cm_sidr_status {
154 	IB_SIDR_SUCCESS,
155 	IB_SIDR_UNSUPPORTED,
156 	IB_SIDR_REJECT,
157 	IB_SIDR_NO_QP,
158 	IB_SIDR_REDIRECT,
159 	IB_SIDR_UNSUPPORTED_VERSION
160 };
161 
162 /*
163  * From ib_sa.h
164  */
165 struct ib_sa_path_rec {
166 	uint64_t	service_id;
167 	union ib_gid	dgid;
168 	union ib_gid	sgid;
169 	uint16_t	dlid;
170 	uint16_t	slid;
171 	int		raw_traffic;
172 	/* reserved */
173 	uint32_t	flow_label;
174 	uint8_t		hop_limit;
175 	uint8_t		traffic_class;
176 	int		reversible;
177 	uint8_t		numb_path;
178 	uint16_t	pkey;
179 	uint16_t	qos_class;
180 	uint8_t		sl;
181 	uint8_t		mtu_selector;
182 	uint8_t		mtu;
183 	uint8_t		rate_selector;
184 	uint8_t		rate;
185 	uint8_t		packet_life_time_selector;
186 	uint8_t		packet_life_time;
187 	uint8_t		preference;
188 };
189 
190 #ifdef __cplusplus
191 }
192 #endif
193 #endif /* _SYS_IB_CLIENTS_OF_OFED_KERNEL_H */
194