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