Lines Matching +full:32 +full:-
2 * Copyright (c) 2004-2009 Voltaire Inc. All rights reserved.
4 * Copyright (c) 2009-2011 Mellanox Technologies LTD. All rights reserved.
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
48 * encoded in the IB spec - IB headers are encoded such that the bit offsets
53 #define BITSOFFS(o, w) (((o) & ~31) | ((32 - ((o) & 31) - (w)))), (w)
55 #define BE_TO_BITSOFFS(o, w) (((o) & ~31) | ((32 - ((o) & 31) - (w))))
58 {0, 0}, /* IB_NO_FIELD - reserved as invalid */
65 * SMP: Subnet Management packets - lid routed (IB spec 14.2.1.1)
66 * DSMP: Subnet Management packets - direct route (IB spec 14.2.1.2)
70 /* first MAD word (0-3 bytes) */
77 /* second MAD word (4-7 bytes) */
81 {BE_OFFS(32, 8), "DrSmpHopCnt", mad_dump_uint},
86 /* words 3,4,5,6 (8-23 bytes) */
89 {160, 32, "MadModifier", mad_dump_hex}, /* TODO: add dumper */
91 /* word 7,8 (24-31 bytes) */
94 /* word 9 (32-37 bytes) */
98 /* word 10,11 (36-43 bytes) */
101 /* word 12 (44-47 bytes) */
104 /* word 13,14 (48-55 bytes) */
107 /* word 13,14 (56-255 bytes) */
108 {56 * 8, (256 - 56) * 8, "SaData", mad_dump_hex},
110 /* bytes 64 - 127 */
111 {0, 0}, /* IB_SM_DATA_F - reserved as invalid */
113 /* bytes 64 - 256 */
114 {64 * 8, (256 - 64) * 8, "GsData", mad_dump_hex},
116 /* bytes 128 - 191 */
119 /* bytes 192 - 255 */
129 {160, 32, "CapMask", mad_dump_portcapmask},
181 {32, 64, "SystemGuid", mad_dump_hex},
186 {256, 32, "Revision", mad_dump_hex},
196 {BITSOFFS(32, 16), "McastFdbCap", mad_dump_uint},
235 {BITSOFFS(32, 16), "NoticeTrapNumber", mad_dump_uint},
242 {BITSOFFS(128, 32), "NoticeDataTrap144CapMask", mad_dump_uint},
249 {BITSOFFS(32, 16), "SymbolErrorCounter", mad_dump_uint},
262 {192, 32, "PortXmitData", mad_dump_uint},
263 {224, 32, "PortRcvData", mad_dump_uint},
264 {256, 32, "PortXmitPkts", mad_dump_uint},
265 {288, 32, "PortRcvPkts", mad_dump_uint},
266 {320, 32, "PortXmitWait", mad_dump_uint},
274 {128, 32, "SmActivity", mad_dump_uint},
288 {28 * 8, 32, "RmppData1", mad_dump_hex},
289 {28 * 8, 32, "RmppSegNum", mad_dump_uint},
291 {32 * 8, 32, "RmppData2", mad_dump_hex},
292 {32 * 8, 32, "RmppPayload", mad_dump_uint},
293 {32 * 8, 32, "RmppNewWin", mad_dump_uint},
318 {256, 32, "McastMemQkey", mad_dump_hex},
335 {224, 32, "ServRecLease", mad_dump_hex},
341 * ATS SM record - within SA_SR_DATA
343 {12 * 8, 32, "ATSNodeAddr", mad_dump_hex},
346 {32 * 8, 32 * 8, "ATSNodeName", mad_dump_string},
362 {40 * 8, (256 - 40) * 8, "Vendor2Data", mad_dump_array},
390 {BITSOFFS(32, 27), "CapabilityMask2", mad_dump_hex},
399 {288, 32, "RedirectQKey", mad_dump_hex},
408 {544, 32, "TrapQKey", mad_dump_hex},
413 {32, 32, "XmtDataSL0", mad_dump_uint},
414 {64, 32, "XmtDataSL1", mad_dump_uint},
415 {96, 32, "XmtDataSL2", mad_dump_uint},
416 {128, 32, "XmtDataSL3", mad_dump_uint},
417 {160, 32, "XmtDataSL4", mad_dump_uint},
418 {192, 32, "XmtDataSL5", mad_dump_uint},
419 {224, 32, "XmtDataSL6", mad_dump_uint},
420 {256, 32, "XmtDataSL7", mad_dump_uint},
421 {288, 32, "XmtDataSL8", mad_dump_uint},
422 {320, 32, "XmtDataSL9", mad_dump_uint},
423 {352, 32, "XmtDataSL10", mad_dump_uint},
424 {384, 32, "XmtDataSL11", mad_dump_uint},
425 {416, 32, "XmtDataSL12", mad_dump_uint},
426 {448, 32, "XmtDataSL13", mad_dump_uint},
427 {480, 32, "XmtDataSL14", mad_dump_uint},
428 {512, 32, "XmtDataSL15", mad_dump_uint},
434 {32, 32, "RcvDataSL0", mad_dump_uint},
435 {64, 32, "RcvDataSL1", mad_dump_uint},
436 {96, 32, "RcvDataSL2", mad_dump_uint},
437 {128, 32, "RcvDataSL3", mad_dump_uint},
438 {160, 32, "RcvDataSL4", mad_dump_uint},
439 {192, 32, "RcvDataSL5", mad_dump_uint},
440 {224, 32, "RcvDataSL6", mad_dump_uint},
441 {256, 32, "RcvDataSL7", mad_dump_uint},
442 {288, 32, "RcvDataSL8", mad_dump_uint},
443 {320, 32, "RcvDataSL9", mad_dump_uint},
444 {352, 32, "RcvDataSL10", mad_dump_uint},
445 {384, 32, "RcvDataSL11", mad_dump_uint},
446 {416, 32, "RcvDataSL12", mad_dump_uint},
447 {448, 32, "RcvDataSL13", mad_dump_uint},
448 {480, 32, "RcvDataSL14", mad_dump_uint},
449 {512, 32, "RcvDataSL15", mad_dump_uint},
455 {BITSOFFS(32, 16), "PortInactiveDiscards", mad_dump_uint},
464 {BITSOFFS(32, 16), "PortLocalPhysicalErrors", mad_dump_uint},
486 {224, 32, "SampleStart", mad_dump_uint},
487 {256, 32, "SampleInterval", mad_dump_uint},
557 {352, 32, "FECCorrectableBlockCtrLane0", mad_dump_uint},
558 {384, 32, "FECCorrectableBlockCtrLane1", mad_dump_uint},
559 {416, 32, "FECCorrectableBlockCtrLane2", mad_dump_uint},
560 {448, 32, "FECCorrectableBlockCtrLane3", mad_dump_uint},
561 {480, 32, "FECCorrectableBlockCtrLane4", mad_dump_uint},
562 {512, 32, "FECCorrectableBlockCtrLane5", mad_dump_uint},
563 {544, 32, "FECCorrectableBlockCtrLane6", mad_dump_uint},
564 {576, 32, "FECCorrectableBlockCtrLane7", mad_dump_uint},
565 {608, 32, "FECCorrectableBlockCtrLane8", mad_dump_uint},
566 {640, 32, "FECCorrectableBlockCtrLane9", mad_dump_uint},
567 {672, 32, "FECCorrectableBlockCtrLane10", mad_dump_uint},
568 {704, 32, "FECCorrectableBlockCtrLane11", mad_dump_uint},
569 {736, 32, "FECUncorrectableBlockCtrLane0", mad_dump_uint},
570 {768, 32, "FECUncorrectableBlockCtrLane1", mad_dump_uint},
571 {800, 32, "FECUncorrectableBlockCtrLane2", mad_dump_uint},
572 {832, 32, "FECUncorrectableBlockCtrLane3", mad_dump_uint},
573 {864, 32, "FECUncorrectableBlockCtrLane4", mad_dump_uint},
574 {896, 32, "FECUncorrectableBlockCtrLane5", mad_dump_uint},
575 {928, 32, "FECUncorrectableBlockCtrLane6", mad_dump_uint},
576 {960, 32, "FECUncorrectableBlockCtrLane7", mad_dump_uint},
577 {992, 32, "FECUncorrectableBlockCtrLane8", mad_dump_uint},
578 {1024, 32, "FECUncorrectableBlockCtrLane9", mad_dump_uint},
579 {1056, 32, "FECUncorrectableBlockCtrLane10", mad_dump_uint},
580 {1088, 32, "FECUncorrectableBlockCtrLane11", mad_dump_uint},
588 {32, 32, "PortOpRcvPkts", mad_dump_uint},
589 {64, 32, "PortOpRcvData", mad_dump_uint},
595 {32, 32, "PortXmitFlowPkts", mad_dump_uint},
596 {64, 32, "PortRcvFlowPkts", mad_dump_uint},
602 {BITSOFFS(32, 16), "PortVLOpPackets0", mad_dump_uint},
623 {32, 32, "PortVLOpData0", mad_dump_uint},
624 {64, 32, "PortVLOpData1", mad_dump_uint},
625 {96, 32, "PortVLOpData2", mad_dump_uint},
626 {128, 32, "PortVLOpData3", mad_dump_uint},
627 {160, 32, "PortVLOpData4", mad_dump_uint},
628 {192, 32, "PortVLOpData5", mad_dump_uint},
629 {224, 32, "PortVLOpData6", mad_dump_uint},
630 {256, 32, "PortVLOpData7", mad_dump_uint},
631 {288, 32, "PortVLOpData8", mad_dump_uint},
632 {320, 32, "PortVLOpData9", mad_dump_uint},
633 {352, 32, "PortVLOpData10", mad_dump_uint},
634 {384, 32, "PortVLOpData11", mad_dump_uint},
635 {416, 32, "PortVLOpData12", mad_dump_uint},
636 {448, 32, "PortVLOpData13", mad_dump_uint},
637 {480, 32, "PortVLOpData14", mad_dump_uint},
638 {512, 32, "PortVLOpData15", mad_dump_uint},
644 {BITSOFFS(32, 2), "PortVLXmitFlowCtlUpdateErrors0", mad_dump_uint},
665 {BITSOFFS(32, 16), "PortVLXmitWait0", mad_dump_uint},
686 {BITSOFFS(32, 16), "SWPortVLCongestion0", mad_dump_uint},
707 {32, 32, "PortPktRcvFECN", mad_dump_uint},
708 {64, 32, "PortPktRcvBECN", mad_dump_uint},
714 {32, 32, "PortSLRcvFECN0", mad_dump_uint},
715 {64, 32, "PortSLRcvFECN1", mad_dump_uint},
716 {96, 32, "PortSLRcvFECN2", mad_dump_uint},
717 {128, 32, "PortSLRcvFECN3", mad_dump_uint},
718 {160, 32, "PortSLRcvFECN4", mad_dump_uint},
719 {192, 32, "PortSLRcvFECN5", mad_dump_uint},
720 {224, 32, "PortSLRcvFECN6", mad_dump_uint},
721 {256, 32, "PortSLRcvFECN7", mad_dump_uint},
722 {288, 32, "PortSLRcvFECN8", mad_dump_uint},
723 {320, 32, "PortSLRcvFECN9", mad_dump_uint},
724 {352, 32, "PortSLRcvFECN10", mad_dump_uint},
725 {384, 32, "PortSLRcvFECN11", mad_dump_uint},
726 {416, 32, "PortSLRcvFECN12", mad_dump_uint},
727 {448, 32, "PortSLRcvFECN13", mad_dump_uint},
728 {480, 32, "PortSLRcvFECN14", mad_dump_uint},
729 {512, 32, "PortSLRcvFECN15", mad_dump_uint},
735 {32, 32, "PortSLRcvBECN0", mad_dump_uint},
736 {64, 32, "PortSLRcvBECN1", mad_dump_uint},
737 {96, 32, "PortSLRcvBECN2", mad_dump_uint},
738 {128, 32, "PortSLRcvBECN3", mad_dump_uint},
739 {160, 32, "PortSLRcvBECN4", mad_dump_uint},
740 {192, 32, "PortSLRcvBECN5", mad_dump_uint},
741 {224, 32, "PortSLRcvBECN6", mad_dump_uint},
742 {256, 32, "PortSLRcvBECN7", mad_dump_uint},
743 {288, 32, "PortSLRcvBECN8", mad_dump_uint},
744 {320, 32, "PortSLRcvBECN9", mad_dump_uint},
745 {352, 32, "PortSLRcvBECN10", mad_dump_uint},
746 {384, 32, "PortSLRcvBECN11", mad_dump_uint},
747 {416, 32, "PortSLRcvBECN12", mad_dump_uint},
748 {448, 32, "PortSLRcvBECN13", mad_dump_uint},
749 {480, 32, "PortSLRcvBECN14", mad_dump_uint},
750 {512, 32, "PortSLRcvBECN15", mad_dump_uint},
756 {32, 32, "PortXmitTimeCong", mad_dump_uint},
762 {32, 32, "PortVLXmitTimeCong0", mad_dump_uint},
763 {64, 32, "PortVLXmitTimeCong1", mad_dump_uint},
764 {96, 32, "PortVLXmitTimeCong2", mad_dump_uint},
765 {128, 32, "PortVLXmitTimeCong3", mad_dump_uint},
766 {160, 32, "PortVLXmitTimeCong4", mad_dump_uint},
767 {192, 32, "PortVLXmitTimeCong5", mad_dump_uint},
768 {224, 32, "PortVLXmitTimeCong6", mad_dump_uint},
769 {256, 32, "PortVLXmitTimeCong7", mad_dump_uint},
770 {288, 32, "PortVLXmitTimeCong8", mad_dump_uint},
771 {320, 32, "PortVLXmitTimeCong9", mad_dump_uint},
772 {352, 32, "PortVLXmitTimeCong10", mad_dump_uint},
773 {384, 32, "PortVLXmitTimeCong11", mad_dump_uint},
774 {416, 32, "PortVLXmitTimeCong12", mad_dump_uint},
775 {448, 32, "PortVLXmitTimeCong13", mad_dump_uint},
776 {480, 32, "PortVLXmitTimeCong14", mad_dump_uint},
790 * bytes 24-31 of congestion control mad
821 {32, 32, "CurrentTimeStamp", mad_dump_uint},
830 {BITSOFFS(32, 4), "SL", mad_dump_uint},
831 {64, 32, "Timestamp", mad_dump_uint},
838 {BITSOFFS(32, 16), "ThresholdCongestionEventMap", mad_dump_hex},
842 {BITSOFFS(64, 32), "CurrentTimeStamp", mad_dump_uint},
851 {BITSOFFS(32, 24), "Remote_QP_Number_CN_Entry", mad_dump_uint},
854 {BITSOFFS(96, 32), "Timestamp_CN_Entry", mad_dump_uint},
860 {0, 32, "Control_Map", mad_dump_hex},
861 {32, 256, "Victim_Mask", mad_dump_array},
893 {BITSOFFS(32, 8), "CCTI_Min", mad_dump_uint},
912 {0, 32, "Timestamp", mad_dump_uint},
917 {BITSOFFS(32, 8), "BaseVers", mad_dump_uint},
926 {288, 32, "Revision", mad_dump_hex},
937 {BITSOFFS(32, 3), "MT", mad_dump_hex},
952 {0, 32, "MirrorFilter0", mad_dump_hex},
953 {32, 32, "MirrorFilter1", mad_dump_hex},
954 {64, 32, "MirrorMask0", mad_dump_hex},
955 {96, 32, "MirrorMask1", mad_dump_hex},
956 {128, 32, "MirrorMask2", mad_dump_hex},
957 {160, 32, "MirrorMask3", mad_dump_hex},
1050 {32, 32, "Counter0", mad_dump_uint},
1051 {64, 32, "Counter1", mad_dump_uint},
1052 {96, 32, "Counter2", mad_dump_uint},
1053 {128, 32, "Counter3", mad_dump_uint},
1054 {160, 32, "Counter4", mad_dump_uint},
1055 {192, 32, "Counter5", mad_dump_uint},
1056 {224, 32, "Counter6", mad_dump_uint},
1057 {256, 32, "Counter7", mad_dump_uint},
1058 {288, 32, "Counter8", mad_dump_uint},
1059 {320, 32, "Counter9", mad_dump_uint},
1060 {352, 32, "Counter10", mad_dump_uint},
1061 {384, 32, "Counter11", mad_dump_uint},
1062 {416, 32, "Counter12", mad_dump_uint},
1063 {448, 32, "Counter13", mad_dump_uint},
1064 {480, 32, "Counter14", mad_dump_uint},
1070 {0, 32, "CapMask", mad_dump_hex},
1071 {BITSOFFS(32, 16), "FECModeActive", mad_dump_uint},
1085 {352, 32, "FECCorrectableSymbolCtrLane0", mad_dump_uint},
1086 {384, 32, "FECCorrectableSymbolCtrLane1", mad_dump_uint},
1087 {416, 32, "FECCorrectableSymbolCtrLane2", mad_dump_uint},
1088 {448, 32, "FECCorrectableSymbolCtrLane3", mad_dump_uint},
1089 {480, 32, "FECCorrectableSymbolCtrLane4", mad_dump_uint},
1090 {512, 32, "FECCorrectableSymbolCtrLane5", mad_dump_uint},
1091 {544, 32, "FECCorrectableSymbolCtrLane6", mad_dump_uint},
1092 {576, 32, "FECCorrectableSymbolCtrLane7", mad_dump_uint},
1093 {608, 32, "FECCorrectableSymbolCtrLane8", mad_dump_uint},
1094 {640, 32, "FECCorrectableSymbolCtrLane9", mad_dump_uint},
1095 {672, 32, "FECCorrectableSymbolCtrLane10", mad_dump_uint},
1096 {704, 32, "FECCorrectableSymbolCtrLane11", mad_dump_uint},
1097 {1120, 32, "PortFECCorrectableBlockCtr", mad_dump_uint},
1098 {1152, 32, "PortFECUncorrectableBlockCtr", mad_dump_uint},
1099 {1184, 32, "PortFECCorrectedSymbolCtr", mad_dump_uint},
1105 {32, 32, "CounterSelect2", mad_dump_hex},
1136 memcpy(((void *)(char *)buf + base_offs + f->bitoffs / 8), in _set_field64()
1143 memcpy((void *)&val, (void *)((char *)buf + base_offs + f->bitoffs / 8), in _get_field64()
1151 int prebits = (8 - (f->bitoffs & 7)) & 7; in _set_field()
1152 int postbits = (f->bitoffs + f->bitlen) & 7; in _set_field()
1153 int bytelen = f->bitlen / 8; in _set_field()
1154 unsigned idx = base_offs + f->bitoffs / 8; in _set_field()
1157 if (!bytelen && (f->bitoffs & 7) + f->bitlen < 8) { in _set_field()
1158 p[3 ^ idx] &= ~((((1 << f->bitlen) - 1)) << (f->bitoffs & 7)); in _set_field()
1160 (val & ((1 << f->bitlen) - 1)) << (f->bitoffs & 7); in _set_field()
1165 p[3 ^ idx] &= (1 << (8 - prebits)) - 1; in _set_field()
1166 p[3 ^ idx++] |= (val & ((1 << prebits) - 1)) << (8 - prebits); in _set_field()
1171 for (; bytelen--; val >>= 8) in _set_field()
1175 p[3 ^ idx] &= ~((1 << postbits) - 1); in _set_field()
1182 int prebits = (8 - (f->bitoffs & 7)) & 7; in _get_field()
1183 int postbits = (f->bitoffs + f->bitlen) & 7; in _get_field()
1184 int bytelen = f->bitlen / 8; in _get_field()
1185 unsigned idx = base_offs + f->bitoffs / 8; in _get_field()
1189 if (!bytelen && (f->bitoffs & 7) + f->bitlen < 8) in _get_field()
1190 return (p[3 ^ idx] >> (f->bitoffs & 7)) & ((1 << f->bitlen) - in _get_field()
1194 v = p[3 ^ idx++] >> (8 - prebits); in _get_field()
1197 i = base_offs + (f->bitoffs + f->bitlen) / 8; in _get_field()
1198 val = (p[3 ^ i] & ((1 << postbits) - 1)); in _get_field()
1202 for (idx += bytelen - 1; bytelen--; idx--) in _get_field()
1212 int bitoffs = f->bitoffs; in _set_array()
1214 if (f->bitlen < 32) in _set_array()
1215 bitoffs = BE_TO_BITSOFFS(bitoffs, f->bitlen); in _set_array()
1217 memcpy((uint8_t *) buf + base_offs + bitoffs / 8, val, f->bitlen / 8); in _set_array()
1223 int bitoffs = f->bitoffs; in _get_array()
1225 if (f->bitlen < 32) in _get_array()
1226 bitoffs = BE_TO_BITSOFFS(bitoffs, f->bitlen); in _get_array()
1228 memcpy(val, (uint8_t *) buf + base_offs + bitoffs / 8, f->bitlen / 8); in _get_array()
1271 if (f->bitlen <= 32) { in mad_decode_field()
1275 if (f->bitlen == 64) { in mad_decode_field()
1290 if (f->bitlen <= 32) { in mad_encode_field()
1294 if (f->bitlen == 64) { in mad_encode_field()
1306 f->def_dump_fn(buf, bufsz, val, ALIGN(f->bitlen, 8) / 8); in _mad_dump_val()
1307 buf[bufsz - 1] = 0; in _mad_dump_val()
1318 if (bufsz <= 32) in _mad_dump_field()
1322 name = f->name; in _mad_dump_field()
1325 if (l < 32) { in _mad_dump_field()
1326 memset(dots, '.', 32 - l); in _mad_dump_field()
1327 dots[32 - l] = 0; in _mad_dump_field()
1331 _mad_dump_val(f, buf + n, bufsz - n, val); in _mad_dump_field()
1332 buf[bufsz - 1] = 0; in _mad_dump_field()
1352 return _mad_dump(f->def_dump_fn, name ? name : f->name, val, in _mad_print_field()
1353 valsz ? valsz : ALIGN(f->bitlen, 8) / 8); in _mad_print_field()
1359 return -1; in mad_print_field()