xref: /freebsd/contrib/ofed/libibmad/mad.h (revision 87181516ef48be852d5e5fee53c6e0dbfc62f21e)
1*d6b92ffaSHans Petter Selasky /*
2*d6b92ffaSHans Petter Selasky  * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
3*d6b92ffaSHans Petter Selasky  * Copyright (c) 2009 HNR Consulting.  All rights reserved.
4*d6b92ffaSHans Petter Selasky  * Copyright (c) 2009-2011 Mellanox Technologies LTD.  All rights reserved.
5*d6b92ffaSHans Petter Selasky  *
6*d6b92ffaSHans Petter Selasky  * This software is available to you under a choice of one of two
7*d6b92ffaSHans Petter Selasky  * licenses.  You may choose to be licensed under the terms of the GNU
8*d6b92ffaSHans Petter Selasky  * General Public License (GPL) Version 2, available from the file
9*d6b92ffaSHans Petter Selasky  * COPYING in the main directory of this source tree, or the
10*d6b92ffaSHans Petter Selasky  * OpenIB.org BSD license below:
11*d6b92ffaSHans Petter Selasky  *
12*d6b92ffaSHans Petter Selasky  *     Redistribution and use in source and binary forms, with or
13*d6b92ffaSHans Petter Selasky  *     without modification, are permitted provided that the following
14*d6b92ffaSHans Petter Selasky  *     conditions are met:
15*d6b92ffaSHans Petter Selasky  *
16*d6b92ffaSHans Petter Selasky  *      - Redistributions of source code must retain the above
17*d6b92ffaSHans Petter Selasky  *        copyright notice, this list of conditions and the following
18*d6b92ffaSHans Petter Selasky  *        disclaimer.
19*d6b92ffaSHans Petter Selasky  *
20*d6b92ffaSHans Petter Selasky  *      - Redistributions in binary form must reproduce the above
21*d6b92ffaSHans Petter Selasky  *        copyright notice, this list of conditions and the following
22*d6b92ffaSHans Petter Selasky  *        disclaimer in the documentation and/or other materials
23*d6b92ffaSHans Petter Selasky  *        provided with the distribution.
24*d6b92ffaSHans Petter Selasky  *
25*d6b92ffaSHans Petter Selasky  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26*d6b92ffaSHans Petter Selasky  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27*d6b92ffaSHans Petter Selasky  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28*d6b92ffaSHans Petter Selasky  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29*d6b92ffaSHans Petter Selasky  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30*d6b92ffaSHans Petter Selasky  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31*d6b92ffaSHans Petter Selasky  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32*d6b92ffaSHans Petter Selasky  * SOFTWARE.
33*d6b92ffaSHans Petter Selasky  *
34*d6b92ffaSHans Petter Selasky  */
35*d6b92ffaSHans Petter Selasky #ifndef _MAD_H_
36*d6b92ffaSHans Petter Selasky #define _MAD_H_
37*d6b92ffaSHans Petter Selasky 
38*d6b92ffaSHans Petter Selasky #include <infiniband/mad_osd.h>
39*d6b92ffaSHans Petter Selasky 
40*d6b92ffaSHans Petter Selasky #ifdef __cplusplus
41*d6b92ffaSHans Petter Selasky #  define BEGIN_C_DECLS extern "C" {
42*d6b92ffaSHans Petter Selasky #  define END_C_DECLS   }
43*d6b92ffaSHans Petter Selasky #else				/* !__cplusplus */
44*d6b92ffaSHans Petter Selasky #  define BEGIN_C_DECLS
45*d6b92ffaSHans Petter Selasky #  define END_C_DECLS
46*d6b92ffaSHans Petter Selasky #endif				/* __cplusplus */
47*d6b92ffaSHans Petter Selasky 
48*d6b92ffaSHans Petter Selasky BEGIN_C_DECLS
49*d6b92ffaSHans Petter Selasky #define IB_MAD_RPC_VERSION_MASK	0x0f00
50*d6b92ffaSHans Petter Selasky #define IB_MAD_RPC_VERSION1	(1<<8)
51*d6b92ffaSHans Petter Selasky 
52*d6b92ffaSHans Petter Selasky #define IB_SUBNET_PATH_HOPS_MAX	64
53*d6b92ffaSHans Petter Selasky #define IB_DEFAULT_SUBN_PREFIX	0xfe80000000000000ULL
54*d6b92ffaSHans Petter Selasky #define IB_DEFAULT_QP1_QKEY	0x80010000
55*d6b92ffaSHans Petter Selasky #define IB_MAD_SIZE		256
56*d6b92ffaSHans Petter Selasky #define IB_SMP_DATA_OFFS	64
57*d6b92ffaSHans Petter Selasky #define IB_SMP_DATA_SIZE	64
58*d6b92ffaSHans Petter Selasky #define IB_VENDOR_RANGE1_DATA_OFFS	24
59*d6b92ffaSHans Petter Selasky #define IB_VENDOR_RANGE1_DATA_SIZE	(IB_MAD_SIZE - IB_VENDOR_RANGE1_DATA_OFFS)
60*d6b92ffaSHans Petter Selasky #define IB_VENDOR_RANGE2_DATA_OFFS	40
61*d6b92ffaSHans Petter Selasky #define IB_VENDOR_RANGE2_DATA_SIZE	(IB_MAD_SIZE - IB_VENDOR_RANGE2_DATA_OFFS)
62*d6b92ffaSHans Petter Selasky #define IB_SA_DATA_SIZE		200
63*d6b92ffaSHans Petter Selasky #define IB_SA_DATA_OFFS		56
64*d6b92ffaSHans Petter Selasky #define IB_PC_DATA_OFFS		64
65*d6b92ffaSHans Petter Selasky #define IB_PC_DATA_SZ		(IB_MAD_SIZE - IB_PC_DATA_OFFS)
66*d6b92ffaSHans Petter Selasky #define IB_SA_MCM_RECSZ		53
67*d6b92ffaSHans Petter Selasky #define IB_SA_PR_RECSZ		64
68*d6b92ffaSHans Petter Selasky #define IB_SA_NR_RECSZ		108
69*d6b92ffaSHans Petter Selasky #define IB_SA_GIR_RECSZ		72
70*d6b92ffaSHans Petter Selasky #define IB_BM_DATA_OFFS		64
71*d6b92ffaSHans Petter Selasky #define IB_BM_DATA_SZ		(IB_MAD_SIZE - IB_BM_DATA_OFFS)
72*d6b92ffaSHans Petter Selasky #define IB_BM_BKEY_OFFS		24
73*d6b92ffaSHans Petter Selasky #define IB_BM_BKEY_AND_DATA_SZ	(IB_MAD_SIZE - IB_BM_BKEY_OFFS)
74*d6b92ffaSHans Petter Selasky #define IB_CC_DATA_OFFS         64
75*d6b92ffaSHans Petter Selasky #define IB_CC_DATA_SZ           (IB_MAD_SIZE - IB_CC_DATA_OFFS)
76*d6b92ffaSHans Petter Selasky #define IB_CC_LOG_DATA_OFFS     32
77*d6b92ffaSHans Petter Selasky #define IB_CC_LOG_DATA_SZ       (IB_MAD_SIZE - IB_CC_LOG_DATA_OFFS)
78*d6b92ffaSHans Petter Selasky 
79*d6b92ffaSHans Petter Selasky enum MAD_CLASSES {
80*d6b92ffaSHans Petter Selasky 	IB_SMI_CLASS = 0x1,
81*d6b92ffaSHans Petter Selasky 	IB_SMI_DIRECT_CLASS = 0x81,
82*d6b92ffaSHans Petter Selasky 	IB_SA_CLASS = 0x3,
83*d6b92ffaSHans Petter Selasky 	IB_PERFORMANCE_CLASS = 0x4,
84*d6b92ffaSHans Petter Selasky 	IB_BOARD_MGMT_CLASS = 0x5,
85*d6b92ffaSHans Petter Selasky 	IB_DEVICE_MGMT_CLASS = 0x6,
86*d6b92ffaSHans Petter Selasky 	IB_CM_CLASS = 0x7,
87*d6b92ffaSHans Petter Selasky 	IB_SNMP_CLASS = 0x8,
88*d6b92ffaSHans Petter Selasky 	IB_VENDOR_RANGE1_START_CLASS = 0x9,
89*d6b92ffaSHans Petter Selasky 	IB_VENDOR_RANGE1_END_CLASS = 0x0f,
90*d6b92ffaSHans Petter Selasky 	IB_CC_CLASS = 0x21,
91*d6b92ffaSHans Petter Selasky 	IB_VENDOR_RANGE2_START_CLASS = 0x30,
92*d6b92ffaSHans Petter Selasky 	IB_VENDOR_RANGE2_END_CLASS = 0x4f,
93*d6b92ffaSHans Petter Selasky };
94*d6b92ffaSHans Petter Selasky 
95*d6b92ffaSHans Petter Selasky enum MAD_METHODS {
96*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET = 0x1,
97*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_SET = 0x2,
98*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET_RESPONSE = 0x81,
99*d6b92ffaSHans Petter Selasky 
100*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_SEND = 0x3,
101*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_TRAP = 0x5,
102*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_TRAP_REPRESS = 0x7,
103*d6b92ffaSHans Petter Selasky 
104*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_REPORT = 0x6,
105*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_REPORT_RESPONSE = 0x86,
106*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET_TABLE = 0x12,
107*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET_TABLE_RESPONSE = 0x92,
108*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET_TRACE_TABLE = 0x13,
109*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GET_TRACE_TABLE_RESPONSE = 0x93,
110*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GETMULTI = 0x14,
111*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_GETMULTI_RESPONSE = 0x94,
112*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_DELETE = 0x15,
113*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_DELETE_RESPONSE = 0x95,
114*d6b92ffaSHans Petter Selasky 
115*d6b92ffaSHans Petter Selasky 	IB_MAD_RESPONSE = 0x80,
116*d6b92ffaSHans Petter Selasky };
117*d6b92ffaSHans Petter Selasky 
118*d6b92ffaSHans Petter Selasky enum MAD_ATTR_ID {
119*d6b92ffaSHans Petter Selasky 	CLASS_PORT_INFO = 0x1,
120*d6b92ffaSHans Petter Selasky 	NOTICE = 0x2,
121*d6b92ffaSHans Petter Selasky 	INFORM_INFO = 0x3,
122*d6b92ffaSHans Petter Selasky };
123*d6b92ffaSHans Petter Selasky 
124*d6b92ffaSHans Petter Selasky enum MAD_STATUS {
125*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_OK = (0 << 2),
126*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_BUSY = (1 << 0),
127*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_REDIRECT = (1 << 1),
128*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_BAD_BASE_VER_OR_CLASS = (1 << 2),
129*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_METHOD_NOT_SUPPORTED = (2 << 2),
130*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_METHOD_ATTR_NOT_SUPPORTED = (3 << 2),
131*d6b92ffaSHans Petter Selasky 	IB_MAD_STS_INV_ATTR_VALUE = (7 << 2),
132*d6b92ffaSHans Petter Selasky };
133*d6b92ffaSHans Petter Selasky 
134*d6b92ffaSHans Petter Selasky enum SMI_ATTR_ID {
135*d6b92ffaSHans Petter Selasky 	IB_ATTR_NODE_DESC = 0x10,
136*d6b92ffaSHans Petter Selasky 	IB_ATTR_NODE_INFO = 0x11,
137*d6b92ffaSHans Petter Selasky 	IB_ATTR_SWITCH_INFO = 0x12,
138*d6b92ffaSHans Petter Selasky 	IB_ATTR_GUID_INFO = 0x14,
139*d6b92ffaSHans Petter Selasky 	IB_ATTR_PORT_INFO = 0x15,
140*d6b92ffaSHans Petter Selasky 	IB_ATTR_PKEY_TBL = 0x16,
141*d6b92ffaSHans Petter Selasky 	IB_ATTR_SLVL_TABLE = 0x17,
142*d6b92ffaSHans Petter Selasky 	IB_ATTR_VL_ARBITRATION = 0x18,
143*d6b92ffaSHans Petter Selasky 	IB_ATTR_LINEARFORWTBL = 0x19,
144*d6b92ffaSHans Petter Selasky 	IB_ATTR_MULTICASTFORWTBL = 0x1b,
145*d6b92ffaSHans Petter Selasky 	IB_ATTR_LINKSPEEDWIDTHPAIRSTBL = 0x1c,
146*d6b92ffaSHans Petter Selasky 	IB_ATTR_VENDORMADSTBL = 0x1d,
147*d6b92ffaSHans Petter Selasky 	IB_ATTR_SMINFO = 0x20,
148*d6b92ffaSHans Petter Selasky 	IB_ATTR_PORT_INFO_EXT = 0x33,
149*d6b92ffaSHans Petter Selasky 	IB_ATTR_LAST,
150*d6b92ffaSHans Petter Selasky 
151*d6b92ffaSHans Petter Selasky 	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
152*d6b92ffaSHans Petter Selasky };
153*d6b92ffaSHans Petter Selasky 
154*d6b92ffaSHans Petter Selasky enum SA_ATTR_ID {
155*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_NOTICE = 0x02,
156*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_INFORMINFO = 0x03,
157*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_NODERECORD = 0x11,
158*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_PORTINFORECORD = 0x12,
159*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_SL2VLTABLERECORD = 0x13,
160*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_SWITCHINFORECORD = 0x14,
161*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_LFTRECORD = 0x15,
162*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_RFTRECORD = 0x16,
163*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_MFTRECORD = 0x17,
164*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_SMINFORECORD = 0x18,
165*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_LINKRECORD = 0x20,
166*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_GUIDINFORECORD = 0x30,
167*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_SERVICERECORD = 0x31,
168*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_PKEYTABLERECORD = 0x33,
169*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_PATHRECORD = 0x35,
170*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_VLARBTABLERECORD = 0x36,
171*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_MCRECORD = 0x38,
172*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_MULTIPATH = 0x3a,
173*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_INFORMINFORECORD = 0xf3,
174*d6b92ffaSHans Petter Selasky 
175*d6b92ffaSHans Petter Selasky 	IB_SA_ATTR_LAST
176*d6b92ffaSHans Petter Selasky };
177*d6b92ffaSHans Petter Selasky 
178*d6b92ffaSHans Petter Selasky enum GSI_ATTR_ID {
179*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_SAMPLES_CONTROL = 0x10,
180*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_SAMPLES_RESULT = 0x11,
181*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_COUNTERS = 0x12,
182*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_RCV_ERROR_DETAILS = 0x15,
183*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_XMIT_DISCARD_DETAILS = 0x16,
184*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_OP_RCV_COUNTERS = 0x17,
185*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_FLOW_CTL_COUNTERS = 0x18,
186*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_VL_OP_PACKETS = 0x19,
187*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_VL_OP_DATA = 0x1A,
188*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS = 0x1B,
189*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_PORT_VL_XMIT_WAIT_COUNTERS = 0x1C,
190*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_COUNTERS_EXT = 0x1D,
191*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_EXT_SPEEDS_COUNTERS = 0x1F,
192*d6b92ffaSHans Petter Selasky 	IB_GSI_SW_PORT_VL_CONGESTION = 0x30,
193*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_RCV_CON_CTRL = 0x31,
194*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_SL_RCV_FECN = 0x32,
195*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_SL_RCV_BECN = 0x33,
196*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_XMIT_CON_CTRL = 0x34,
197*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_VL_XMIT_TIME_CONG = 0x35,
198*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_XMIT_DATA_SL = 0x36,
199*d6b92ffaSHans Petter Selasky 	IB_GSI_PORT_RCV_DATA_SL = 0x37,
200*d6b92ffaSHans Petter Selasky 	IB_GSI_ATTR_LAST
201*d6b92ffaSHans Petter Selasky };
202*d6b92ffaSHans Petter Selasky 
203*d6b92ffaSHans Petter Selasky enum BM_ATTR_ID {
204*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_BKEYINFO = 0x10,
205*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_WRITE_VPD = 0x20,
206*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_READ_VPD = 0x21,
207*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_RESET_IBML = 0x22,
208*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_SET_MODULE_PM_CONTROL = 0x23,
209*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_GET_MODULE_PM_CONTROL = 0x24,
210*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_SET_UNIT_PM_CONTROL = 0x25,
211*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_GET_UNIT_PM_CONTROL = 0x26,
212*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_SET_IOC_PM_CONTROL = 0x27,
213*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_GET_IOC_PM_CONTROL = 0x28,
214*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_SET_MODULE_STATE = 0x29,
215*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_SET_MODULE_ATTENTION = 0x2A,
216*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_GET_MODULE_STATUS = 0x2B,
217*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_IB2IBML = 0x2C,
218*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_IB2CME = 0x2D,
219*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_IB2MME = 0x2E,
220*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_OEM = 0x2F,
221*d6b92ffaSHans Petter Selasky 
222*d6b92ffaSHans Petter Selasky 	IB_BM_ATTR_LAST
223*d6b92ffaSHans Petter Selasky };
224*d6b92ffaSHans Petter Selasky 
225*d6b92ffaSHans Petter Selasky enum CC_ATTRI_ID {
226*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_CONGESTION_INFO = 0x11,
227*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_CONGESTION_KEY_INFO = 0x12,
228*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_CONGESTION_LOG = 0x13,
229*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_SWITCH_CONGESTION_SETTING = 0x14,
230*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING = 0x15,
231*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_CA_CONGESTION_SETTING = 0x16,
232*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_CONGESTION_CONTROL_TABLE = 0x17,
233*d6b92ffaSHans Petter Selasky 	IB_CC_ATTR_TIMESTAMP = 0x18,
234*d6b92ffaSHans Petter Selasky };
235*d6b92ffaSHans Petter Selasky 
236*d6b92ffaSHans Petter Selasky #define IB_VENDOR_OPENIB_PING_CLASS	(IB_VENDOR_RANGE2_START_CLASS + 2)
237*d6b92ffaSHans Petter Selasky #define IB_VENDOR_OPENIB_SYSSTAT_CLASS	(IB_VENDOR_RANGE2_START_CLASS + 3)
238*d6b92ffaSHans Petter Selasky #define IB_OPENIB_OUI			(0x001405)
239*d6b92ffaSHans Petter Selasky 
240*d6b92ffaSHans Petter Selasky typedef uint8_t ibmad_gid_t[16];
241*d6b92ffaSHans Petter Selasky #ifdef USE_DEPRECATED_IB_GID_T
242*d6b92ffaSHans Petter Selasky typedef ibmad_gid_t ib_gid_t __attribute__ ((deprecated));
243*d6b92ffaSHans Petter Selasky #endif
244*d6b92ffaSHans Petter Selasky 
245*d6b92ffaSHans Petter Selasky typedef struct {
246*d6b92ffaSHans Petter Selasky 	int cnt;
247*d6b92ffaSHans Petter Selasky 	uint8_t p[IB_SUBNET_PATH_HOPS_MAX];
248*d6b92ffaSHans Petter Selasky 	uint16_t drslid;
249*d6b92ffaSHans Petter Selasky 	uint16_t drdlid;
250*d6b92ffaSHans Petter Selasky } ib_dr_path_t;
251*d6b92ffaSHans Petter Selasky 
252*d6b92ffaSHans Petter Selasky typedef struct {
253*d6b92ffaSHans Petter Selasky 	unsigned id;
254*d6b92ffaSHans Petter Selasky 	unsigned mod;
255*d6b92ffaSHans Petter Selasky } ib_attr_t;
256*d6b92ffaSHans Petter Selasky 
257*d6b92ffaSHans Petter Selasky typedef struct {
258*d6b92ffaSHans Petter Selasky 	int mgtclass;
259*d6b92ffaSHans Petter Selasky 	int method;
260*d6b92ffaSHans Petter Selasky 	ib_attr_t attr;
261*d6b92ffaSHans Petter Selasky 	uint32_t rstatus;	/* return status */
262*d6b92ffaSHans Petter Selasky 	int dataoffs;
263*d6b92ffaSHans Petter Selasky 	int datasz;
264*d6b92ffaSHans Petter Selasky 	uint64_t mkey;
265*d6b92ffaSHans Petter Selasky 	uint64_t trid;		/* used for out mad if nonzero, return real val */
266*d6b92ffaSHans Petter Selasky 	uint64_t mask;		/* for sa mads */
267*d6b92ffaSHans Petter Selasky 	unsigned recsz;		/* for sa mads (attribute offset) */
268*d6b92ffaSHans Petter Selasky 	int timeout;
269*d6b92ffaSHans Petter Selasky 	uint32_t oui;		/* for vendor range 2 mads */
270*d6b92ffaSHans Petter Selasky } ib_rpc_t;
271*d6b92ffaSHans Petter Selasky 
272*d6b92ffaSHans Petter Selasky typedef struct {
273*d6b92ffaSHans Petter Selasky 	int mgtclass;
274*d6b92ffaSHans Petter Selasky 	int method;
275*d6b92ffaSHans Petter Selasky 	ib_attr_t attr;
276*d6b92ffaSHans Petter Selasky 	uint32_t rstatus;	/* return status */
277*d6b92ffaSHans Petter Selasky 	int dataoffs;
278*d6b92ffaSHans Petter Selasky 	int datasz;
279*d6b92ffaSHans Petter Selasky 	uint64_t mkey;
280*d6b92ffaSHans Petter Selasky 	uint64_t trid;		/* used for out mad if nonzero, return real val */
281*d6b92ffaSHans Petter Selasky 	uint64_t mask;		/* for sa mads */
282*d6b92ffaSHans Petter Selasky 	unsigned recsz;		/* for sa mads (attribute offset) */
283*d6b92ffaSHans Petter Selasky 	int timeout;
284*d6b92ffaSHans Petter Selasky 	uint32_t oui;		/* for vendor range 2 mads */
285*d6b92ffaSHans Petter Selasky 	int error;		/* errno */
286*d6b92ffaSHans Petter Selasky } ib_rpc_v1_t;
287*d6b92ffaSHans Petter Selasky 
288*d6b92ffaSHans Petter Selasky typedef struct {
289*d6b92ffaSHans Petter Selasky 	int mgtclass;
290*d6b92ffaSHans Petter Selasky 	int method;
291*d6b92ffaSHans Petter Selasky 	ib_attr_t attr;
292*d6b92ffaSHans Petter Selasky 	uint32_t rstatus;       /* return status */
293*d6b92ffaSHans Petter Selasky 	int dataoffs;
294*d6b92ffaSHans Petter Selasky 	int datasz;
295*d6b92ffaSHans Petter Selasky 	uint64_t mkey;
296*d6b92ffaSHans Petter Selasky 	uint64_t trid;          /* used for out mad if nonzero, return real val */
297*d6b92ffaSHans Petter Selasky 	uint64_t mask;          /* for sa mads */
298*d6b92ffaSHans Petter Selasky 	unsigned recsz;         /* for sa mads (attribute offset) */
299*d6b92ffaSHans Petter Selasky 	int timeout;
300*d6b92ffaSHans Petter Selasky 	uint32_t oui;           /* for vendor range 2 mads */
301*d6b92ffaSHans Petter Selasky 	int error;		/* errno */
302*d6b92ffaSHans Petter Selasky 	uint64_t cckey;
303*d6b92ffaSHans Petter Selasky } ib_rpc_cc_t;
304*d6b92ffaSHans Petter Selasky 
305*d6b92ffaSHans Petter Selasky typedef struct portid {
306*d6b92ffaSHans Petter Selasky 	int lid;		/* lid or 0 if directed route */
307*d6b92ffaSHans Petter Selasky 	ib_dr_path_t drpath;
308*d6b92ffaSHans Petter Selasky 	int grh_present;	/* flag */
309*d6b92ffaSHans Petter Selasky 	ibmad_gid_t gid;
310*d6b92ffaSHans Petter Selasky 	uint32_t qp;
311*d6b92ffaSHans Petter Selasky 	uint32_t qkey;
312*d6b92ffaSHans Petter Selasky 	uint8_t sl;
313*d6b92ffaSHans Petter Selasky 	unsigned pkey_idx;
314*d6b92ffaSHans Petter Selasky } ib_portid_t;
315*d6b92ffaSHans Petter Selasky 
316*d6b92ffaSHans Petter Selasky typedef void (ib_mad_dump_fn) (char *buf, int bufsz, void *val, int valsz);
317*d6b92ffaSHans Petter Selasky 
318*d6b92ffaSHans Petter Selasky #define IB_FIELD_NAME_LEN	32
319*d6b92ffaSHans Petter Selasky 
320*d6b92ffaSHans Petter Selasky typedef struct ib_field {
321*d6b92ffaSHans Petter Selasky 	int bitoffs;
322*d6b92ffaSHans Petter Selasky 	int bitlen;
323*d6b92ffaSHans Petter Selasky 	char name[IB_FIELD_NAME_LEN];
324*d6b92ffaSHans Petter Selasky 	ib_mad_dump_fn *def_dump_fn;
325*d6b92ffaSHans Petter Selasky } ib_field_t;
326*d6b92ffaSHans Petter Selasky 
327*d6b92ffaSHans Petter Selasky enum MAD_FIELDS {
328*d6b92ffaSHans Petter Selasky 	IB_NO_FIELD,
329*d6b92ffaSHans Petter Selasky 
330*d6b92ffaSHans Petter Selasky 	IB_GID_PREFIX_F,
331*d6b92ffaSHans Petter Selasky 	IB_GID_GUID_F,
332*d6b92ffaSHans Petter Selasky 
333*d6b92ffaSHans Petter Selasky 	/* first MAD word (0-3 bytes) */
334*d6b92ffaSHans Petter Selasky 	IB_MAD_METHOD_F,
335*d6b92ffaSHans Petter Selasky 	IB_MAD_RESPONSE_F,
336*d6b92ffaSHans Petter Selasky 	IB_MAD_CLASSVER_F,
337*d6b92ffaSHans Petter Selasky 	IB_MAD_MGMTCLASS_F,
338*d6b92ffaSHans Petter Selasky 	IB_MAD_BASEVER_F,
339*d6b92ffaSHans Petter Selasky 
340*d6b92ffaSHans Petter Selasky 	/* second MAD word (4-7 bytes) */
341*d6b92ffaSHans Petter Selasky 	IB_MAD_STATUS_F,
342*d6b92ffaSHans Petter Selasky 
343*d6b92ffaSHans Petter Selasky 	/* DRSMP only */
344*d6b92ffaSHans Petter Selasky 	IB_DRSMP_HOPCNT_F,
345*d6b92ffaSHans Petter Selasky 	IB_DRSMP_HOPPTR_F,
346*d6b92ffaSHans Petter Selasky 	IB_DRSMP_STATUS_F,
347*d6b92ffaSHans Petter Selasky 	IB_DRSMP_DIRECTION_F,
348*d6b92ffaSHans Petter Selasky 
349*d6b92ffaSHans Petter Selasky 	/* words 3,4,5,6 (8-23 bytes) */
350*d6b92ffaSHans Petter Selasky 	IB_MAD_TRID_F,
351*d6b92ffaSHans Petter Selasky 	IB_MAD_ATTRID_F,
352*d6b92ffaSHans Petter Selasky 	IB_MAD_ATTRMOD_F,
353*d6b92ffaSHans Petter Selasky 
354*d6b92ffaSHans Petter Selasky 	/* word 7,8 (24-31 bytes) */
355*d6b92ffaSHans Petter Selasky 	IB_MAD_MKEY_F,
356*d6b92ffaSHans Petter Selasky 
357*d6b92ffaSHans Petter Selasky 	/* word 9 (32-37 bytes) */
358*d6b92ffaSHans Petter Selasky 	IB_DRSMP_DRDLID_F,
359*d6b92ffaSHans Petter Selasky 	IB_DRSMP_DRSLID_F,
360*d6b92ffaSHans Petter Selasky 
361*d6b92ffaSHans Petter Selasky 	/* word 10,11 (36-43 bytes) */
362*d6b92ffaSHans Petter Selasky 	IB_SA_MKEY_F,
363*d6b92ffaSHans Petter Selasky 
364*d6b92ffaSHans Petter Selasky 	/* word 12 (44-47 bytes) */
365*d6b92ffaSHans Petter Selasky 	IB_SA_ATTROFFS_F,
366*d6b92ffaSHans Petter Selasky 
367*d6b92ffaSHans Petter Selasky 	/* word 13,14 (48-55 bytes) */
368*d6b92ffaSHans Petter Selasky 	IB_SA_COMPMASK_F,
369*d6b92ffaSHans Petter Selasky 
370*d6b92ffaSHans Petter Selasky 	/* word 13,14 (56-255 bytes) */
371*d6b92ffaSHans Petter Selasky 	IB_SA_DATA_F,
372*d6b92ffaSHans Petter Selasky 
373*d6b92ffaSHans Petter Selasky 	/* bytes 64 - 127 */
374*d6b92ffaSHans Petter Selasky 	IB_SM_DATA_F,
375*d6b92ffaSHans Petter Selasky 
376*d6b92ffaSHans Petter Selasky 	/* bytes 64 - 256 */
377*d6b92ffaSHans Petter Selasky 	IB_GS_DATA_F,
378*d6b92ffaSHans Petter Selasky 
379*d6b92ffaSHans Petter Selasky 	/* bytes 128 - 191 */
380*d6b92ffaSHans Petter Selasky 	IB_DRSMP_PATH_F,
381*d6b92ffaSHans Petter Selasky 
382*d6b92ffaSHans Petter Selasky 	/* bytes 192 - 255 */
383*d6b92ffaSHans Petter Selasky 	IB_DRSMP_RPATH_F,
384*d6b92ffaSHans Petter Selasky 
385*d6b92ffaSHans Petter Selasky 	/*
386*d6b92ffaSHans Petter Selasky 	 * PortInfo fields
387*d6b92ffaSHans Petter Selasky 	 */
388*d6b92ffaSHans Petter Selasky 	IB_PORT_FIRST_F,
389*d6b92ffaSHans Petter Selasky 	IB_PORT_MKEY_F = IB_PORT_FIRST_F,
390*d6b92ffaSHans Petter Selasky 	IB_PORT_GID_PREFIX_F,
391*d6b92ffaSHans Petter Selasky 	IB_PORT_LID_F,
392*d6b92ffaSHans Petter Selasky 	IB_PORT_SMLID_F,
393*d6b92ffaSHans Petter Selasky 	IB_PORT_CAPMASK_F,
394*d6b92ffaSHans Petter Selasky 	IB_PORT_DIAG_F,
395*d6b92ffaSHans Petter Selasky 	IB_PORT_MKEY_LEASE_F,
396*d6b92ffaSHans Petter Selasky 	IB_PORT_LOCAL_PORT_F,
397*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_WIDTH_ENABLED_F,
398*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_WIDTH_SUPPORTED_F,
399*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_WIDTH_ACTIVE_F,
400*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_SUPPORTED_F,
401*d6b92ffaSHans Petter Selasky 	IB_PORT_STATE_F,
402*d6b92ffaSHans Petter Selasky 	IB_PORT_PHYS_STATE_F,
403*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_DOWN_DEF_F,
404*d6b92ffaSHans Petter Selasky 	IB_PORT_MKEY_PROT_BITS_F,
405*d6b92ffaSHans Petter Selasky 	IB_PORT_LMC_F,
406*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_ACTIVE_F,
407*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_ENABLED_F,
408*d6b92ffaSHans Petter Selasky 	IB_PORT_NEIGHBOR_MTU_F,
409*d6b92ffaSHans Petter Selasky 	IB_PORT_SMSL_F,
410*d6b92ffaSHans Petter Selasky 	IB_PORT_VL_CAP_F,
411*d6b92ffaSHans Petter Selasky 	IB_PORT_INIT_TYPE_F,
412*d6b92ffaSHans Petter Selasky 	IB_PORT_VL_HIGH_LIMIT_F,
413*d6b92ffaSHans Petter Selasky 	IB_PORT_VL_ARBITRATION_HIGH_CAP_F,
414*d6b92ffaSHans Petter Selasky 	IB_PORT_VL_ARBITRATION_LOW_CAP_F,
415*d6b92ffaSHans Petter Selasky 	IB_PORT_INIT_TYPE_REPLY_F,
416*d6b92ffaSHans Petter Selasky 	IB_PORT_MTU_CAP_F,
417*d6b92ffaSHans Petter Selasky 	IB_PORT_VL_STALL_COUNT_F,
418*d6b92ffaSHans Petter Selasky 	IB_PORT_HOQ_LIFE_F,
419*d6b92ffaSHans Petter Selasky 	IB_PORT_OPER_VLS_F,
420*d6b92ffaSHans Petter Selasky 	IB_PORT_PART_EN_INB_F,
421*d6b92ffaSHans Petter Selasky 	IB_PORT_PART_EN_OUTB_F,
422*d6b92ffaSHans Petter Selasky 	IB_PORT_FILTER_RAW_INB_F,
423*d6b92ffaSHans Petter Selasky 	IB_PORT_FILTER_RAW_OUTB_F,
424*d6b92ffaSHans Petter Selasky 	IB_PORT_MKEY_VIOL_F,
425*d6b92ffaSHans Petter Selasky 	IB_PORT_PKEY_VIOL_F,
426*d6b92ffaSHans Petter Selasky 	IB_PORT_QKEY_VIOL_F,
427*d6b92ffaSHans Petter Selasky 	IB_PORT_GUID_CAP_F,
428*d6b92ffaSHans Petter Selasky 	IB_PORT_CLIENT_REREG_F,
429*d6b92ffaSHans Petter Selasky 	IB_PORT_MCAST_PKEY_SUPR_ENAB_F,
430*d6b92ffaSHans Petter Selasky 	IB_PORT_SUBN_TIMEOUT_F,
431*d6b92ffaSHans Petter Selasky 	IB_PORT_RESP_TIME_VAL_F,
432*d6b92ffaSHans Petter Selasky 	IB_PORT_LOCAL_PHYS_ERR_F,
433*d6b92ffaSHans Petter Selasky 	IB_PORT_OVERRUN_ERR_F,
434*d6b92ffaSHans Petter Selasky 	IB_PORT_MAX_CREDIT_HINT_F,
435*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_ROUND_TRIP_F,
436*d6b92ffaSHans Petter Selasky 	IB_PORT_LAST_F,
437*d6b92ffaSHans Petter Selasky 
438*d6b92ffaSHans Petter Selasky 	/*
439*d6b92ffaSHans Petter Selasky 	 * NodeInfo fields
440*d6b92ffaSHans Petter Selasky 	 */
441*d6b92ffaSHans Petter Selasky 	IB_NODE_FIRST_F,
442*d6b92ffaSHans Petter Selasky 	IB_NODE_BASE_VERS_F = IB_NODE_FIRST_F,
443*d6b92ffaSHans Petter Selasky 	IB_NODE_CLASS_VERS_F,
444*d6b92ffaSHans Petter Selasky 	IB_NODE_TYPE_F,
445*d6b92ffaSHans Petter Selasky 	IB_NODE_NPORTS_F,
446*d6b92ffaSHans Petter Selasky 	IB_NODE_SYSTEM_GUID_F,
447*d6b92ffaSHans Petter Selasky 	IB_NODE_GUID_F,
448*d6b92ffaSHans Petter Selasky 	IB_NODE_PORT_GUID_F,
449*d6b92ffaSHans Petter Selasky 	IB_NODE_PARTITION_CAP_F,
450*d6b92ffaSHans Petter Selasky 	IB_NODE_DEVID_F,
451*d6b92ffaSHans Petter Selasky 	IB_NODE_REVISION_F,
452*d6b92ffaSHans Petter Selasky 	IB_NODE_LOCAL_PORT_F,
453*d6b92ffaSHans Petter Selasky 	IB_NODE_VENDORID_F,
454*d6b92ffaSHans Petter Selasky 	IB_NODE_LAST_F,
455*d6b92ffaSHans Petter Selasky 
456*d6b92ffaSHans Petter Selasky 	/*
457*d6b92ffaSHans Petter Selasky 	 * SwitchInfo fields
458*d6b92ffaSHans Petter Selasky 	 */
459*d6b92ffaSHans Petter Selasky 	IB_SW_FIRST_F,
460*d6b92ffaSHans Petter Selasky 	IB_SW_LINEAR_FDB_CAP_F = IB_SW_FIRST_F,
461*d6b92ffaSHans Petter Selasky 	IB_SW_RANDOM_FDB_CAP_F,
462*d6b92ffaSHans Petter Selasky 	IB_SW_MCAST_FDB_CAP_F,
463*d6b92ffaSHans Petter Selasky 	IB_SW_LINEAR_FDB_TOP_F,
464*d6b92ffaSHans Petter Selasky 	IB_SW_DEF_PORT_F,
465*d6b92ffaSHans Petter Selasky 	IB_SW_DEF_MCAST_PRIM_F,
466*d6b92ffaSHans Petter Selasky 	IB_SW_DEF_MCAST_NOT_PRIM_F,
467*d6b92ffaSHans Petter Selasky 	IB_SW_LIFE_TIME_F,
468*d6b92ffaSHans Petter Selasky 	IB_SW_STATE_CHANGE_F,
469*d6b92ffaSHans Petter Selasky 	IB_SW_OPT_SLTOVL_MAPPING_F,
470*d6b92ffaSHans Petter Selasky 	IB_SW_LIDS_PER_PORT_F,
471*d6b92ffaSHans Petter Selasky 	IB_SW_PARTITION_ENFORCE_CAP_F,
472*d6b92ffaSHans Petter Selasky 	IB_SW_PARTITION_ENF_INB_F,
473*d6b92ffaSHans Petter Selasky 	IB_SW_PARTITION_ENF_OUTB_F,
474*d6b92ffaSHans Petter Selasky 	IB_SW_FILTER_RAW_INB_F,
475*d6b92ffaSHans Petter Selasky 	IB_SW_FILTER_RAW_OUTB_F,
476*d6b92ffaSHans Petter Selasky 	IB_SW_ENHANCED_PORT0_F,
477*d6b92ffaSHans Petter Selasky 	IB_SW_MCAST_FDB_TOP_F,
478*d6b92ffaSHans Petter Selasky 	IB_SW_LAST_F,
479*d6b92ffaSHans Petter Selasky 
480*d6b92ffaSHans Petter Selasky 	/*
481*d6b92ffaSHans Petter Selasky 	 * SwitchLinearForwardingTable fields
482*d6b92ffaSHans Petter Selasky 	 */
483*d6b92ffaSHans Petter Selasky 	IB_LINEAR_FORW_TBL_F,
484*d6b92ffaSHans Petter Selasky 
485*d6b92ffaSHans Petter Selasky 	/*
486*d6b92ffaSHans Petter Selasky 	 * SwitchMulticastForwardingTable fields
487*d6b92ffaSHans Petter Selasky 	 */
488*d6b92ffaSHans Petter Selasky 	IB_MULTICAST_FORW_TBL_F,
489*d6b92ffaSHans Petter Selasky 
490*d6b92ffaSHans Petter Selasky 	/*
491*d6b92ffaSHans Petter Selasky 	 * NodeDescription fields
492*d6b92ffaSHans Petter Selasky 	 */
493*d6b92ffaSHans Petter Selasky 	IB_NODE_DESC_F,
494*d6b92ffaSHans Petter Selasky 
495*d6b92ffaSHans Petter Selasky 	/*
496*d6b92ffaSHans Petter Selasky 	 * Notice/Trap fields
497*d6b92ffaSHans Petter Selasky 	 */
498*d6b92ffaSHans Petter Selasky 	IB_NOTICE_IS_GENERIC_F,
499*d6b92ffaSHans Petter Selasky 	IB_NOTICE_TYPE_F,
500*d6b92ffaSHans Petter Selasky 	IB_NOTICE_PRODUCER_F,
501*d6b92ffaSHans Petter Selasky 	IB_NOTICE_TRAP_NUMBER_F,
502*d6b92ffaSHans Petter Selasky 	IB_NOTICE_ISSUER_LID_F,
503*d6b92ffaSHans Petter Selasky 	IB_NOTICE_TOGGLE_F,
504*d6b92ffaSHans Petter Selasky 	IB_NOTICE_COUNT_F,
505*d6b92ffaSHans Petter Selasky 	IB_NOTICE_DATA_DETAILS_F,
506*d6b92ffaSHans Petter Selasky 	IB_NOTICE_DATA_LID_F,
507*d6b92ffaSHans Petter Selasky 	IB_NOTICE_DATA_144_LID_F,
508*d6b92ffaSHans Petter Selasky 	IB_NOTICE_DATA_144_CAPMASK_F,
509*d6b92ffaSHans Petter Selasky 
510*d6b92ffaSHans Petter Selasky 	/*
511*d6b92ffaSHans Petter Selasky 	 * GS Performance
512*d6b92ffaSHans Petter Selasky 	 */
513*d6b92ffaSHans Petter Selasky 	IB_PC_FIRST_F,
514*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_SELECT_F = IB_PC_FIRST_F,
515*d6b92ffaSHans Petter Selasky 	IB_PC_COUNTER_SELECT_F,
516*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_SYM_F,
517*d6b92ffaSHans Petter Selasky 	IB_PC_LINK_RECOVERS_F,
518*d6b92ffaSHans Petter Selasky 	IB_PC_LINK_DOWNED_F,
519*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_RCV_F,
520*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_PHYSRCV_F,
521*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_SWITCH_REL_F,
522*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DISCARDS_F,
523*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_XMTCONSTR_F,
524*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_RCVCONSTR_F,
525*d6b92ffaSHans Petter Selasky 	IB_PC_COUNTER_SELECT2_F,
526*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_LOCALINTEG_F,
527*d6b92ffaSHans Petter Selasky 	IB_PC_ERR_EXCESS_OVR_F,
528*d6b92ffaSHans Petter Selasky 	IB_PC_VL15_DROPPED_F,
529*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_BYTES_F,
530*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_BYTES_F,
531*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_PKTS_F,
532*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_PKTS_F,
533*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_WAIT_F,
534*d6b92ffaSHans Petter Selasky 	IB_PC_LAST_F,
535*d6b92ffaSHans Petter Selasky 
536*d6b92ffaSHans Petter Selasky 	/*
537*d6b92ffaSHans Petter Selasky 	 * SMInfo
538*d6b92ffaSHans Petter Selasky 	 */
539*d6b92ffaSHans Petter Selasky 	IB_SMINFO_GUID_F,
540*d6b92ffaSHans Petter Selasky 	IB_SMINFO_KEY_F,
541*d6b92ffaSHans Petter Selasky 	IB_SMINFO_ACT_F,
542*d6b92ffaSHans Petter Selasky 	IB_SMINFO_PRIO_F,
543*d6b92ffaSHans Petter Selasky 	IB_SMINFO_STATE_F,
544*d6b92ffaSHans Petter Selasky 
545*d6b92ffaSHans Petter Selasky 	/*
546*d6b92ffaSHans Petter Selasky 	 * SA RMPP
547*d6b92ffaSHans Petter Selasky 	 */
548*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_VERS_F,
549*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_TYPE_F,
550*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_RESP_F,
551*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_FLAGS_F,
552*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_STATUS_F,
553*d6b92ffaSHans Petter Selasky 
554*d6b92ffaSHans Petter Selasky 	/* data1 */
555*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_D1_F,
556*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_SEGNUM_F,
557*d6b92ffaSHans Petter Selasky 	/* data2 */
558*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_D2_F,
559*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_LEN_F,	/* DATA: Payload len */
560*d6b92ffaSHans Petter Selasky 	IB_SA_RMPP_NEWWIN_F,	/* ACK: new window last */
561*d6b92ffaSHans Petter Selasky 
562*d6b92ffaSHans Petter Selasky 	/*
563*d6b92ffaSHans Petter Selasky 	 * SA Multi Path rec
564*d6b92ffaSHans Petter Selasky 	 */
565*d6b92ffaSHans Petter Selasky 	IB_SA_MP_NPATH_F,
566*d6b92ffaSHans Petter Selasky 	IB_SA_MP_NSRC_F,
567*d6b92ffaSHans Petter Selasky 	IB_SA_MP_NDEST_F,
568*d6b92ffaSHans Petter Selasky 	IB_SA_MP_GID0_F,
569*d6b92ffaSHans Petter Selasky 
570*d6b92ffaSHans Petter Selasky 	/*
571*d6b92ffaSHans Petter Selasky 	 * SA Path rec
572*d6b92ffaSHans Petter Selasky 	 */
573*d6b92ffaSHans Petter Selasky 	IB_SA_PR_DGID_F,
574*d6b92ffaSHans Petter Selasky 	IB_SA_PR_SGID_F,
575*d6b92ffaSHans Petter Selasky 	IB_SA_PR_DLID_F,
576*d6b92ffaSHans Petter Selasky 	IB_SA_PR_SLID_F,
577*d6b92ffaSHans Petter Selasky 	IB_SA_PR_NPATH_F,
578*d6b92ffaSHans Petter Selasky 	IB_SA_PR_SL_F,
579*d6b92ffaSHans Petter Selasky 
580*d6b92ffaSHans Petter Selasky 	/*
581*d6b92ffaSHans Petter Selasky 	 * MC Member rec
582*d6b92ffaSHans Petter Selasky 	 */
583*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_MGID_F,
584*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_PORTGID_F,
585*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_QKEY_F,
586*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_MLID_F,
587*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_SL_F,
588*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_MTU_F,
589*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_RATE_F,
590*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_TCLASS_F,
591*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_PKEY_F,
592*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_FLOW_LABEL_F,
593*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_JOIN_STATE_F,
594*d6b92ffaSHans Petter Selasky 	IB_SA_MCM_PROXY_JOIN_F,
595*d6b92ffaSHans Petter Selasky 
596*d6b92ffaSHans Petter Selasky 	/*
597*d6b92ffaSHans Petter Selasky 	 * Service record
598*d6b92ffaSHans Petter Selasky 	 */
599*d6b92ffaSHans Petter Selasky 	IB_SA_SR_ID_F,
600*d6b92ffaSHans Petter Selasky 	IB_SA_SR_GID_F,
601*d6b92ffaSHans Petter Selasky 	IB_SA_SR_PKEY_F,
602*d6b92ffaSHans Petter Selasky 	IB_SA_SR_LEASE_F,
603*d6b92ffaSHans Petter Selasky 	IB_SA_SR_KEY_F,
604*d6b92ffaSHans Petter Selasky 	IB_SA_SR_NAME_F,
605*d6b92ffaSHans Petter Selasky 	IB_SA_SR_DATA_F,
606*d6b92ffaSHans Petter Selasky 
607*d6b92ffaSHans Petter Selasky 	/*
608*d6b92ffaSHans Petter Selasky 	 * ATS SM record - within SA_SR_DATA
609*d6b92ffaSHans Petter Selasky 	 */
610*d6b92ffaSHans Petter Selasky 	IB_ATS_SM_NODE_ADDR_F,
611*d6b92ffaSHans Petter Selasky 	IB_ATS_SM_MAGIC_KEY_F,
612*d6b92ffaSHans Petter Selasky 	IB_ATS_SM_NODE_TYPE_F,
613*d6b92ffaSHans Petter Selasky 	IB_ATS_SM_NODE_NAME_F,
614*d6b92ffaSHans Petter Selasky 
615*d6b92ffaSHans Petter Selasky 	/*
616*d6b92ffaSHans Petter Selasky 	 * SLTOVL MAPPING TABLE
617*d6b92ffaSHans Petter Selasky 	 */
618*d6b92ffaSHans Petter Selasky 	IB_SLTOVL_MAPPING_TABLE_F,
619*d6b92ffaSHans Petter Selasky 
620*d6b92ffaSHans Petter Selasky 	/*
621*d6b92ffaSHans Petter Selasky 	 * VL ARBITRATION TABLE
622*d6b92ffaSHans Petter Selasky 	 */
623*d6b92ffaSHans Petter Selasky 	IB_VL_ARBITRATION_TABLE_F,
624*d6b92ffaSHans Petter Selasky 
625*d6b92ffaSHans Petter Selasky 	/*
626*d6b92ffaSHans Petter Selasky 	 * IB vendor class range 2
627*d6b92ffaSHans Petter Selasky 	 */
628*d6b92ffaSHans Petter Selasky 	IB_VEND2_OUI_F,
629*d6b92ffaSHans Petter Selasky 	IB_VEND2_DATA_F,
630*d6b92ffaSHans Petter Selasky 
631*d6b92ffaSHans Petter Selasky 	/*
632*d6b92ffaSHans Petter Selasky 	 * PortCountersExtended
633*d6b92ffaSHans Petter Selasky 	 */
634*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_FIRST_F,
635*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_PORT_SELECT_F = IB_PC_EXT_FIRST_F,
636*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_COUNTER_SELECT_F,
637*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_BYTES_F,
638*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_RCV_BYTES_F,
639*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_PKTS_F,
640*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_RCV_PKTS_F,
641*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_UPKTS_F,
642*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_RCV_UPKTS_F,
643*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_MPKTS_F,
644*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_RCV_MPKTS_F,
645*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_LAST_F,
646*d6b92ffaSHans Petter Selasky 
647*d6b92ffaSHans Petter Selasky 	/*
648*d6b92ffaSHans Petter Selasky 	 * GUIDInfo fields
649*d6b92ffaSHans Petter Selasky 	 */
650*d6b92ffaSHans Petter Selasky 	IB_GUID_GUID0_F, /* Obsolete, kept for compatibility
651*d6b92ffaSHans Petter Selasky 			    Use IB_GI_GUID0_F going forward */
652*d6b92ffaSHans Petter Selasky 
653*d6b92ffaSHans Petter Selasky 	/*
654*d6b92ffaSHans Petter Selasky 	 * ClassPortInfo fields
655*d6b92ffaSHans Petter Selasky 	 */
656*d6b92ffaSHans Petter Selasky 	IB_CPI_BASEVER_F,
657*d6b92ffaSHans Petter Selasky 	IB_CPI_CLASSVER_F,
658*d6b92ffaSHans Petter Selasky 	IB_CPI_CAPMASK_F,
659*d6b92ffaSHans Petter Selasky 	IB_CPI_CAPMASK2_F,
660*d6b92ffaSHans Petter Selasky 	IB_CPI_RESP_TIME_VALUE_F,
661*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_GID_F,
662*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_TC_F,
663*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_SL_F,
664*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_FL_F,
665*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_LID_F,
666*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_PKEY_F,
667*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_QP_F,
668*d6b92ffaSHans Petter Selasky 	IB_CPI_REDIRECT_QKEY_F,
669*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_GID_F,
670*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_TC_F,
671*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_SL_F,
672*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_FL_F,
673*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_LID_F,
674*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_PKEY_F,
675*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_HL_F,
676*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_QP_F,
677*d6b92ffaSHans Petter Selasky 	IB_CPI_TRAP_QKEY_F,
678*d6b92ffaSHans Petter Selasky 
679*d6b92ffaSHans Petter Selasky 	/*
680*d6b92ffaSHans Petter Selasky 	 * PortXmitDataSL fields
681*d6b92ffaSHans Petter Selasky 	 */
682*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
683*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL0_F = IB_PC_XMT_DATA_SL_FIRST_F,
684*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL1_F,
685*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL2_F,
686*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL3_F,
687*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL4_F,
688*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL5_F,
689*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL6_F,
690*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL7_F,
691*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL8_F,
692*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL9_F,
693*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL10_F,
694*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL11_F,
695*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL12_F,
696*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL13_F,
697*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL14_F,
698*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL15_F,
699*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DATA_SL_LAST_F,
700*d6b92ffaSHans Petter Selasky 
701*d6b92ffaSHans Petter Selasky 	/*
702*d6b92ffaSHans Petter Selasky 	 * PortRcvDataSL fields
703*d6b92ffaSHans Petter Selasky 	 */
704*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
705*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL0_F = IB_PC_RCV_DATA_SL_FIRST_F,
706*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL1_F,
707*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL2_F,
708*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL3_F,
709*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL4_F,
710*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL5_F,
711*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL6_F,
712*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL7_F,
713*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL8_F,
714*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL9_F,
715*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL10_F,
716*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL11_F,
717*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL12_F,
718*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL13_F,
719*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL14_F,
720*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL15_F,
721*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DATA_SL_LAST_F,
722*d6b92ffaSHans Petter Selasky 
723*d6b92ffaSHans Petter Selasky 	/*
724*d6b92ffaSHans Petter Selasky 	 * PortXmitDiscardDetails fields
725*d6b92ffaSHans Petter Selasky 	 */
726*d6b92ffaSHans Petter Selasky 	/* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
727*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_INACT_DISC_F,
728*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_NEIGH_MTU_DISC_F,
729*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_SW_LIFE_DISC_F,
730*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_SW_HOL_DISC_F,
731*d6b92ffaSHans Petter Selasky 	IB_PC_XMT_DISC_LAST_F,
732*d6b92ffaSHans Petter Selasky 
733*d6b92ffaSHans Petter Selasky 	/*
734*d6b92ffaSHans Petter Selasky 	 * PortRcvErrorDetails fields
735*d6b92ffaSHans Petter Selasky 	 */
736*d6b92ffaSHans Petter Selasky 	/* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
737*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_LOCAL_PHY_ERR_F,
738*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_MALFORMED_PKT_ERR_F,
739*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_BUF_OVR_ERR_F,
740*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_DLID_MAP_ERR_F,
741*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_VL_MAP_ERR_F,
742*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_LOOPING_ERR_F,
743*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_ERR_LAST_F,
744*d6b92ffaSHans Petter Selasky 
745*d6b92ffaSHans Petter Selasky 	/*
746*d6b92ffaSHans Petter Selasky 	 * PortSamplesControl fields
747*d6b92ffaSHans Petter Selasky 	 */
748*d6b92ffaSHans Petter Selasky 	IB_PSC_OPCODE_F,
749*d6b92ffaSHans Petter Selasky 	IB_PSC_PORT_SELECT_F,
750*d6b92ffaSHans Petter Selasky 	IB_PSC_TICK_F,
751*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_WIDTH_F,
752*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_MASK0_F,
753*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_MASKS1TO9_F,
754*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_MASKS10TO14_F,
755*d6b92ffaSHans Petter Selasky 	IB_PSC_SAMPLE_MECHS_F,
756*d6b92ffaSHans Petter Selasky 	IB_PSC_SAMPLE_STATUS_F,
757*d6b92ffaSHans Petter Selasky 	IB_PSC_OPTION_MASK_F,
758*d6b92ffaSHans Petter Selasky 	IB_PSC_VENDOR_MASK_F,
759*d6b92ffaSHans Petter Selasky 	IB_PSC_SAMPLE_START_F,
760*d6b92ffaSHans Petter Selasky 	IB_PSC_SAMPLE_INTVL_F,
761*d6b92ffaSHans Petter Selasky 	IB_PSC_TAG_F,
762*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL0_F,
763*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL1_F,
764*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL2_F,
765*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL3_F,
766*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL4_F,
767*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL5_F,
768*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL6_F,
769*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL7_F,
770*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL8_F,
771*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL9_F,
772*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL10_F,
773*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL11_F,
774*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL12_F,
775*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL13_F,
776*d6b92ffaSHans Petter Selasky 	IB_PSC_COUNTER_SEL14_F,
777*d6b92ffaSHans Petter Selasky 	IB_PSC_SAMPLES_ONLY_OPT_MASK_F,
778*d6b92ffaSHans Petter Selasky 	IB_PSC_LAST_F,
779*d6b92ffaSHans Petter Selasky 
780*d6b92ffaSHans Petter Selasky 	/*
781*d6b92ffaSHans Petter Selasky 	 * GUIDInfo fields
782*d6b92ffaSHans Petter Selasky 	 */
783*d6b92ffaSHans Petter Selasky 	IB_GI_GUID0_F, /* a duplicate of IB_GUID_GUID0_F for backwards
784*d6b92ffaSHans Petter Selasky 			  compatibility */
785*d6b92ffaSHans Petter Selasky 	IB_GI_GUID1_F,
786*d6b92ffaSHans Petter Selasky 	IB_GI_GUID2_F,
787*d6b92ffaSHans Petter Selasky 	IB_GI_GUID3_F,
788*d6b92ffaSHans Petter Selasky 	IB_GI_GUID4_F,
789*d6b92ffaSHans Petter Selasky 	IB_GI_GUID5_F,
790*d6b92ffaSHans Petter Selasky 	IB_GI_GUID6_F,
791*d6b92ffaSHans Petter Selasky 	IB_GI_GUID7_F,
792*d6b92ffaSHans Petter Selasky 
793*d6b92ffaSHans Petter Selasky 	/*
794*d6b92ffaSHans Petter Selasky 	 * GUID Info Record
795*d6b92ffaSHans Petter Selasky 	 */
796*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_LID_F,
797*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_BLOCKNUM_F,
798*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID0_F,
799*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID1_F,
800*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID2_F,
801*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID3_F,
802*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID4_F,
803*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID5_F,
804*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID6_F,
805*d6b92ffaSHans Petter Selasky 	IB_SA_GIR_GUID7_F,
806*d6b92ffaSHans Petter Selasky 
807*d6b92ffaSHans Petter Selasky 	/*
808*d6b92ffaSHans Petter Selasky 	 * More PortInfo fields
809*d6b92ffaSHans Petter Selasky 	 */
810*d6b92ffaSHans Petter Selasky 	IB_PORT_CAPMASK2_F,
811*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
812*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_EXT_SUPPORTED_F,
813*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_EXT_ENABLED_F,
814*d6b92ffaSHans Petter Selasky 	IB_PORT_LINK_SPEED_EXT_LAST_F,
815*d6b92ffaSHans Petter Selasky 
816*d6b92ffaSHans Petter Selasky 	/*
817*d6b92ffaSHans Petter Selasky 	 * PortExtendedSpeedsCounters fields
818*d6b92ffaSHans Petter Selasky 	 */
819*d6b92ffaSHans Petter Selasky 	IB_PESC_PORT_SELECT_F,
820*d6b92ffaSHans Petter Selasky 	IB_PESC_COUNTER_SELECT_F,
821*d6b92ffaSHans Petter Selasky 	IB_PESC_SYNC_HDR_ERR_CTR_F,
822*d6b92ffaSHans Petter Selasky 	IB_PESC_UNK_BLOCK_CTR_F,
823*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE0_F,
824*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE1_F,
825*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE2_F,
826*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE3_F,
827*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE4_F,
828*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE5_F,
829*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE6_F,
830*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE7_F,
831*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE8_F,
832*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE9_F,
833*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE10_F,
834*d6b92ffaSHans Petter Selasky 	IB_PESC_ERR_DET_CTR_LANE11_F,
835*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE0_F,
836*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE1_F,
837*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE2_F,
838*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE3_F,
839*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE4_F,
840*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE5_F,
841*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE6_F,
842*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE7_F,
843*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE8_F,
844*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE9_F,
845*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE10_F,
846*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_CORR_BLOCK_CTR_LANE11_F,
847*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE0_F,
848*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE1_F,
849*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE2_F,
850*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE3_F,
851*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE4_F,
852*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE5_F,
853*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE6_F,
854*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE7_F,
855*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE8_F,
856*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE9_F,
857*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE10_F,
858*d6b92ffaSHans Petter Selasky 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE11_F,
859*d6b92ffaSHans Petter Selasky 	IB_PESC_LAST_F,
860*d6b92ffaSHans Petter Selasky 
861*d6b92ffaSHans Petter Selasky 	/*
862*d6b92ffaSHans Petter Selasky 	 * PortOpRcvCounters fields
863*d6b92ffaSHans Petter Selasky 	 */
864*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_OP_RCV_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
865*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_OP_RCV_PKTS_F = IB_PC_PORT_OP_RCV_COUNTERS_FIRST_F,
866*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_OP_RCV_DATA_F,
867*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_OP_RCV_COUNTERS_LAST_F,
868*d6b92ffaSHans Petter Selasky 
869*d6b92ffaSHans Petter Selasky 	/*
870*d6b92ffaSHans Petter Selasky 	 * PortFlowCtlCounters fields
871*d6b92ffaSHans Petter Selasky 	 */
872*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_FLOW_CTL_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
873*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_XMIT_FLOW_PKTS_F = IB_PC_PORT_FLOW_CTL_COUNTERS_FIRST_F,
874*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_RCV_FLOW_PKTS_F,
875*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_FLOW_CTL_COUNTERS_LAST_F,
876*d6b92ffaSHans Petter Selasky 
877*d6b92ffaSHans Petter Selasky 	/*
878*d6b92ffaSHans Petter Selasky 	 * PortVLOpPackets fields
879*d6b92ffaSHans Petter Selasky 	 */
880*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
881*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS0_F = IB_PC_PORT_VL_OP_PACKETS_FIRST_F,
882*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS1_F,
883*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS2_F,
884*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS3_F,
885*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS4_F,
886*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS5_F,
887*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS6_F,
888*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS7_F,
889*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS8_F,
890*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS9_F,
891*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS10_F,
892*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS11_F,
893*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS12_F,
894*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS13_F,
895*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS14_F,
896*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS15_F,
897*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_PACKETS_LAST_F,
898*d6b92ffaSHans Petter Selasky 
899*d6b92ffaSHans Petter Selasky 	/*
900*d6b92ffaSHans Petter Selasky 	 * PortVLOpData fields
901*d6b92ffaSHans Petter Selasky 	 */
902*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
903*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA0_F = IB_PC_PORT_VL_OP_DATA_FIRST_F,
904*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA1_F,
905*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA2_F,
906*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA3_F,
907*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA4_F,
908*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA5_F,
909*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA6_F,
910*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA7_F,
911*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA8_F,
912*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA9_F,
913*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA10_F,
914*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA11_F,
915*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA12_F,
916*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA13_F,
917*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA14_F,
918*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA15_F,
919*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_OP_DATA_LAST_F,
920*d6b92ffaSHans Petter Selasky 
921*d6b92ffaSHans Petter Selasky 	/*
922*d6b92ffaSHans Petter Selasky 	 * PortVLXmitFlowCtlUpdateErrors fields
923*d6b92ffaSHans Petter Selasky 	 */
924*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
925*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS0_F = IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_FIRST_F,
926*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS1_F,
927*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS2_F,
928*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS3_F,
929*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS4_F,
930*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS5_F,
931*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS6_F,
932*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS7_F,
933*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS8_F,
934*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS9_F,
935*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS10_F,
936*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS11_F,
937*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS12_F,
938*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS13_F,
939*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS14_F,
940*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS15_F,
941*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_LAST_F,
942*d6b92ffaSHans Petter Selasky 
943*d6b92ffaSHans Petter Selasky 	/*
944*d6b92ffaSHans Petter Selasky 	 * PortVLXmitWaitCounters fields
945*d6b92ffaSHans Petter Selasky 	 */
946*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
947*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT0_F = IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_FIRST_F,
948*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT1_F,
949*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT2_F,
950*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT3_F,
951*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT4_F,
952*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT5_F,
953*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT6_F,
954*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT7_F,
955*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT8_F,
956*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT9_F,
957*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT10_F,
958*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT11_F,
959*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT12_F,
960*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT13_F,
961*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT14_F,
962*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT15_F,
963*d6b92ffaSHans Petter Selasky 	IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_LAST_F,
964*d6b92ffaSHans Petter Selasky 
965*d6b92ffaSHans Petter Selasky 	/*
966*d6b92ffaSHans Petter Selasky 	 * SwPortVLCongestion fields
967*d6b92ffaSHans Petter Selasky 	 */
968*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
969*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION0_F = IB_PC_SW_PORT_VL_CONGESTION_FIRST_F,
970*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION1_F,
971*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION2_F,
972*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION3_F,
973*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION4_F,
974*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION5_F,
975*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION6_F,
976*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION7_F,
977*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION8_F,
978*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION9_F,
979*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION10_F,
980*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION11_F,
981*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION12_F,
982*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION13_F,
983*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION14_F,
984*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION15_F,
985*d6b92ffaSHans Petter Selasky 	IB_PC_SW_PORT_VL_CONGESTION_LAST_F,
986*d6b92ffaSHans Petter Selasky 
987*d6b92ffaSHans Petter Selasky 	/*
988*d6b92ffaSHans Petter Selasky 	 * PortRcvConCtrl fields
989*d6b92ffaSHans Petter Selasky 	 */
990*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_CON_CTRL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
991*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_CON_CTRL_PKT_RCV_FECN_F = IB_PC_RCV_CON_CTRL_FIRST_F,
992*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_CON_CTRL_PKT_RCV_BECN_F,
993*d6b92ffaSHans Petter Selasky 	IB_PC_RCV_CON_CTRL_LAST_F,
994*d6b92ffaSHans Petter Selasky 
995*d6b92ffaSHans Petter Selasky 	/*
996*d6b92ffaSHans Petter Selasky 	 * PortSLRcvFECN fields
997*d6b92ffaSHans Petter Selasky 	 */
998*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
999*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN0_F = IB_PC_SL_RCV_FECN_FIRST_F,
1000*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN1_F,
1001*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN2_F,
1002*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN3_F,
1003*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN4_F,
1004*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN5_F,
1005*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN6_F,
1006*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN7_F,
1007*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN8_F,
1008*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN9_F,
1009*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN10_F,
1010*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN11_F,
1011*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN12_F,
1012*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN13_F,
1013*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN14_F,
1014*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN15_F,
1015*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_FECN_LAST_F,
1016*d6b92ffaSHans Petter Selasky 
1017*d6b92ffaSHans Petter Selasky 	/*
1018*d6b92ffaSHans Petter Selasky 	 * PortSLRcvBECN fields
1019*d6b92ffaSHans Petter Selasky 	 */
1020*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
1021*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN0_F = IB_PC_SL_RCV_BECN_FIRST_F,
1022*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN1_F,
1023*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN2_F,
1024*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN3_F,
1025*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN4_F,
1026*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN5_F,
1027*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN6_F,
1028*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN7_F,
1029*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN8_F,
1030*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN9_F,
1031*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN10_F,
1032*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN11_F,
1033*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN12_F,
1034*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN13_F,
1035*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN14_F,
1036*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN15_F,
1037*d6b92ffaSHans Petter Selasky 	IB_PC_SL_RCV_BECN_LAST_F,
1038*d6b92ffaSHans Petter Selasky 
1039*d6b92ffaSHans Petter Selasky 	/*
1040*d6b92ffaSHans Petter Selasky 	 * PortXmitConCtrl fields
1041*d6b92ffaSHans Petter Selasky 	 */
1042*d6b92ffaSHans Petter Selasky 	IB_PC_XMIT_CON_CTRL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
1043*d6b92ffaSHans Petter Selasky 	IB_PC_XMIT_CON_CTRL_TIME_CONG_F = IB_PC_XMIT_CON_CTRL_FIRST_F,
1044*d6b92ffaSHans Petter Selasky 	IB_PC_XMIT_CON_CTRL_LAST_F,
1045*d6b92ffaSHans Petter Selasky 
1046*d6b92ffaSHans Petter Selasky 	/*
1047*d6b92ffaSHans Petter Selasky 	 * PortVLXmitTimeCong fields
1048*d6b92ffaSHans Petter Selasky 	 */
1049*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
1050*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG0_F = IB_PC_VL_XMIT_TIME_CONG_FIRST_F,
1051*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG1_F,
1052*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG2_F,
1053*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG3_F,
1054*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG4_F,
1055*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG5_F,
1056*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG6_F,
1057*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG7_F,
1058*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG8_F,
1059*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG9_F,
1060*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG10_F,
1061*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG11_F,
1062*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG12_F,
1063*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG13_F,
1064*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG14_F,
1065*d6b92ffaSHans Petter Selasky 	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
1066*d6b92ffaSHans Petter Selasky 
1067*d6b92ffaSHans Petter Selasky 	/*
1068*d6b92ffaSHans Petter Selasky 	 * Mellanox ExtendedPortInfo fields
1069*d6b92ffaSHans Petter Selasky 	 */
1070*d6b92ffaSHans Petter Selasky 	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
1071*d6b92ffaSHans Petter Selasky 	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
1072*d6b92ffaSHans Petter Selasky 	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
1073*d6b92ffaSHans Petter Selasky 	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
1074*d6b92ffaSHans Petter Selasky 	IB_MLNX_EXT_PORT_LAST_F,
1075*d6b92ffaSHans Petter Selasky 
1076*d6b92ffaSHans Petter Selasky 	/*
1077*d6b92ffaSHans Petter Selasky 	 * Congestion Control Mad fields
1078*d6b92ffaSHans Petter Selasky 	 * bytes 24-31 of congestion control mad
1079*d6b92ffaSHans Petter Selasky 	 */
1080*d6b92ffaSHans Petter Selasky 	IB_CC_CCKEY_F,
1081*d6b92ffaSHans Petter Selasky 
1082*d6b92ffaSHans Petter Selasky 	/*
1083*d6b92ffaSHans Petter Selasky 	 * CongestionInfo fields
1084*d6b92ffaSHans Petter Selasky 	 */
1085*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_INFO_FIRST_F,
1086*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_INFO_F = IB_CC_CONGESTION_INFO_FIRST_F,
1087*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_INFO_CONTROL_TABLE_CAP_F,
1088*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_INFO_LAST_F,
1089*d6b92ffaSHans Petter Selasky 
1090*d6b92ffaSHans Petter Selasky 	/*
1091*d6b92ffaSHans Petter Selasky 	 * CongestionKeyInfo fields
1092*d6b92ffaSHans Petter Selasky 	 */
1093*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_FIRST_F,
1094*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_CC_KEY_F = IB_CC_CONGESTION_KEY_INFO_FIRST_F,
1095*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_CC_KEY_PROTECT_BIT_F,
1096*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_CC_KEY_LEASE_PERIOD_F,
1097*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_CC_KEY_VIOLATIONS_F,
1098*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_KEY_INFO_LAST_F,
1099*d6b92ffaSHans Petter Selasky 
1100*d6b92ffaSHans Petter Selasky 	/*
1101*d6b92ffaSHans Petter Selasky 	 * CongestionLog (common) fields
1102*d6b92ffaSHans Petter Selasky 	 */
1103*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_FIRST_F,
1104*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_LOGTYPE_F = IB_CC_CONGESTION_LOG_FIRST_F,
1105*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CONGESTION_FLAGS_F,
1106*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_LAST_F,
1107*d6b92ffaSHans Petter Selasky 
1108*d6b92ffaSHans Petter Selasky 	/*
1109*d6b92ffaSHans Petter Selasky 	 * CongestionLog (Switch) fields
1110*d6b92ffaSHans Petter Selasky 	 */
1111*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_SWITCH_FIRST_F,
1112*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_SWITCH_LOG_EVENTS_COUNTER_F = IB_CC_CONGESTION_LOG_SWITCH_FIRST_F,
1113*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_SWITCH_CURRENT_TIME_STAMP_F,
1114*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_SWITCH_PORTMAP_F,
1115*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_SWITCH_LAST_F,
1116*d6b92ffaSHans Petter Selasky 
1117*d6b92ffaSHans Petter Selasky 	/*
1118*d6b92ffaSHans Petter Selasky 	 * CongestionLogEvent (Switch) fields
1119*d6b92ffaSHans Petter Selasky 	 */
1120*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_FIRST_F,
1121*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_SLID_F = IB_CC_CONGESTION_LOG_ENTRY_SWITCH_FIRST_F,
1122*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_DLID_F,
1123*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_SL_F,
1124*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_TIMESTAMP_F,
1125*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_LAST_F,
1126*d6b92ffaSHans Petter Selasky 
1127*d6b92ffaSHans Petter Selasky 	/*
1128*d6b92ffaSHans Petter Selasky 	 * CongestionLog (CA) fields
1129*d6b92ffaSHans Petter Selasky 	 */
1130*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CA_FIRST_F,
1131*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CA_THRESHOLD_EVENT_COUNTER_F = IB_CC_CONGESTION_LOG_CA_FIRST_F,
1132*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CA_THRESHOLD_CONGESTION_EVENT_MAP_F,
1133*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CA_CURRENT_TIMESTAMP_F,
1134*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_CA_LAST_F,
1135*d6b92ffaSHans Petter Selasky 
1136*d6b92ffaSHans Petter Selasky 	/*
1137*d6b92ffaSHans Petter Selasky 	 * CongestionLogEvent (CA) fields
1138*d6b92ffaSHans Petter Selasky 	 */
1139*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_FIRST_F,
1140*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_LOCAL_QP_CN_ENTRY_F = IB_CC_CONGESTION_LOG_ENTRY_CA_FIRST_F,
1141*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_SL_CN_ENTRY_F,
1142*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_SERVICE_TYPE_CN_ENTRY_F,
1143*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_REMOTE_QP_NUMBER_CN_ENTRY_F,
1144*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_LOCAL_LID_CN_F,
1145*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_REMOTE_LID_CN_ENTRY_F,
1146*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_TIMESTAMP_CN_ENTRY_F,
1147*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_LOG_ENTRY_CA_LAST_F,
1148*d6b92ffaSHans Petter Selasky 
1149*d6b92ffaSHans Petter Selasky 	/*
1150*d6b92ffaSHans Petter Selasky 	 * SwitchCongestionSetting fields
1151*d6b92ffaSHans Petter Selasky 	 */
1152*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_FIRST_F,
1153*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_CONTROL_MAP_F = IB_CC_SWITCH_CONGESTION_SETTING_FIRST_F,
1154*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_VICTIM_MASK_F,
1155*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_CREDIT_MASK_F,
1156*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_THRESHOLD_F,
1157*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_PACKET_SIZE_F,
1158*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_CS_THRESHOLD_F,
1159*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_CS_RETURN_DELAY_F,
1160*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_MARKING_RATE_F,
1161*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_CONGESTION_SETTING_LAST_F,
1162*d6b92ffaSHans Petter Selasky 
1163*d6b92ffaSHans Petter Selasky 	/*
1164*d6b92ffaSHans Petter Selasky 	 * SwitchPortCongestionSettingElement fields
1165*d6b92ffaSHans Petter Selasky 	 */
1166*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_FIRST_F,
1167*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_VALID_F = IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_FIRST_F,
1168*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONTROL_TYPE_F,
1169*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_THRESHOLD_F,
1170*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_PACKET_SIZE_F,
1171*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONG_PARM_MARKING_RATE_F,
1172*d6b92ffaSHans Petter Selasky 	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_LAST_F,
1173*d6b92ffaSHans Petter Selasky 
1174*d6b92ffaSHans Petter Selasky 	/*
1175*d6b92ffaSHans Petter Selasky 	 * CACongestionSetting fields
1176*d6b92ffaSHans Petter Selasky 	 */
1177*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_SETTING_FIRST_F,
1178*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_SETTING_PORT_CONTROL_F = IB_CC_CA_CONGESTION_SETTING_FIRST_F,
1179*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_SETTING_CONTROL_MAP_F,
1180*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_SETTING_LAST_F,
1181*d6b92ffaSHans Petter Selasky 
1182*d6b92ffaSHans Petter Selasky 	/*
1183*d6b92ffaSHans Petter Selasky 	 * CACongestionEntry fields
1184*d6b92ffaSHans Petter Selasky 	 */
1185*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_FIRST_F,
1186*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_CCTI_TIMER_F = IB_CC_CA_CONGESTION_ENTRY_FIRST_F,
1187*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_CCTI_INCREASE_F,
1188*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_TRIGGER_THRESHOLD_F,
1189*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_CCTI_MIN_F,
1190*d6b92ffaSHans Petter Selasky 	IB_CC_CA_CONGESTION_ENTRY_LAST_F,
1191*d6b92ffaSHans Petter Selasky 
1192*d6b92ffaSHans Petter Selasky 	/*
1193*d6b92ffaSHans Petter Selasky 	 * CongestionControlTable fields
1194*d6b92ffaSHans Petter Selasky 	 */
1195*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_FIRST_F,
1196*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_CCTI_LIMIT_F = IB_CC_CONGESTION_CONTROL_TABLE_FIRST_F,
1197*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_LAST_F,
1198*d6b92ffaSHans Petter Selasky 
1199*d6b92ffaSHans Petter Selasky 	/*
1200*d6b92ffaSHans Petter Selasky 	 * CongestionControlTableEntry fields
1201*d6b92ffaSHans Petter Selasky 	 */
1202*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_FIRST_F,
1203*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_SHIFT_F = IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_FIRST_F,
1204*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_MULTIPLIER_F,
1205*d6b92ffaSHans Petter Selasky 	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_LAST_F,
1206*d6b92ffaSHans Petter Selasky 
1207*d6b92ffaSHans Petter Selasky 	/*
1208*d6b92ffaSHans Petter Selasky 	 * Timestamp fields
1209*d6b92ffaSHans Petter Selasky 	 */
1210*d6b92ffaSHans Petter Selasky 	IB_CC_TIMESTAMP_FIRST_F,
1211*d6b92ffaSHans Petter Selasky 	IB_CC_TIMESTAMP_F = IB_CC_TIMESTAMP_FIRST_F,
1212*d6b92ffaSHans Petter Selasky 	IB_CC_TIMESTAMP_LAST_F,
1213*d6b92ffaSHans Petter Selasky 
1214*d6b92ffaSHans Petter Selasky 	/*
1215*d6b92ffaSHans Petter Selasky 	 * Node Record
1216*d6b92ffaSHans Petter Selasky 	 */
1217*d6b92ffaSHans Petter Selasky 	IB_SA_NR_FIRST_F,
1218*d6b92ffaSHans Petter Selasky 	IB_SA_NR_LID_F = IB_SA_NR_FIRST_F,
1219*d6b92ffaSHans Petter Selasky 	IB_SA_NR_BASEVER_F,
1220*d6b92ffaSHans Petter Selasky 	IB_SA_NR_CLASSVER_F,
1221*d6b92ffaSHans Petter Selasky 	IB_SA_NR_TYPE_F,
1222*d6b92ffaSHans Petter Selasky 	IB_SA_NR_NPORTS_F,
1223*d6b92ffaSHans Petter Selasky 	IB_SA_NR_SYSTEM_GUID_F,
1224*d6b92ffaSHans Petter Selasky 	IB_SA_NR_GUID_F,
1225*d6b92ffaSHans Petter Selasky 	IB_SA_NR_PORT_GUID_F,
1226*d6b92ffaSHans Petter Selasky 	IB_SA_NR_PARTITION_CAP_F,
1227*d6b92ffaSHans Petter Selasky 	IB_SA_NR_DEVID_F,
1228*d6b92ffaSHans Petter Selasky 	IB_SA_NR_REVISION_F,
1229*d6b92ffaSHans Petter Selasky 	IB_SA_NR_LOCAL_PORT_F,
1230*d6b92ffaSHans Petter Selasky 	IB_SA_NR_VENDORID_F,
1231*d6b92ffaSHans Petter Selasky 	IB_SA_NR_NODEDESC_F,
1232*d6b92ffaSHans Petter Selasky 	IB_SA_NR_LAST_F,
1233*d6b92ffaSHans Petter Selasky 
1234*d6b92ffaSHans Petter Selasky 	/*
1235*d6b92ffaSHans Petter Selasky 	 * PortMirrorRoute fields
1236*d6b92ffaSHans Petter Selasky 	 */
1237*d6b92ffaSHans Petter Selasky 	IB_PMR_FIRST_F,
1238*d6b92ffaSHans Petter Selasky 	IB_PMR_ENCAP_RAW_ETH_TYPE_F = IB_PMR_FIRST_F,
1239*d6b92ffaSHans Petter Selasky 	IB_PMR_MAX_MIRROR_LEN_F,
1240*d6b92ffaSHans Petter Selasky 	IB_PMR_MT_F,
1241*d6b92ffaSHans Petter Selasky 	IB_PMR_BF_F,
1242*d6b92ffaSHans Petter Selasky 	IB_PMR_NM_PORT_F,
1243*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_VL_F,
1244*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_LVER_F,
1245*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_SL_F,
1246*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_LNH_F,
1247*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_DLID_F,
1248*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_LEN_F,
1249*d6b92ffaSHans Petter Selasky 	IB_PMR_LRH_SLID_F,
1250*d6b92ffaSHans Petter Selasky 	IB_PMR_LAST_F,
1251*d6b92ffaSHans Petter Selasky 
1252*d6b92ffaSHans Petter Selasky 	/*
1253*d6b92ffaSHans Petter Selasky 	 * PortMirrorFilter fields
1254*d6b92ffaSHans Petter Selasky 	 */
1255*d6b92ffaSHans Petter Selasky 	IB_PMF_FIRST_F,
1256*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_FILTER0_F = IB_PMF_FIRST_F,
1257*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_FILTER1_F,
1258*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK0_F,
1259*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK1_F,
1260*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK2_F,
1261*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK3_F,
1262*d6b92ffaSHans Petter Selasky 	IB_PMF_B0_F,
1263*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK_OFFS_0,
1264*d6b92ffaSHans Petter Selasky 	IB_PMF_B1_F,
1265*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK_OFFS_1,
1266*d6b92ffaSHans Petter Selasky 	IB_PMF_B2_F,
1267*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK_OFFS_2,
1268*d6b92ffaSHans Petter Selasky 	IB_PMF_B3_F,
1269*d6b92ffaSHans Petter Selasky 	IB_PMF_MIRROR_MASK_OFFS_3,
1270*d6b92ffaSHans Petter Selasky 	IB_PMF_LAST_F,
1271*d6b92ffaSHans Petter Selasky 
1272*d6b92ffaSHans Petter Selasky 	/*
1273*d6b92ffaSHans Petter Selasky 	 * PortMirrorPorts fields
1274*d6b92ffaSHans Petter Selasky 	 */
1275*d6b92ffaSHans Petter Selasky 	IB_PMP_FIRST_F,
1276*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_1_F = IB_PMP_FIRST_F,
1277*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_1_F,
1278*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_2_F,
1279*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_2_F,
1280*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_3_F,
1281*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_3_F,
1282*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_4_F,
1283*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_4_F,
1284*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_5_F,
1285*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_5_F,
1286*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_6_F,
1287*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_6_F,
1288*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_7_F,
1289*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_7_F,
1290*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_8_F,
1291*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_8_F,
1292*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_9_F,
1293*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_9_F,
1294*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_10_F,
1295*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_10_F,
1296*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_11_F,
1297*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_11_F,
1298*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_12_F,
1299*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_12_F,
1300*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_13_F,
1301*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_13_F,
1302*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_14_F,
1303*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_14_F,
1304*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_15_F,
1305*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_15_F,
1306*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_16_F,
1307*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_16_F,
1308*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_17_F,
1309*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_17_F,
1310*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_18_F,
1311*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_18_F,
1312*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_19_F,
1313*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_19_F,
1314*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_20_F,
1315*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_20_F,
1316*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_21_F,
1317*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_21_F,
1318*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_22_F,
1319*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_22_F,
1320*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_23_F,
1321*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_23_F,
1322*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_24_F,
1323*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_24_F,
1324*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_25_F,
1325*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_25_F,
1326*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_26_F,
1327*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_26_F,
1328*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_27_F,
1329*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_27_F,
1330*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_28_F,
1331*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_28_F,
1332*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_29_F,
1333*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_29_F,
1334*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_30_F,
1335*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_30_F,
1336*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_31_F,
1337*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_31_F,
1338*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_32_F,
1339*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_32_F,
1340*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_33_F,
1341*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_33_F,
1342*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_34_F,
1343*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_34_F,
1344*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_35_F,
1345*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_35_F,
1346*d6b92ffaSHans Petter Selasky 	IB_PMP_TQ_36_F,
1347*d6b92ffaSHans Petter Selasky 	IB_PMP_RQ_36_F,
1348*d6b92ffaSHans Petter Selasky 	IB_PMP_LAST_F,
1349*d6b92ffaSHans Petter Selasky 
1350*d6b92ffaSHans Petter Selasky 	/*
1351*d6b92ffaSHans Petter Selasky 	 * PortSamplesResult fields
1352*d6b92ffaSHans Petter Selasky 	 */
1353*d6b92ffaSHans Petter Selasky 	IB_PSR_TAG_F,
1354*d6b92ffaSHans Petter Selasky 	IB_PSR_SAMPLE_STATUS_F,
1355*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER0_F,
1356*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER1_F,
1357*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER2_F,
1358*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER3_F,
1359*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER4_F,
1360*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER5_F,
1361*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER6_F,
1362*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER7_F,
1363*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER8_F,
1364*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER9_F,
1365*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER10_F,
1366*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER11_F,
1367*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER12_F,
1368*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER13_F,
1369*d6b92ffaSHans Petter Selasky 	IB_PSR_COUNTER14_F,
1370*d6b92ffaSHans Petter Selasky 	IB_PSR_LAST_F,
1371*d6b92ffaSHans Petter Selasky 
1372*d6b92ffaSHans Petter Selasky 	/*
1373*d6b92ffaSHans Petter Selasky 	 * PortInfoExtended fields
1374*d6b92ffaSHans Petter Selasky 	 */
1375*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_FIRST_F,
1376*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_CAPMASK_F = IB_PORT_EXT_FIRST_F,
1377*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_FEC_MODE_ACTIVE_F,
1378*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_FDR_FEC_MODE_SUPPORTED_F,
1379*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_FDR_FEC_MODE_ENABLED_F,
1380*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_EDR_FEC_MODE_SUPPORTED_F,
1381*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_EDR_FEC_MODE_ENABLED_F,
1382*d6b92ffaSHans Petter Selasky 	IB_PORT_EXT_LAST_F,
1383*d6b92ffaSHans Petter Selasky 
1384*d6b92ffaSHans Petter Selasky 	/*
1385*d6b92ffaSHans Petter Selasky 	 * PortExtendedSpeedsCounters RSFEC active fields
1386*d6b92ffaSHans Petter Selasky 	 */
1387*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_PORT_SELECT_F,
1388*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_COUNTER_SELECT_F,
1389*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_SYNC_HDR_ERR_CTR_F,
1390*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_UNK_BLOCK_CTR_F,
1391*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE0_F,
1392*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE1_F,
1393*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE2_F,
1394*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE3_F,
1395*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE4_F,
1396*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE5_F,
1397*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE6_F,
1398*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE7_F,
1399*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE8_F,
1400*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE9_F,
1401*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE10_F,
1402*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_FEC_CORR_SYMBOL_CTR_LANE11_F,
1403*d6b92ffaSHans Petter Selasky 	IB_PESC_PORT_FEC_CORR_BLOCK_CTR_F,
1404*d6b92ffaSHans Petter Selasky 	IB_PESC_PORT_FEC_UNCORR_BLOCK_CTR_F,
1405*d6b92ffaSHans Petter Selasky 	IB_PESC_PORT_FEC_CORR_SYMBOL_CTR_F,
1406*d6b92ffaSHans Petter Selasky 	IB_PESC_RSFEC_LAST_F,
1407*d6b92ffaSHans Petter Selasky 
1408*d6b92ffaSHans Petter Selasky 	/*
1409*d6b92ffaSHans Petter Selasky 	 * More PortCountersExtended fields
1410*d6b92ffaSHans Petter Selasky 	 */
1411*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_COUNTER_SELECT2_F,
1412*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_SYM_F,
1413*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_LINK_RECOVERS_F,
1414*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_LINK_DOWNED_F,
1415*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_RCV_F,
1416*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_PHYSRCV_F,
1417*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_SWITCH_REL_F,
1418*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_DISCARDS_F,
1419*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_XMTCONSTR_F,
1420*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_RCVCONSTR_F,
1421*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_LOCALINTEG_F,
1422*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_EXCESS_OVR_F,
1423*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_VL15_DROPPED_F,
1424*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_XMT_WAIT_F,
1425*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_QP1_DROP_F,
1426*d6b92ffaSHans Petter Selasky 	IB_PC_EXT_ERR_LAST_F,
1427*d6b92ffaSHans Petter Selasky 
1428*d6b92ffaSHans Petter Selasky 	/*
1429*d6b92ffaSHans Petter Selasky 	 * Another PortCounters field
1430*d6b92ffaSHans Petter Selasky 	 */
1431*d6b92ffaSHans Petter Selasky 	IB_PC_QP1_DROP_F,
1432*d6b92ffaSHans Petter Selasky 
1433*d6b92ffaSHans Petter Selasky 	IB_FIELD_LAST_		/* must be last */
1434*d6b92ffaSHans Petter Selasky };
1435*d6b92ffaSHans Petter Selasky 
1436*d6b92ffaSHans Petter Selasky /*
1437*d6b92ffaSHans Petter Selasky  * SA RMPP section
1438*d6b92ffaSHans Petter Selasky  */
1439*d6b92ffaSHans Petter Selasky enum RMPP_TYPE_ENUM {
1440*d6b92ffaSHans Petter Selasky 	IB_RMPP_TYPE_NONE,
1441*d6b92ffaSHans Petter Selasky 	IB_RMPP_TYPE_DATA,
1442*d6b92ffaSHans Petter Selasky 	IB_RMPP_TYPE_ACK,
1443*d6b92ffaSHans Petter Selasky 	IB_RMPP_TYPE_STOP,
1444*d6b92ffaSHans Petter Selasky 	IB_RMPP_TYPE_ABORT,
1445*d6b92ffaSHans Petter Selasky };
1446*d6b92ffaSHans Petter Selasky 
1447*d6b92ffaSHans Petter Selasky enum RMPP_FLAGS_ENUM {
1448*d6b92ffaSHans Petter Selasky 	IB_RMPP_FLAG_ACTIVE = 1 << 0,
1449*d6b92ffaSHans Petter Selasky 	IB_RMPP_FLAG_FIRST = 1 << 1,
1450*d6b92ffaSHans Petter Selasky 	IB_RMPP_FLAG_LAST = 1 << 2,
1451*d6b92ffaSHans Petter Selasky };
1452*d6b92ffaSHans Petter Selasky 
1453*d6b92ffaSHans Petter Selasky typedef struct {
1454*d6b92ffaSHans Petter Selasky 	int type;
1455*d6b92ffaSHans Petter Selasky 	int flags;
1456*d6b92ffaSHans Petter Selasky 	int status;
1457*d6b92ffaSHans Petter Selasky 	union {
1458*d6b92ffaSHans Petter Selasky 		uint32_t u;
1459*d6b92ffaSHans Petter Selasky 		uint32_t segnum;
1460*d6b92ffaSHans Petter Selasky 	} d1;
1461*d6b92ffaSHans Petter Selasky 	union {
1462*d6b92ffaSHans Petter Selasky 		uint32_t u;
1463*d6b92ffaSHans Petter Selasky 		uint32_t len;
1464*d6b92ffaSHans Petter Selasky 		uint32_t newwin;
1465*d6b92ffaSHans Petter Selasky 	} d2;
1466*d6b92ffaSHans Petter Selasky } ib_rmpp_hdr_t;
1467*d6b92ffaSHans Petter Selasky 
1468*d6b92ffaSHans Petter Selasky enum SA_SIZES_ENUM {
1469*d6b92ffaSHans Petter Selasky 	SA_HEADER_SZ = 20,
1470*d6b92ffaSHans Petter Selasky };
1471*d6b92ffaSHans Petter Selasky 
1472*d6b92ffaSHans Petter Selasky typedef struct ib_sa_call {
1473*d6b92ffaSHans Petter Selasky 	unsigned attrid;
1474*d6b92ffaSHans Petter Selasky 	unsigned mod;
1475*d6b92ffaSHans Petter Selasky 	uint64_t mask;
1476*d6b92ffaSHans Petter Selasky 	unsigned method;
1477*d6b92ffaSHans Petter Selasky 
1478*d6b92ffaSHans Petter Selasky 	uint64_t trid;		/* used for out mad if nonzero, return real val */
1479*d6b92ffaSHans Petter Selasky 	unsigned recsz;		/* return field */
1480*d6b92ffaSHans Petter Selasky 	ib_rmpp_hdr_t rmpp;
1481*d6b92ffaSHans Petter Selasky } ib_sa_call_t;
1482*d6b92ffaSHans Petter Selasky 
1483*d6b92ffaSHans Petter Selasky typedef struct ib_vendor_call {
1484*d6b92ffaSHans Petter Selasky 	unsigned method;
1485*d6b92ffaSHans Petter Selasky 	unsigned mgmt_class;
1486*d6b92ffaSHans Petter Selasky 	unsigned attrid;
1487*d6b92ffaSHans Petter Selasky 	unsigned mod;
1488*d6b92ffaSHans Petter Selasky 	uint32_t oui;
1489*d6b92ffaSHans Petter Selasky 	unsigned timeout;
1490*d6b92ffaSHans Petter Selasky 	ib_rmpp_hdr_t rmpp;
1491*d6b92ffaSHans Petter Selasky } ib_vendor_call_t;
1492*d6b92ffaSHans Petter Selasky 
1493*d6b92ffaSHans Petter Selasky typedef struct ib_bm_call {
1494*d6b92ffaSHans Petter Selasky 	unsigned method;
1495*d6b92ffaSHans Petter Selasky 	unsigned attrid;
1496*d6b92ffaSHans Petter Selasky 	unsigned mod;
1497*d6b92ffaSHans Petter Selasky 	unsigned timeout;
1498*d6b92ffaSHans Petter Selasky 	uint64_t bkey;
1499*d6b92ffaSHans Petter Selasky } ib_bm_call_t;
1500*d6b92ffaSHans Petter Selasky 
1501*d6b92ffaSHans Petter Selasky #define IB_MIN_UCAST_LID	1
1502*d6b92ffaSHans Petter Selasky #define IB_MAX_UCAST_LID	(0xc000-1)
1503*d6b92ffaSHans Petter Selasky #define IB_MIN_MCAST_LID	0xc000
1504*d6b92ffaSHans Petter Selasky #define IB_MAX_MCAST_LID	(0xffff-1)
1505*d6b92ffaSHans Petter Selasky 
1506*d6b92ffaSHans Petter Selasky #define IB_LID_VALID(lid)	((lid) >= IB_MIN_UCAST_LID && lid <= IB_MAX_UCAST_LID)
1507*d6b92ffaSHans Petter Selasky #define IB_MLID_VALID(lid)	((lid) >= IB_MIN_MCAST_LID && lid <= IB_MAX_MCAST_LID)
1508*d6b92ffaSHans Petter Selasky 
1509*d6b92ffaSHans Petter Selasky #define MAD_DEF_RETRIES		3
1510*d6b92ffaSHans Petter Selasky #define MAD_DEF_TIMEOUT_MS	1000
1511*d6b92ffaSHans Petter Selasky 
1512*d6b92ffaSHans Petter Selasky enum MAD_DEST {
1513*d6b92ffaSHans Petter Selasky 	IB_DEST_LID,
1514*d6b92ffaSHans Petter Selasky 	IB_DEST_DRPATH,
1515*d6b92ffaSHans Petter Selasky 	IB_DEST_GUID,
1516*d6b92ffaSHans Petter Selasky 	IB_DEST_DRSLID,
1517*d6b92ffaSHans Petter Selasky 	IB_DEST_GID
1518*d6b92ffaSHans Petter Selasky };
1519*d6b92ffaSHans Petter Selasky 
1520*d6b92ffaSHans Petter Selasky enum MAD_NODE_TYPE {
1521*d6b92ffaSHans Petter Selasky 	IB_NODE_CA = 1,
1522*d6b92ffaSHans Petter Selasky 	IB_NODE_SWITCH,
1523*d6b92ffaSHans Petter Selasky 	IB_NODE_ROUTER,
1524*d6b92ffaSHans Petter Selasky 	NODE_RNIC,
1525*d6b92ffaSHans Petter Selasky 
1526*d6b92ffaSHans Petter Selasky 	IB_NODE_MAX = NODE_RNIC
1527*d6b92ffaSHans Petter Selasky };
1528*d6b92ffaSHans Petter Selasky 
1529*d6b92ffaSHans Petter Selasky /******************************************************************************/
1530*d6b92ffaSHans Petter Selasky 
1531*d6b92ffaSHans Petter Selasky /* portid.c */
1532*d6b92ffaSHans Petter Selasky MAD_EXPORT char *portid2str(ib_portid_t * portid);
1533*d6b92ffaSHans Petter Selasky MAD_EXPORT int portid2portnum(ib_portid_t * portid);
1534*d6b92ffaSHans Petter Selasky MAD_EXPORT int str2drpath(ib_dr_path_t * path, char *routepath, int drslid,
1535*d6b92ffaSHans Petter Selasky 			  int drdlid);
1536*d6b92ffaSHans Petter Selasky MAD_EXPORT char *drpath2str(ib_dr_path_t * path, char *dstr, size_t dstr_size);
1537*d6b92ffaSHans Petter Selasky 
ib_portid_set(ib_portid_t * portid,int lid,int qp,int qkey)1538*d6b92ffaSHans Petter Selasky static inline int ib_portid_set(ib_portid_t * portid, int lid, int qp, int qkey)
1539*d6b92ffaSHans Petter Selasky {
1540*d6b92ffaSHans Petter Selasky 	portid->lid = lid;
1541*d6b92ffaSHans Petter Selasky 	portid->qp = qp;
1542*d6b92ffaSHans Petter Selasky 	portid->qkey = qkey;
1543*d6b92ffaSHans Petter Selasky 	portid->grh_present = 0;
1544*d6b92ffaSHans Petter Selasky 
1545*d6b92ffaSHans Petter Selasky 	return 0;
1546*d6b92ffaSHans Petter Selasky }
1547*d6b92ffaSHans Petter Selasky 
1548*d6b92ffaSHans Petter Selasky /* fields.c */
1549*d6b92ffaSHans Petter Selasky MAD_EXPORT uint32_t mad_get_field(void *buf, int base_offs,
1550*d6b92ffaSHans Petter Selasky 				  enum MAD_FIELDS field);
1551*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_set_field(void *buf, int base_offs, enum MAD_FIELDS field,
1552*d6b92ffaSHans Petter Selasky 			      uint32_t val);
1553*d6b92ffaSHans Petter Selasky /* field must be byte aligned */
1554*d6b92ffaSHans Petter Selasky MAD_EXPORT uint64_t mad_get_field64(void *buf, int base_offs,
1555*d6b92ffaSHans Petter Selasky 				    enum MAD_FIELDS field);
1556*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_set_field64(void *buf, int base_offs, enum MAD_FIELDS field,
1557*d6b92ffaSHans Petter Selasky 				uint64_t val);
1558*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_set_array(void *buf, int base_offs, enum MAD_FIELDS field,
1559*d6b92ffaSHans Petter Selasky 			      void *val);
1560*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_get_array(void *buf, int base_offs, enum MAD_FIELDS field,
1561*d6b92ffaSHans Petter Selasky 			      void *val);
1562*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_decode_field(uint8_t * buf, enum MAD_FIELDS field,
1563*d6b92ffaSHans Petter Selasky 				 void *val);
1564*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_encode_field(uint8_t * buf, enum MAD_FIELDS field,
1565*d6b92ffaSHans Petter Selasky 				 void *val);
1566*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_print_field(enum MAD_FIELDS field, const char *name,
1567*d6b92ffaSHans Petter Selasky 			       void *val);
1568*d6b92ffaSHans Petter Selasky MAD_EXPORT char *mad_dump_field(enum MAD_FIELDS field, char *buf, int bufsz,
1569*d6b92ffaSHans Petter Selasky 				void *val);
1570*d6b92ffaSHans Petter Selasky MAD_EXPORT char *mad_dump_val(enum MAD_FIELDS field, char *buf, int bufsz,
1571*d6b92ffaSHans Petter Selasky 			      void *val);
1572*d6b92ffaSHans Petter Selasky MAD_EXPORT const char *mad_field_name(enum MAD_FIELDS field);
1573*d6b92ffaSHans Petter Selasky 
1574*d6b92ffaSHans Petter Selasky /* mad.c */
1575*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_encode(void *buf, ib_rpc_t * rpc, ib_dr_path_t * drpath,
1576*d6b92ffaSHans Petter Selasky 			    void *data);
1577*d6b92ffaSHans Petter Selasky MAD_EXPORT uint64_t mad_trid(void);
1578*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_build_pkt(void *umad, ib_rpc_t * rpc, ib_portid_t * dport,
1579*d6b92ffaSHans Petter Selasky 			     ib_rmpp_hdr_t * rmpp, void *data);
1580*d6b92ffaSHans Petter Selasky 
1581*d6b92ffaSHans Petter Selasky /* New interface */
1582*d6b92ffaSHans Petter Selasky MAD_EXPORT void madrpc_show_errors(int set);
1583*d6b92ffaSHans Petter Selasky MAD_EXPORT int madrpc_set_retries(int retries);
1584*d6b92ffaSHans Petter Selasky MAD_EXPORT int madrpc_set_timeout(int timeout);
1585*d6b92ffaSHans Petter Selasky MAD_EXPORT struct ibmad_port *mad_rpc_open_port(char *dev_name, int dev_port,
1586*d6b92ffaSHans Petter Selasky 						int *mgmt_classes,
1587*d6b92ffaSHans Petter Selasky 						int num_classes);
1588*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_rpc_close_port(struct ibmad_port *srcport);
1589*d6b92ffaSHans Petter Selasky 
1590*d6b92ffaSHans Petter Selasky /*
1591*d6b92ffaSHans Petter Selasky  * On redirection, the dport argument is updated with the redirection target,
1592*d6b92ffaSHans Petter Selasky  * so subsequent MADs will not go through the redirection process again but
1593*d6b92ffaSHans Petter Selasky  * reach the target directly.
1594*d6b92ffaSHans Petter Selasky  */
1595*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_rpc(const struct ibmad_port *srcport, ib_rpc_t * rpc,
1596*d6b92ffaSHans Petter Selasky 			 ib_portid_t * dport, void *payload, void *rcvdata);
1597*d6b92ffaSHans Petter Selasky 
1598*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_rpc_rmpp(const struct ibmad_port *srcport, ib_rpc_t * rpc,
1599*d6b92ffaSHans Petter Selasky 			      ib_portid_t * dport, ib_rmpp_hdr_t * rmpp,
1600*d6b92ffaSHans Petter Selasky 			      void *data);
1601*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_rpc_portid(struct ibmad_port *srcport);
1602*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_rpc_set_retries(struct ibmad_port *port, int retries);
1603*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_rpc_set_timeout(struct ibmad_port *port, int timeout);
1604*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_rpc_class_agent(struct ibmad_port *srcport, int cls);
1605*d6b92ffaSHans Petter Selasky 
1606*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_get_timeout(const struct ibmad_port *srcport,
1607*d6b92ffaSHans Petter Selasky 			       int override_ms);
1608*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_get_retries(const struct ibmad_port *srcport);
1609*d6b92ffaSHans Petter Selasky 
1610*d6b92ffaSHans Petter Selasky /* register.c */
1611*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_register_port_client(int port_id, int mgmt,
1612*d6b92ffaSHans Petter Selasky 					uint8_t rmpp_version);
1613*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_register_client(int mgmt, uint8_t rmpp_version) DEPRECATED;
1614*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_register_server(int mgmt, uint8_t rmpp_version,
1615*d6b92ffaSHans Petter Selasky 				   long method_mask[16 / sizeof(long)],
1616*d6b92ffaSHans Petter Selasky 				   uint32_t class_oui) DEPRECATED;
1617*d6b92ffaSHans Petter Selasky /* register.c new interface */
1618*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_register_client_via(int mgmt, uint8_t rmpp_version,
1619*d6b92ffaSHans Petter Selasky 				       struct ibmad_port *srcport);
1620*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_register_server_via(int mgmt, uint8_t rmpp_version,
1621*d6b92ffaSHans Petter Selasky 				       long method_mask[16 / sizeof(long)],
1622*d6b92ffaSHans Petter Selasky 				       uint32_t class_oui,
1623*d6b92ffaSHans Petter Selasky 				       struct ibmad_port *srcport);
1624*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_class_agent(int mgmt) DEPRECATED;
1625*d6b92ffaSHans Petter Selasky 
1626*d6b92ffaSHans Petter Selasky /* serv.c */
1627*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_send(ib_rpc_t * rpc, ib_portid_t * dport,
1628*d6b92ffaSHans Petter Selasky 			ib_rmpp_hdr_t * rmpp, void *data) DEPRECATED;
1629*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_receive(void *umad, int timeout) DEPRECATED;
1630*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_respond(void *umad, ib_portid_t * portid, uint32_t rstatus)
1631*d6b92ffaSHans Petter Selasky     DEPRECATED;
1632*d6b92ffaSHans Petter Selasky 
1633*d6b92ffaSHans Petter Selasky /* serv.c new interface */
1634*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_send_via(ib_rpc_t * rpc, ib_portid_t * dport,
1635*d6b92ffaSHans Petter Selasky 			    ib_rmpp_hdr_t * rmpp, void *data,
1636*d6b92ffaSHans Petter Selasky 			    struct ibmad_port *srcport);
1637*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_receive_via(void *umad, int timeout,
1638*d6b92ffaSHans Petter Selasky 				 struct ibmad_port *srcport);
1639*d6b92ffaSHans Petter Selasky MAD_EXPORT int mad_respond_via(void *umad, ib_portid_t * portid,
1640*d6b92ffaSHans Petter Selasky 			       uint32_t rstatus, struct ibmad_port *srcport);
1641*d6b92ffaSHans Petter Selasky MAD_EXPORT void *mad_alloc(void);
1642*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_free(void *umad);
1643*d6b92ffaSHans Petter Selasky 
1644*d6b92ffaSHans Petter Selasky /* vendor.c */
1645*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *ib_vendor_call(void *data, ib_portid_t * portid,
1646*d6b92ffaSHans Petter Selasky 				   ib_vendor_call_t * call) DEPRECATED;
1647*d6b92ffaSHans Petter Selasky 
1648*d6b92ffaSHans Petter Selasky /* vendor.c new interface */
1649*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *ib_vendor_call_via(void *data, ib_portid_t * portid,
1650*d6b92ffaSHans Petter Selasky 				       ib_vendor_call_t * call,
1651*d6b92ffaSHans Petter Selasky 				       struct ibmad_port *srcport);
1652*d6b92ffaSHans Petter Selasky 
mad_is_vendor_range1(int mgmt)1653*d6b92ffaSHans Petter Selasky static inline int mad_is_vendor_range1(int mgmt)
1654*d6b92ffaSHans Petter Selasky {
1655*d6b92ffaSHans Petter Selasky 	return mgmt >= 0x9 && mgmt <= 0xf;
1656*d6b92ffaSHans Petter Selasky }
1657*d6b92ffaSHans Petter Selasky 
mad_is_vendor_range2(int mgmt)1658*d6b92ffaSHans Petter Selasky static inline int mad_is_vendor_range2(int mgmt)
1659*d6b92ffaSHans Petter Selasky {
1660*d6b92ffaSHans Petter Selasky 	return mgmt >= 0x30 && mgmt <= 0x4f;
1661*d6b92ffaSHans Petter Selasky }
1662*d6b92ffaSHans Petter Selasky 
1663*d6b92ffaSHans Petter Selasky /* rpc.c */
1664*d6b92ffaSHans Petter Selasky MAD_EXPORT int madrpc_portid(void) DEPRECATED;
1665*d6b92ffaSHans Petter Selasky void *madrpc(ib_rpc_t * rpc, ib_portid_t * dport, void *payload, void *rcvdata)
1666*d6b92ffaSHans Petter Selasky     DEPRECATED;
1667*d6b92ffaSHans Petter Selasky void *madrpc_rmpp(ib_rpc_t * rpc, ib_portid_t * dport, ib_rmpp_hdr_t * rmpp,
1668*d6b92ffaSHans Petter Selasky 		  void *data) DEPRECATED;
1669*d6b92ffaSHans Petter Selasky MAD_EXPORT void madrpc_init(char *dev_name, int dev_port, int *mgmt_classes,
1670*d6b92ffaSHans Petter Selasky 			    int num_classes) DEPRECATED;
1671*d6b92ffaSHans Petter Selasky void madrpc_save_mad(void *madbuf, int len) DEPRECATED;
1672*d6b92ffaSHans Petter Selasky 
1673*d6b92ffaSHans Petter Selasky /* smp.c */
1674*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_query(void *buf, ib_portid_t * id, unsigned attrid,
1675*d6b92ffaSHans Petter Selasky 			      unsigned mod, unsigned timeout) DEPRECATED;
1676*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_set(void *buf, ib_portid_t * id, unsigned attrid,
1677*d6b92ffaSHans Petter Selasky 			    unsigned mod, unsigned timeout) DEPRECATED;
1678*d6b92ffaSHans Petter Selasky 
1679*d6b92ffaSHans Petter Selasky /* smp.c new interface */
1680*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_query_via(void *buf, ib_portid_t * id, unsigned attrid,
1681*d6b92ffaSHans Petter Selasky 				  unsigned mod, unsigned timeout,
1682*d6b92ffaSHans Petter Selasky 				  const struct ibmad_port *srcport);
1683*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_set_via(void *buf, ib_portid_t * id, unsigned attrid,
1684*d6b92ffaSHans Petter Selasky 				unsigned mod, unsigned timeout,
1685*d6b92ffaSHans Petter Selasky 				const struct ibmad_port *srcport);
1686*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_query_status_via(void *rcvbuf, ib_portid_t * portid,
1687*d6b92ffaSHans Petter Selasky 					 unsigned attrid, unsigned mod,
1688*d6b92ffaSHans Petter Selasky 					 unsigned timeout, int *rstatus,
1689*d6b92ffaSHans Petter Selasky 					 const struct ibmad_port *srcport);
1690*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *smp_set_status_via(void *data, ib_portid_t * portid,
1691*d6b92ffaSHans Petter Selasky 				       unsigned attrid, unsigned mod,
1692*d6b92ffaSHans Petter Selasky 				       unsigned timeout, int *rstatus,
1693*d6b92ffaSHans Petter Selasky 				       const struct ibmad_port *srcport);
1694*d6b92ffaSHans Petter Selasky MAD_EXPORT void smp_mkey_set(struct ibmad_port *srcport, uint64_t mkey);
1695*d6b92ffaSHans Petter Selasky MAD_EXPORT uint64_t smp_mkey_get(const struct ibmad_port *srcport);
1696*d6b92ffaSHans Petter Selasky 
1697*d6b92ffaSHans Petter Selasky /* cc.c */
1698*d6b92ffaSHans Petter Selasky MAD_EXPORT void *cc_query_status_via(void *rcvbuf, ib_portid_t * portid,
1699*d6b92ffaSHans Petter Selasky 				     unsigned attrid, unsigned mod, unsigned timeout,
1700*d6b92ffaSHans Petter Selasky 				     int *rstatus, const struct ibmad_port * srcport,
1701*d6b92ffaSHans Petter Selasky 				     uint64_t cckey);
1702*d6b92ffaSHans Petter Selasky 
1703*d6b92ffaSHans Petter Selasky MAD_EXPORT void *cc_config_status_via(void *payload, void *rcvbuf, ib_portid_t * portid,
1704*d6b92ffaSHans Petter Selasky 				      unsigned attrid, unsigned mod, unsigned timeout,
1705*d6b92ffaSHans Petter Selasky 				      int *rstatus, const struct ibmad_port * srcport,
1706*d6b92ffaSHans Petter Selasky 				      uint64_t cckey);
1707*d6b92ffaSHans Petter Selasky 
1708*d6b92ffaSHans Petter Selasky /* sa.c */
1709*d6b92ffaSHans Petter Selasky uint8_t *sa_call(void *rcvbuf, ib_portid_t * portid, ib_sa_call_t * sa,
1710*d6b92ffaSHans Petter Selasky 		 unsigned timeout) DEPRECATED;
1711*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_path_query(ibmad_gid_t srcgid, ibmad_gid_t destgid,
1712*d6b92ffaSHans Petter Selasky 			     ib_portid_t * sm_id, void *buf) DEPRECATED;
1713*d6b92ffaSHans Petter Selasky 
1714*d6b92ffaSHans Petter Selasky /* sa.c new interface */
1715*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *sa_rpc_call(const struct ibmad_port *srcport, void *rcvbuf,
1716*d6b92ffaSHans Petter Selasky 				ib_portid_t * portid, ib_sa_call_t * sa,
1717*d6b92ffaSHans Petter Selasky 				unsigned timeout);
1718*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_path_query_via(const struct ibmad_port *srcport,
1719*d6b92ffaSHans Petter Selasky 				 ibmad_gid_t srcgid, ibmad_gid_t destgid,
1720*d6b92ffaSHans Petter Selasky 				 ib_portid_t * sm_id, void *buf);
1721*d6b92ffaSHans Petter Selasky 	/* returns lid */
1722*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_node_query_via(const struct ibmad_port *srcport,
1723*d6b92ffaSHans Petter Selasky 				 uint64_t guid, ib_portid_t * sm_id,
1724*d6b92ffaSHans Petter Selasky 				 void *buf);
1725*d6b92ffaSHans Petter Selasky 
1726*d6b92ffaSHans Petter Selasky /* resolve.c */
1727*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_smlid(ib_portid_t * sm_id, int timeout) DEPRECATED;
1728*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_portid_str(ib_portid_t * portid, char *addr_str,
1729*d6b92ffaSHans Petter Selasky 				     enum MAD_DEST dest, ib_portid_t * sm_id)
1730*d6b92ffaSHans Petter Selasky     DEPRECATED;
1731*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_self(ib_portid_t * portid, int *portnum,
1732*d6b92ffaSHans Petter Selasky 			       ibmad_gid_t * gid) DEPRECATED;
1733*d6b92ffaSHans Petter Selasky 
1734*d6b92ffaSHans Petter Selasky /* resolve.c new interface */
1735*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_smlid_via(ib_portid_t * sm_id, int timeout,
1736*d6b92ffaSHans Petter Selasky 				    const struct ibmad_port *srcport);
1737*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_guid_via(ib_portid_t * portid, uint64_t * guid,
1738*d6b92ffaSHans Petter Selasky 				   ib_portid_t * sm_id, int timeout,
1739*d6b92ffaSHans Petter Selasky 				   const struct ibmad_port *srcport);
1740*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_gid_via(ib_portid_t * portid, ibmad_gid_t gid,
1741*d6b92ffaSHans Petter Selasky 				  ib_portid_t * sm_id, int timeout,
1742*d6b92ffaSHans Petter Selasky 				  const struct ibmad_port *srcport);
1743*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_portid_str_via(ib_portid_t * portid, char *addr_str,
1744*d6b92ffaSHans Petter Selasky 					 enum MAD_DEST dest,
1745*d6b92ffaSHans Petter Selasky 					 ib_portid_t * sm_id,
1746*d6b92ffaSHans Petter Selasky 					 const struct ibmad_port *srcport);
1747*d6b92ffaSHans Petter Selasky MAD_EXPORT int ib_resolve_self_via(ib_portid_t * portid, int *portnum,
1748*d6b92ffaSHans Petter Selasky 				   ibmad_gid_t * gid,
1749*d6b92ffaSHans Petter Selasky 				   const struct ibmad_port *srcport);
1750*d6b92ffaSHans Petter Selasky 
1751*d6b92ffaSHans Petter Selasky /* gs.c new interface */
1752*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *pma_query_via(void *rcvbuf, ib_portid_t * dest, int port,
1753*d6b92ffaSHans Petter Selasky 				  unsigned timeout, unsigned id,
1754*d6b92ffaSHans Petter Selasky 				  const struct ibmad_port *srcport);
1755*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *performance_reset_via(void *rcvbuf, ib_portid_t * dest,
1756*d6b92ffaSHans Petter Selasky 					  int port, unsigned mask,
1757*d6b92ffaSHans Petter Selasky 					  unsigned timeout, unsigned id,
1758*d6b92ffaSHans Petter Selasky 					  const struct ibmad_port *srcport);
1759*d6b92ffaSHans Petter Selasky 
1760*d6b92ffaSHans Petter Selasky /* bm.c */
1761*d6b92ffaSHans Petter Selasky MAD_EXPORT uint8_t *bm_call_via(void *data, ib_portid_t * portid,
1762*d6b92ffaSHans Petter Selasky 				ib_bm_call_t * call,
1763*d6b92ffaSHans Petter Selasky 				struct ibmad_port *srcport);
1764*d6b92ffaSHans Petter Selasky 
1765*d6b92ffaSHans Petter Selasky /* dump.c */
1766*d6b92ffaSHans Petter Selasky MAD_EXPORT ib_mad_dump_fn
1767*d6b92ffaSHans Petter Selasky     mad_dump_int, mad_dump_uint, mad_dump_hex, mad_dump_rhex,
1768*d6b92ffaSHans Petter Selasky     mad_dump_bitfield, mad_dump_array, mad_dump_string,
1769*d6b92ffaSHans Petter Selasky     mad_dump_linkwidth, mad_dump_linkwidthsup, mad_dump_linkwidthen,
1770*d6b92ffaSHans Petter Selasky     mad_dump_linkdowndefstate,
1771*d6b92ffaSHans Petter Selasky     mad_dump_linkspeed, mad_dump_linkspeedsup, mad_dump_linkspeeden,
1772*d6b92ffaSHans Petter Selasky     mad_dump_linkspeedext, mad_dump_linkspeedextsup, mad_dump_linkspeedexten,
1773*d6b92ffaSHans Petter Selasky     mad_dump_portstate, mad_dump_portstates,
1774*d6b92ffaSHans Petter Selasky     mad_dump_physportstate, mad_dump_portcapmask, mad_dump_portcapmask2,
1775*d6b92ffaSHans Petter Selasky     mad_dump_mtu, mad_dump_vlcap, mad_dump_opervls,
1776*d6b92ffaSHans Petter Selasky     mad_dump_node_type, mad_dump_sltovl, mad_dump_vlarbitration,
1777*d6b92ffaSHans Petter Selasky     mad_dump_nodedesc, mad_dump_nodeinfo, mad_dump_portinfo,
1778*d6b92ffaSHans Petter Selasky     mad_dump_switchinfo, mad_dump_perfcounters, mad_dump_perfcounters_ext,
1779*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_xmt_sl, mad_dump_perfcounters_rcv_sl,
1780*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err,
1781*d6b92ffaSHans Petter Selasky     mad_dump_portsamples_control, mad_dump_port_ext_speeds_counters,
1782*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_port_op_rcv_counters, mad_dump_perfcounters_port_flow_ctl_counters,
1783*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_port_vl_op_packet, mad_dump_perfcounters_port_vl_op_data,
1784*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors, mad_dump_perfcounters_port_vl_xmit_wait_counters,
1785*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_sw_port_vl_congestion, mad_dump_perfcounters_rcv_con_ctrl,
1786*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_sl_rcv_fecn, mad_dump_perfcounters_sl_rcv_becn,
1787*d6b92ffaSHans Petter Selasky     mad_dump_perfcounters_xmit_con_ctrl, mad_dump_perfcounters_vl_xmit_time_cong,
1788*d6b92ffaSHans Petter Selasky     mad_dump_mlnx_ext_port_info, mad_dump_cc_congestioninfo, mad_dump_cc_congestionkeyinfo,
1789*d6b92ffaSHans Petter Selasky     mad_dump_cc_congestionlog, mad_dump_cc_congestionlogswitch,
1790*d6b92ffaSHans Petter Selasky     mad_dump_cc_congestionlogentryswitch, mad_dump_cc_congestionlogca,
1791*d6b92ffaSHans Petter Selasky     mad_dump_cc_congestionlogentryca, mad_dump_cc_switchcongestionsetting,
1792*d6b92ffaSHans Petter Selasky     mad_dump_cc_switchportcongestionsettingelement, mad_dump_cc_cacongestionsetting,
1793*d6b92ffaSHans Petter Selasky     mad_dump_cc_cacongestionentry, mad_dump_cc_congestioncontroltable,
1794*d6b92ffaSHans Petter Selasky     mad_dump_cc_congestioncontroltableentry, mad_dump_cc_timestamp,
1795*d6b92ffaSHans Petter Selasky     mad_dump_classportinfo,  mad_dump_portmirror_route,
1796*d6b92ffaSHans Petter Selasky     mad_dump_portmirror_ports, mad_dump_portsamples_result,
1797*d6b92ffaSHans Petter Selasky     mad_dump_portinfo_ext, mad_dump_port_ext_speeds_counters_rsfec_active;
1798*d6b92ffaSHans Petter Selasky 
1799*d6b92ffaSHans Petter Selasky MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
1800*d6b92ffaSHans Petter Selasky 				int start, int end);
1801*d6b92ffaSHans Petter Selasky 
1802*d6b92ffaSHans Petter Selasky extern MAD_EXPORT int ibdebug;
1803*d6b92ffaSHans Petter Selasky 
1804*d6b92ffaSHans Petter Selasky #if __BYTE_ORDER == __LITTLE_ENDIAN
1805*d6b92ffaSHans Petter Selasky #ifndef ntohll
1806*d6b92ffaSHans Petter Selasky #define ntohll bswap_64
1807*d6b92ffaSHans Petter Selasky #endif
1808*d6b92ffaSHans Petter Selasky #ifndef htonll
1809*d6b92ffaSHans Petter Selasky #define htonll bswap_64
1810*d6b92ffaSHans Petter Selasky #endif
1811*d6b92ffaSHans Petter Selasky #elif __BYTE_ORDER == __BIG_ENDIAN
1812*d6b92ffaSHans Petter Selasky #ifndef ntohll
1813*d6b92ffaSHans Petter Selasky #define ntohll(x) (x)
1814*d6b92ffaSHans Petter Selasky #endif
1815*d6b92ffaSHans Petter Selasky #ifndef htonll
1816*d6b92ffaSHans Petter Selasky #define htonll(x) (x)
1817*d6b92ffaSHans Petter Selasky #endif
1818*d6b92ffaSHans Petter Selasky #endif				/* __BYTE_ORDER == __BIG_ENDIAN */
1819*d6b92ffaSHans Petter Selasky 
1820*d6b92ffaSHans Petter Selasky /* Misc. macros: */
1821*d6b92ffaSHans Petter Selasky /** align value \a l to \a size (ceil) */
1822*d6b92ffaSHans Petter Selasky #define ALIGN(l, size) (((l) + ((size) - 1)) / (size) * (size))
1823*d6b92ffaSHans Petter Selasky 
1824*d6b92ffaSHans Petter Selasky /** printf style warning MACRO, includes name of function and pid */
1825*d6b92ffaSHans Petter Selasky #define IBWARN(fmt, ...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", \
1826*d6b92ffaSHans Petter Selasky (int)getpid(), __func__, ## __VA_ARGS__)
1827*d6b92ffaSHans Petter Selasky 
1828*d6b92ffaSHans Petter Selasky #define IBDEBUG(fmt, ...) fprintf(stdout, "ibdebug: [%d] %s: " fmt "\n", \
1829*d6b92ffaSHans Petter Selasky (int)getpid(), __func__, ## __VA_ARGS__)
1830*d6b92ffaSHans Petter Selasky 
1831*d6b92ffaSHans Petter Selasky #define IBVERBOSE(fmt, ...) fprintf(stdout, "[%d] %s: " fmt "\n", \
1832*d6b92ffaSHans Petter Selasky (int)getpid(), __func__, ## __VA_ARGS__)
1833*d6b92ffaSHans Petter Selasky 
1834*d6b92ffaSHans Petter Selasky #define IBPANIC(fmt, ...) do { \
1835*d6b92ffaSHans Petter Selasky 	fprintf(stderr, "ibpanic: [%d] %s: " fmt ": %m\n", \
1836*d6b92ffaSHans Petter Selasky 	(int)getpid(), __func__, ## __VA_ARGS__); \
1837*d6b92ffaSHans Petter Selasky 	exit(-1); \
1838*d6b92ffaSHans Petter Selasky } while(0)
1839*d6b92ffaSHans Petter Selasky 
1840*d6b92ffaSHans Petter Selasky MAD_EXPORT void xdump(FILE * file, char *msg, void *p, int size);
1841*d6b92ffaSHans Petter Selasky 
1842*d6b92ffaSHans Petter Selasky END_C_DECLS
1843*d6b92ffaSHans Petter Selasky #endif				/* _MAD_H_ */
1844