2 * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
3 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 #if !defined(__IB_CM_TYPES_H__)
37 #define __IB_CM_TYPES_H__
41 #include <iba/ib_types.h>
44 # define BEGIN_C_DECLS extern "C" {
45 # define END_C_DECLS }
46 #else /* !__cplusplus */
47 # define BEGIN_C_DECLS
49 #endif /* __cplusplus */
53 * Defines known Communication management class versions
55 #define IB_MCLASS_CM_VER_2 2
56 #define IB_MCLASS_CM_VER_1 1
58 * Defines the size of user available data in communication management MADs
60 #define IB_REQ_PDATA_SIZE_VER2 92
61 #define IB_MRA_PDATA_SIZE_VER2 222
62 #define IB_REJ_PDATA_SIZE_VER2 148
63 #define IB_REP_PDATA_SIZE_VER2 196
64 #define IB_RTU_PDATA_SIZE_VER2 224
65 #define IB_LAP_PDATA_SIZE_VER2 168
66 #define IB_APR_PDATA_SIZE_VER2 148
67 #define IB_DREQ_PDATA_SIZE_VER2 220
68 #define IB_DREP_PDATA_SIZE_VER2 224
69 #define IB_SIDR_REQ_PDATA_SIZE_VER2 216
70 #define IB_SIDR_REP_PDATA_SIZE_VER2 136
71 #define IB_REQ_PDATA_SIZE_VER1 92
72 #define IB_MRA_PDATA_SIZE_VER1 222
73 #define IB_REJ_PDATA_SIZE_VER1 148
74 #define IB_REP_PDATA_SIZE_VER1 204
75 #define IB_RTU_PDATA_SIZE_VER1 224
76 #define IB_LAP_PDATA_SIZE_VER1 168
77 #define IB_APR_PDATA_SIZE_VER1 151
78 #define IB_DREQ_PDATA_SIZE_VER1 220
79 #define IB_DREP_PDATA_SIZE_VER1 224
80 #define IB_SIDR_REQ_PDATA_SIZE_VER1 216
81 #define IB_SIDR_REP_PDATA_SIZE_VER1 140
82 #define IB_ARI_SIZE 72 // redefine
83 #define IB_APR_INFO_SIZE 72
84 /****d* Access Layer/ib_rej_status_t
93 typedef ib_net16_t ib_rej_status_t;
96 * ib_cm_rej, ib_cm_rej_rec_t
100 #define IB_REJ_INSUF_QP CL_HTON16(1)
101 #define IB_REJ_INSUF_EEC CL_HTON16(2)
102 #define IB_REJ_INSUF_RESOURCES CL_HTON16(3)
103 #define IB_REJ_TIMEOUT CL_HTON16(4)
104 #define IB_REJ_UNSUPPORTED CL_HTON16(5)
105 #define IB_REJ_INVALID_COMM_ID CL_HTON16(6)
106 #define IB_REJ_INVALID_COMM_INSTANCE CL_HTON16(7)
107 #define IB_REJ_INVALID_SID CL_HTON16(8)
108 #define IB_REJ_INVALID_XPORT CL_HTON16(9)
109 #define IB_REJ_STALE_CONN CL_HTON16(10)
110 #define IB_REJ_RDC_NOT_EXIST CL_HTON16(11)
111 #define IB_REJ_INVALID_GID CL_HTON16(12)
112 #define IB_REJ_INVALID_LID CL_HTON16(13)
113 #define IB_REJ_INVALID_SL CL_HTON16(14)
114 #define IB_REJ_INVALID_TRAFFIC_CLASS CL_HTON16(15)
115 #define IB_REJ_INVALID_HOP_LIMIT CL_HTON16(16)
116 #define IB_REJ_INVALID_PKT_RATE CL_HTON16(17)
117 #define IB_REJ_INVALID_ALT_GID CL_HTON16(18)
118 #define IB_REJ_INVALID_ALT_LID CL_HTON16(19)
119 #define IB_REJ_INVALID_ALT_SL CL_HTON16(20)
120 #define IB_REJ_INVALID_ALT_TRAFFIC_CLASS CL_HTON16(21)
121 #define IB_REJ_INVALID_ALT_HOP_LIMIT CL_HTON16(22)
122 #define IB_REJ_INVALID_ALT_PKT_RATE CL_HTON16(23)
123 #define IB_REJ_PORT_REDIRECT CL_HTON16(24)
124 #define IB_REJ_INVALID_MTU CL_HTON16(26)
125 #define IB_REJ_INSUFFICIENT_RESP_RES CL_HTON16(27)
126 #define IB_REJ_USER_DEFINED CL_HTON16(28)
127 #define IB_REJ_INVALID_RNR_RETRY CL_HTON16(29)
128 #define IB_REJ_DUPLICATE_LOCAL_COMM_ID CL_HTON16(30)
129 #define IB_REJ_INVALID_CLASS_VER CL_HTON16(31)
130 #define IB_REJ_INVALID_FLOW_LBL CL_HTON16(32)
131 #define IB_REJ_INVALID_ALT_FLOW_LBL CL_HTON16(33)
133 #define IB_REJ_SERVICE_HANDOFF CL_HTON16(65535)
136 /****d* Access Layer/ib_apr_status_t
141 * Automatic path migration status information.
145 typedef uint8_t ib_apr_status_t;
148 * ib_cm_apr, ib_cm_apr_rec_t
152 #define IB_AP_SUCCESS 0
153 #define IB_AP_INVALID_COMM_ID 1
154 #define IB_AP_UNSUPPORTED 2
155 #define IB_AP_REJECT 3
156 #define IB_AP_REDIRECT 4
157 #define IB_AP_IS_CURRENT 5
158 #define IB_AP_INVALID_QPN_EECN 6
159 #define IB_AP_INVALID_LID 7
160 #define IB_AP_INVALID_GID 8
161 #define IB_AP_INVALID_FLOW_LBL 9
162 #define IB_AP_INVALID_TCLASS 10
163 #define IB_AP_INVALID_HOP_LIMIT 11
164 #define IB_AP_INVALID_PKT_RATE 12
165 #define IB_AP_INVALID_SL 13
168 /****d* Access Layer/ib_cm_cap_mask_t
173 * Capability mask values in ClassPortInfo.
177 #define IB_CM_RELIABLE_CONN_CAPABLE CL_HTON16(9)
178 #define IB_CM_RELIABLE_DGRM_CAPABLE CL_HTON16(10)
179 #define IB_CM_RDGRM_CAPABLE CL_HTON16(11)
180 #define IB_CM_UNRELIABLE_CONN_CAPABLE CL_HTON16(12)
181 #define IB_CM_SIDR_CAPABLE CL_HTON16(13)
184 * ib_cm_rep, ib_class_port_info_t
191 * Service ID resolution status
193 typedef uint16_t ib_sidr_status_t;
194 #define IB_SIDR_SUCCESS 0
195 #define IB_SIDR_UNSUPPORTED 1
196 #define IB_SIDR_REJECT 2
197 #define IB_SIDR_NO_QP 3
198 #define IB_SIDR_REDIRECT 4
199 #define IB_SIDR_UNSUPPORTED_VER 5
202 #endif /* ndef WIN32 */
203 #endif /* __IB_CM_TYPES_H__ */