libfru 3.0.2.gb79b203
FRU Manupulation Library
Loading...
Searching...
No Matches
fru.h
Go to the documentation of this file.
1
10#pragma once
11#include <limits.h>
12#include <stdbool.h>
13#include <stdint.h>
14#include <stdlib.h>
15#include <sys/types.h>
16
47#define LIBFRU_MAJOR 3L
48#define LIBFRU_MINOR 0L
49#define LIBFRU_SUBMINOR 2L
50
61#define LIBFRU_VERSION (LIBFRU_MAJOR << 16 | \
62 LIBFRU_MINOR << 8 | \
63 LIBFRU_SUBMINOR)
64
67/*
68 * Private macro definitions.
69 *
70 * These macros aren't for library users, but they are needed for public
71 * interfaces definition.
72 *
73 * @cond PRIVATE
74 */
75
77#define zfree(buf) do { \
78 int err = errno; /* Prevent errno corruption */ \
79 free(buf); \
80 (buf) = NULL; \
81 errno = err; \
82} while(0)
83
84#define FRU__BIT(x) (1 << (x))
85
86/*
87 * Field types per Section 13 of IPMI FRU Specification,
88 * in their binary/encoded representation
89 */
90#define FRU__TYPE_BINARY 0x00
91#define FRU__TYPE_BCDPLUS 0x01
92#define FRU__TYPE_ASCII_6BIT 0x02
93#define FRU__TYPE_TEXT 0x03
94
95#define FRU__TYPE_BITS_MASK 0xC0
96#define FRU__FIELDLEN(x) ((size_t)(((x) & ~FRU__TYPE_BITS_MASK)))
97
101#define FRU__FIELDMAXLEN FRU__FIELDLEN(UINT8_MAX)
104/*
105 * The `+0LL` trick is to make some old versions of gcc happy
106 * when `a` is of a smaller type than `b`. Without this trick
107 * the compiler would always throw a 'comparison is always
108 * false' warning. Newer versions of gcc don't have that bug,
109 * but `+0LL` is a no-op anyway, so it's here unconditionally.
110 */
111#define FRU_MAX(a, b) (((intmax_t)((a) + 0LL) > (intmax_t)((b) + 0LL)) ? (a) : (b))
112#define FRU_MIN(a, b) (((intmax_t)((a) + 0LL) > (intmax_t)((b) + 0LL)) ? (b) : (a))
113
130// BCD+ decoded data is twice the length of encoded,
131// so is hex string for binary data
132#define FRU_FIELDMAXARRAY ((2 * FRU__FIELDMAXLEN) + 1)
133
134/*
135 * Public definitions
136 */
137
142#define FRU_INFO_AREAS 3
143#define FRU_FIRST_INFO_AREA FRU_CHASSIS_INFO
144#define FRU_LAST_INFO_AREA FRU_PRODUCT_INFO
146#define FRU_IS_INFO_AREA(atype) (FRU_FIRST_INFO_AREA <= (atype) \
147 && (atype) <= FRU_LAST_INFO_AREA)
148
153#define FRU_ATYPE_TO_INFOIDX(atype) (FRU_IS_INFO_AREA(atype) ? (int)((atype) - FRU_FIRST_INFO_AREA) : -1)
154
159#define FRU_INFOIDX_TO_ATYPE(idx) (((idx) >= 0 && (idx) < FRU_INFO_AREAS) \
160 ? (fru_area_type_t)((idx) + FRU_FIRST_INFO_AREA) \
161 : (fru_area_type_t)(-1))
162
180#define FRU_INFOIDX(a) FRU_ATYPE_TO_INFOIDX(FRU_##a##_INFO)
181
198#define FRU_FOREACH_INFOIDX(it) for ((it) = 0; (it) <= FRU_INFO_AREAS; (it)++)
199
213typedef enum {
221 FRU_FE_BINARY = (FRU__TYPE_BINARY + FRU_FE_BASE),
225 FRU_FE_BCDPLUS = (FRU__TYPE_BCDPLUS + FRU_FE_BASE),
228 FRU_FE_6BITASCII = (FRU__TYPE_ASCII_6BIT + FRU_FE_BASE),
232 FRU_FE_TEXT = (FRU__TYPE_TEXT + FRU_FE_BASE),
249
255#define FRU_REAL_FE(t) ((t) - FRU_FE_BASE)
256
262#define FRU_FE_FROMREAL(t) ((t) + FRU_FE_BASE)
263
269#define FRU_FE_IS_REAL(t) (FRU_FE_MIN <= (t) && (t) <= FRU_FE_MAX)
270
276#define FRU_FIELD_IS_REAL_ENC(f) ((f) && FRU_FE_IS_REAL((f)->enc))
277
283#define FRU_FIELD_IS_AUTO_ENC(f) ((f) && FRU_FE_AUTO == ((f)->enc))
284
295typedef struct {
302
304typedef void * fru_custom_t; // The actual type is not for public use
305
327
359
385
401
423
441
446#define FRU_MAX_FIELD_COUNT FRU_PROD_FIELD_COUNT
447
454typedef void * fru_mr_t; // The actual type is not for public use
455
456
478#define FRU_IS_VALID_AREA(atype) (FRU_MIN_AREA <= (atype) && (atype) <= FRU_MAX_AREA)
479
504#define FRU_FOREACH_AREA(it) for ((it) = FRU_MIN_AREA; (it) <= FRU_MAX_AREA; (it)++)
505
558
560#define FRU_ATYPE_HAS_TYPE(atype) (FRU_CHASSIS_INFO == (atype))
562#define FRU_ATYPE_HAS_LANG(atype) (FRU_BOARD_INFO == (atype) || FRU_PRODUCT_INFO == (atype))
563
573typedef enum {
575 FRU_IGNFVER = FRU__BIT(0),
576 FRU_IGNFHCKSUM = FRU__BIT(1),
577 FRU_IGNFDCKSUM = FRU__BIT(2),
578 FRU_IGNAVER = FRU__BIT(3),
579 FRU_IGNRVER = FRU__BIT(4),
581 FRU_IGNACKSUM = FRU__BIT(5),
582 FRU_IGNRHCKSUM = FRU__BIT(6),
584 FRU_IGNRDCKSUM = FRU__BIT(7),
586 FRU_IGNRNOEOL = FRU__BIT(8),
589 FRU_IGNBIG = FRU__BIT(9),
592 FRU_IGNAEOF = FRU__BIT(10),
593 FRU_IGNMRVER = FRU__BIT(11),
594 FRU_IGNMRDATALEN = FRU__BIT(12),
633 fru_field_enc_t encoding,
634 const char * string);
635
664 const void * buf,
665 size_t size);
666
707 fru_area_type_t atype,
708 size_t index);
747 fru_area_type_t atype,
748 size_t index,
749 fru_field_enc_t encoding,
750 const char * string);
751
777 fru_area_type_t atype,
778 size_t index);
779
803 fru_area_type_t atype,
804 size_t index);
805
814#define FRU_ARRAY_SZ(a) (sizeof(a) / sizeof((a)[0]))
815
817#define FRU_LIST_HEAD 0
819#define FRU_LIST_TAIL INT_MAX
820
821
845#define FRU_IS_APOS_VALID(pos) (FRU_APOS_LAST <= (pos) && (pos) <= FRU_APOS_MAX)
846
847
860int16_t fru_hex2byte(const char * hex);
861
893
931 const char * filename,
932 fru_flags_t flags);
933
950 const void * buf,
951 size_t size,
952 fru_flags_t flags);
953
954
972void fru_wipe(fru_t * fru);
973
984#define fru_free(fru) do { fru_wipe(fru); zfree(fru); } while(0)
985
1045 fru_area_type_t area,
1046 fru_area_position_t after);
1047
1068
1080 fru_area_type_t area,
1081 fru_area_position_t after);
1082
1103bool fru_savebuffer(void ** bufptr, size_t * size, const fru_t * fru);
1104
1118bool fru_savefile(const char * fname, const fru_t * fru);
1119
1163
1165#define FRU_MR_IS_VALID_TYPE(t) (FRU_MR_MIN <= (t) && (t) <= FRU_MR_MAX)
1166
1168#define FRU_MR_OEM_COUNT (FRU_MR_OEM_END - FRU_MR_OEM_START + 1)
1169
1171#define FRU_MR_OEM(n) (FRU_MR_OEM_START + (n))
1172
1174#define FRU__FILE_MRR_MAXDATA (UINT8_MAX)
1177#define FRU__FILE_MRR_OEM_MFGID_LEN 3
1184/*
1185 * Encoded data must not exceed maximum possible MR record
1186 * data size. That's why we subtract the MFG ID length.
1187 */
1188#define FRU_MRR_OEM_MAXDATA \
1189 ((FRU__FILE_MRR_MAXDATA - FRU__FILE_MRR_OEM_MFGID_LEN) * 2 + 1)
1190
1194#define FRU_MRR_RAW_MAXDATA \
1195 (FRU__FILE_MRR_MAXDATA * 2 + 1)
1196
1215
1217#define FRU_MR_MGMT_IS_SUBTYPE_VALID(mt) ((mt) >= FRU_MR_MGMT_MIN && (mt) <= FRU_MR_MGMT_MAX)
1218
1223#define FRU_MR_MGMT_SUBTYPE_TO_IDX(mt) (FRU_MR_MGMT_IS_SUBTYPE_VALID(mt) \
1224 ? (int)((mt) - FRU_MR_MGMT_MIN) \
1225 : -1)
1230#define FRU_MR_MGMT_IDX_TO_SUBTYPE(i) (((i) >= 0 && (i) <= FRU_MR_MGMT_MAX) \
1231 ? ((i) + FRU_MR_MGMT_MIN) \
1232 : FRU_MR_MGMT_INVALID)
1233
1239typedef enum {
1242
1246#define FRU__FILE_MR_MGMT_HDR_LEN (sizeof(uint8_t))
1247
1249#define FRU__FILE_MR_MGMT_MAXDATA \
1250 (FRU__FILE_MRR_MAXDATA - FRU__FILE_MR_MGMT_HDR_LEN)
1251
1255/*
1256 * All management subtype records are plain text strings,
1257 * and even UUID, which is binary, in decoded form is
1258 * represented as a sting of 32 hex digits, which is at
1259 * least twice less than the maximum length for any of the
1260 * plain text subtypes.
1261 *
1262 * Hence, encoded and decoded lengths for plain text strings
1263 * are the same, we just use the max encoded length here
1264 */
1265#define FRU_MR_MGMT_MAXDATA (FRU__FILE_MR_MGMT_MAXDATA)
1266
1296typedef struct {
1298 union {
1301 struct {
1302 } psu;
1305 struct {
1306 } dco;
1309 struct {
1310 } edco;
1313 struct {
1314 } dcl;
1317 struct {
1318 } edcl;
1320 struct {
1323
1337 char data[FRU_MR_MGMT_MAXDATA + 1]; /* 1 byte for terminator */
1338 } mgmt;
1341 struct {
1342 } bcr;
1345 struct {
1346 } ecr;
1349 struct {
1350 union {
1353 struct {
1354 } smbus;
1357 struct {
1358 } legacy;
1361 struct {
1362 } rc;
1363 };
1364 } asf;
1365
1368 struct {
1369 union {
1372 struct {
1374 uint8_t p1v8_init;
1375 uint8_t p1v8_max;
1376 uint8_t p3v3_init;
1377 uint8_t p3v3_max;
1379 uint8_t p5v_init;
1380 uint8_t p5v_max;
1381 uint8_t p12v_init;
1382 uint8_t p12v_max;
1383 uint8_t ptherm_max;
1384 uint64_t capacity_lo;
1385 uint32_t capacity_mid;
1386 uint8_t capacity_hi;
1387 } info;
1390 struct {
1391 } pcie;
1394 struct {
1395 } topology;
1396 };
1397 } nvme;
1398
1401 struct {
1402 uint32_t mfg_id;
1413 char data[FRU_MRR_OEM_MAXDATA];
1414 } oem;
1415
1422 struct {
1423 uint8_t type;
1424 fru_field_enc_t enc;
1435 char data[FRU_MRR_RAW_MAXDATA];
1436 } raw;
1437 };
1438} fru_mr_rec_t;
1439
1464fru_mr_rec_t * fru_add_mr(fru_t * fru, size_t index, fru_mr_rec_t * rec);
1465
1495fru_mr_rec_t * fru_get_mr(const fru_t * fru, size_t index);
1496
1523fru_mr_rec_t * fru_find_mr(const fru_t * fru, fru_mr_type_t type, size_t * index);
1524
1543bool fru_replace_mr(fru_t * fru, size_t index, fru_mr_rec_t * rec);
1544
1561bool fru_delete_mr(fru_t * fru, size_t index);
1562
1589bool fru_set_internal_binary(fru_t * fru, const void * buffer, size_t size);
1590
1629bool fru_set_internal_hexstring(fru_t * fru, const void * hexstr);
1630
1646
#define FRU_FIELDMAXARRAY
For C-string allocation.
Definition fru.h:132
fru_board_field_t
Indices of mandatory fields in Board Info Area.
Definition fru.h:393
fru_lang_t
Language code definitions as per IPMI FRU Specification, Table 15-1.
Definition fru.h:355
@ FRU_BOARD_MFG
Definition fru.h:394
@ FRU_BOARD_SERIAL
Definition fru.h:396
@ FRU_BOARD_PARTNO
Definition fru.h:397
@ FRU_BOARD_FIELD_COUNT
Definition fru.h:399
@ FRU_BOARD_FILE
Definition fru.h:398
@ FRU_BOARD_PRODNAME
Definition fru.h:395
@ FRU_LANG_ENGLISH
English language code.
Definition fru.h:357
@ FRU_LANG_DEFAULT
Default Language code, implies English as per Table 15-1.
Definition fru.h:356
fru_chassis_field_t
Indices of mandatory fields in Chassis Info Area.
Definition fru.h:335
@ FRU_CHASSIS_SERIAL
Definition fru.h:337
@ FRU_CHASSIS_PARTNO
Definition fru.h:336
@ FRU_CHASSIS_FIELD_COUNT
Definition fru.h:338
fru_flags_t
Debug flags to FRU decoding functions.
Definition fru.h:573
bool fru_savefile(const char *fname, const fru_t *fru)
Encode a FRU info structure into a binary file.
fru_area_position_t
Define FRU area position in the binary file.
Definition fru.h:832
bool fru_savebuffer(void **bufptr, size_t *size, const fru_t *fru)
Encode a FRU info structure into a binary buffer.
bool fru_enable_area(fru_t *fru, fru_area_type_t area, fru_area_position_t after)
Enable a previously disabled / non-present area.
bool fru_disable_area(fru_t *fru, fru_area_type_t atype)
Disable a previously enabled / present area.
fru_t * fru_loadfile(fru_t *fru, const char *filename, fru_flags_t flags)
Load FRU information from a binary file.
fru_t * fru_loadbuffer(fru_t *fru, const void *buf, size_t size, fru_flags_t flags)
Load FRU information from a binary file.
fru_area_type_t
FRU area types.
Definition fru.h:467
fru_t * fru_init(fru_t *fru)
Initialize/allocate a fru structure.
void fru_wipe(fru_t *fru)
Wipe the contents of a fru_t structure.
bool fru_move_area(fru_t *fru, fru_area_type_t area, fru_area_position_t after)
Move an enabled/present area.
int16_t fru_hex2byte(const char *hex)
Convert 2 first bytes of hex string into a binary byte.
@ FRU_IGNRDCKSUM
Ignore record data checksum for multirecord area.
Definition fru.h:584
@ FRU_IGNMRDATALEN
Ignore invalid MR record data length where possible.
Definition fru.h:594
@ FRU_IGNACKSUM
Ignore area checksum.
Definition fru.h:581
@ FRU_IGNFHCKSUM
Ignore FRU header checksum.
Definition fru.h:576
@ FRU_IGNRVER
Ignore record version for multirecord area.
Definition fru.h:579
@ FRU_IGNBIG
Don't fail on binary file load if the file is bigger than 64K, attempt to load it anyway (may be dang...
Definition fru.h:589
@ FRU_IGNFVER
Ignore FRU version in FRU header.
Definition fru.h:575
@ FRU_IGNAVER
Ignore area version.
Definition fru.h:578
@ FRU_NOFLAGS
No flags, operate normally.
Definition fru.h:574
@ FRU_IGNMRVER
Ignore invalid MR record version where possible.
Definition fru.h:593
@ FRU_IGNRHCKSUM
Ignore record header checksum for multirecord area.
Definition fru.h:582
@ FRU_IGNAEOF
Ignore no end-of-fields marker in info areas.
Definition fru.h:592
@ FRU_IGNRNOEOL
Ignore absence of EOL-flagged MR area record, use any previous valid records.
Definition fru.h:586
@ FRU_IGNFDCKSUM
Ignore FRU data checksum.
Definition fru.h:577
@ FRU_APOS_FIRST
Put an area first in the order.
Definition fru.h:834
@ FRU_AFTER_BOARD
Put an area after Board Info Area.
Definition fru.h:840
@ FRU_AFTER_INTERNAL
Put an area after Internal Use Area.
Definition fru.h:837
@ FRU_AFTER_PRODUCT
Put an area after Product Info Area.
Definition fru.h:841
@ FRU_APOS_AUTO
Position an area automatically as per the default order given in FRU Spec.
Definition fru.h:835
@ FRU_APOS_LAST
Put an area last in the order.
Definition fru.h:833
@ FRU_APOS_MAX
Maximum 'real' position.
Definition fru.h:843
@ FRU_AFTER_MR
Put an area after Multirecord Area.
Definition fru.h:842
@ FRU_APOS_MIN
Minimum 'real' position.
Definition fru.h:838
@ FRU_AFTER_CHASSIS
Put an area after Chassis Info Area.
Definition fru.h:839
@ FRU_BOARD_INFO
Board information area.
Definition fru.h:471
@ FRU_INTERNAL_USE
Internal use area.
Definition fru.h:468
@ FRU_MR
Multirecord area.
Definition fru.h:473
@ FRU_MAX_AREA
Maximum area type (equals FRU_MR)
Definition fru.h:474
@ FRU_TOTAL_AREAS
Maximum total count of areas in a FRU file.
Definition fru.h:475
@ FRU_PRODUCT_INFO
Product information area.
Definition fru.h:472
@ FRU_CHASSIS_INFO
Chassis information area.
Definition fru.h:470
@ FRU_MIN_AREA
Minimum area type (equals FRU_INTERNAL_USE)
Definition fru.h:469
bool fru_setfield(fru_field_t *field, fru_field_enc_t encoding, const char *string)
Copy string to the given field, perform length check according to selected encoding,...
bool fru_delete_custom(fru_t *fru, fru_area_type_t atype, size_t index)
Delete a custom data field in the area of the given type in the given fru structure.
void * fru_custom_t
A list of custom fields of an info area.
Definition fru.h:304
fru_field_enc_t
Field encoding type.
Definition fru.h:213
bool fru_setfield_binary(fru_field_t *field, const void *buf, size_t size)
Copy a binary input buffer into the given field, perform length check, truncate if needed.
fru_field_t * fru_add_custom(fru_t *fru, fru_area_type_t atype, size_t index, fru_field_enc_t encoding, const char *string)
Add a custom field to the given area type in the given fru structure.
fru_field_t * fru_get_custom(const fru_t *fru, fru_area_type_t atype, size_t index)
Get a pointer to a custom data field in the area of the given type in the given fru structure.
fru_field_t * fru_getfield(const fru_t *fru, fru_area_type_t atype, size_t index)
Get a pointer to a mandatory field in the info area of the given type in the given fru structure.
@ FRU_FE_AUTO
When saving, detect the encoding automatically based on the character range of fru_field_t....
Definition fru.h:237
@ FRU_FE_BINARY
Encode the field as binary, the value is a hex string (e.g., 1337C0DE)
Definition fru.h:221
@ FRU_FE_TOTALCOUNT
Total count of all field encodings (including the extensions)
Definition fru.h:243
@ FRU_FE_MAX
Maximim valid 'real' field encoding, equals FRU_FE_TEXT.
Definition fru.h:235
@ FRU_FE_PRESERVE
Preserve the field encoding as it was, fail if impossible.
Definition fru.h:240
@ FRU_FE_BASE
Base encoding, starting at which all the binary FRU file field encodings are mapped.
Definition fru.h:219
@ FRU_FE_EMPTY
The field is empty.
Definition fru.h:214
@ FRU_FE_UNKNOWN
Field encoding couldn't be detected or wasn't set.
Definition fru.h:239
@ FRU_FE_TEXT
Encode the field as plain text (ASCII+Latin1).
Definition fru.h:232
@ FRU_FE_6BITASCII
Encode the field as 6-bit ASCII, the value may only contain characters per Table 13-1 of IPMI FRU Spe...
Definition fru.h:228
@ FRU_FE_BCDPLUS
Encode the field as BCD+, the value may only contain digits 0-9, space, dash, or period.
Definition fru.h:225
@ FRU_FE_MIN
The minumum non-auto (real) encoding, equals FRU_FE_BINARY.
Definition fru.h:223
@ FRU_FE_REALCOUNT
Total count of standard field encodings (not including the extensions)
Definition fru.h:245
bool fru_delete_internal(fru_t *fru)
Delete internal use area from FRU structure.
bool fru_set_internal_hexstring(fru_t *fru, const void *hexstr)
Set internal use area from a hex string.
bool fru_set_internal_binary(fru_t *fru, const void *buffer, size_t size)
Set internal use area from binary buffer.
#define FRU_MRR_RAW_MAXDATA
Maximum length of Custom/Raw MR record data in decoded form (NUL-terminated hex string)
Definition fru.h:1194
fru_mr_rec_t * fru_get_mr(const fru_t *fru, size_t index)
Get a multirecord area record at the given index.
#define FRU_MR_MGMT_MAXDATA
Maximum length of data in MR Management Access record.
Definition fru.h:1265
fru_nvme_ff_t
NVMe Form-Factor, see NVMe-MI Spec rev 1.2b, Figure 160.
Definition fru.h:1239
fru_mr_type_t
MultiRecord Area Record Types (Table 16-2)
Definition fru.h:1133
void * fru_mr_t
A pointer to multi-record area descriptor.
Definition fru.h:454
bool fru_replace_mr(fru_t *fru, size_t index, fru_mr_rec_t *rec)
Replace a multirecord area record at the given index.
#define FRU_MRR_OEM_MAXDATA
Maximum length of OEM MR record data in decoded form (NUL-terminated hex string)
Definition fru.h:1188
fru_mr_mgmt_type_t
Management Access Record subtypes (Table 18-6)
Definition fru.h:1200
fru_mr_rec_t * fru_add_mr(fru_t *fru, size_t index, fru_mr_rec_t *rec)
Add a multirecord area record.
fru_mr_rec_t * fru_find_mr(const fru_t *fru, fru_mr_type_t type, size_t *index)
Find a multirecord area record of the given type or at the given index.
bool fru_delete_mr(fru_t *fru, size_t index)
Delete a multirecord area record at the given index.
@ FRU_NVME_FF_UNKNOWN
Definition fru.h:1240
@ FRU_MR_ECR
Extended Compatibility Record.
Definition fru.h:1140
@ FRU_MR_RAW
The raw type.
Definition fru.h:1158
@ FRU_MR_DC_OUT
DC Output.
Definition fru.h:1136
@ FRU_MR_PSU_INFO
PSU Information.
Definition fru.h:1135
@ FRU_MR_DC_LOAD
DC Load.
Definition fru.h:1137
@ FRU_MR_NVME_PCIE_PORT
NVMe PCIe Port.
Definition fru.h:1150
@ FRU_MR_ASF_FIXED_SMBUS
ASF Fixed SMBus Addresses.
Definition fru.h:1142
@ FRU_MR_OEM_END
End of OEM range.
Definition fru.h:1156
@ FRU_MR_NVME
NVMe Information.
Definition fru.h:1149
@ FRU_MR_BCR
Base Compatibility Record.
Definition fru.h:1139
@ FRU_MR_NVME_RSVD_F
Reserved.
Definition fru.h:1153
@ FRU_MR_MIN
The minimum valid MR record type that can be saved.
Definition fru.h:1134
@ FRU_MR_EXT_DC_OUT
Extended DC Output.
Definition fru.h:1146
@ FRU_MR_MGMT_ACCESS
Management Access Record.
Definition fru.h:1138
@ FRU_MR_EMPTY
MR Record is empty, will be skipped during saving.
Definition fru.h:1161
@ FRU_MR_TYPE_COUNT
Total number of MR record types (including 'raw')
Definition fru.h:1159
@ FRU_MR_ASF_LEGACY_ALERTS
ASF Lecacy-Device Alerts.
Definition fru.h:1143
@ FRU_MR_OEM_START
Start of OEM range.
Definition fru.h:1155
@ FRU_MR_ASF_REMOTE_CTRL
ASF Remote Control.
Definition fru.h:1144
@ FRU_MR_MAX
The maximum valid MR record type that can be saved.
Definition fru.h:1157
@ FRU_MR_NVME_RSVD_E
Reserved.
Definition fru.h:1152
@ FRU_MR_ANY
Any MR Record type, for use with fru_find_mr() only.
Definition fru.h:1160
@ FRU_MR_EXT_DC_LOAD
Extended DC Load.
Definition fru.h:1147
@ FRU_MR_NVME_TOPOLOGY
NVMe Topolgy.
Definition fru.h:1151
@ FRU_MR_MGMT_SYS_NAME
System Name.
Definition fru.h:1204
@ FRU_MR_MGMT_MIN
The minimum valid (real) subtype.
Definition fru.h:1202
@ FRU_MR_MGMT_INVALID
Invalid subtype, do not use.
Definition fru.h:1201
@ FRU_MR_MGMT_SYS_UUID
System Unique ID.
Definition fru.h:1209
@ FRU_MR_MGMT_INDEX_COUNT
The count of 0-based indices of valid subtypes, can be used as an array dimension.
Definition fru.h:1211
@ FRU_MR_MGMT_COMPONENT_URL
Component URL.
Definition fru.h:1206
@ FRU_MR_MGMT_MAX
The maximum valid subtype.
Definition fru.h:1210
@ FRU_MR_MGMT_COMPONENT_NAME
Component Name.
Definition fru.h:1207
@ FRU_MR_MGMT_SYS_PING
System Ping Address.
Definition fru.h:1205
@ FRU_MR_MGMT_SYS_URL
System URL.
Definition fru.h:1203
@ FRU_MR_MGMT_COMPONENT_PING
Component Ping Address.
Definition fru.h:1208
fru_prod_field_t
Indices of mandatory fields in Product Info Area.
Definition fru.h:431
@ FRU_PROD_NAME
Definition fru.h:433
@ FRU_PROD_FILE
Definition fru.h:438
@ FRU_PROD_FIELD_COUNT
Definition fru.h:439
@ FRU_PROD_ASSET
Definition fru.h:437
@ FRU_PROD_SERIAL
Definition fru.h:436
@ FRU_PROD_MFG
Definition fru.h:432
@ FRU_PROD_MODELPN
Definition fru.h:434
@ FRU_PROD_VERSION
Definition fru.h:435
The exploded representation of board info area.
Definition fru.h:368
fru_field_t serial
Board serial number.
Definition fru.h:380
fru_field_t pname
Board product name.
Definition fru.h:379
fru_field_t file
FRU File ID.
Definition fru.h:382
fru_field_t mfg
Board manufacturer name.
Definition fru.h:378
fru_lang_t lang
Language code.
Definition fru.h:369
bool tv_auto
On save, use current date/time.
Definition fru.h:371
fru_custom_t cust
List of custom fields.
Definition fru.h:383
fru_field_t pn
Board part number.
Definition fru.h:381
The exploded representation of chassis info area.
Definition fru.h:321
uint8_t type
Chassis type as per SMBIOS specification.
Definition fru.h:322
fru_field_t pn
Part Number.
Definition fru.h:323
fru_custom_t cust
List of custom fields.
Definition fru.h:325
fru_field_t serial
Serial Number.
Definition fru.h:324
A generic input (decoded) field structure.
Definition fru.h:295
fru_field_enc_t enc
The encoding of the field.
Definition fru.h:296
MultiRecord area record type.
Definition fru.h:1296
fru_field_enc_t enc
OEM data encoding.
Definition fru.h:1404
uint8_t p1v8_max
Definition fru.h:1375
uint8_t p3v3_init
Definition fru.h:1376
uint8_t p12v_init
Definition fru.h:1381
uint8_t p12v_max
Definition fru.h:1382
uint8_t p3v3_aux_max
Definition fru.h:1378
uint8_t p5v_max
Definition fru.h:1380
fru_mr_type_t type
Record Type.
Definition fru.h:1297
uint32_t mfg_id
Manufacturer ID, 24 bits.
Definition fru.h:1402
uint8_t type
The actual record Type.
Definition fru.h:1423
uint8_t p5v_init
Definition fru.h:1379
fru_nvme_ff_t formfactor
Form-Factor as per NVMe-MI 1.2b Figure 160.
Definition fru.h:1373
uint8_t ptherm_max
Definition fru.h:1383
uint64_t capacity_lo
Total capacity, higher 8 bytes, 13:6 of 13, host-endian.
Definition fru.h:1384
uint8_t p1v8_init
Definition fru.h:1374
uint8_t p3v3_max
Definition fru.h:1377
uint32_t capacity_mid
Total capacity, middle 4 bytes, 5:2 of 13, host-endian.
Definition fru.h:1385
fru_mr_mgmt_type_t subtype
Management Access Record subtype.
Definition fru.h:1322
uint8_t capacity_hi
Total capacity, middle 4 bytes, 1 of 13.
Definition fru.h:1386
The exploded representation of product info area.
Definition fru.h:412
fru_field_t file
FRU File ID.
Definition fru.h:420
fru_field_t serial
Product serial number.
Definition fru.h:418
fru_field_t mfg
Product manufacturer.
Definition fru.h:414
fru_lang_t lang
Definition fru.h:413
fru_field_t atag
Product asset tag.
Definition fru.h:419
fru_field_t pn
Product part number.
Definition fru.h:416
fru_field_t pname
Product name.
Definition fru.h:415
fru_field_t ver
Product version.
Definition fru.h:417
fru_custom_t cust
List of custom fields.
Definition fru.h:421
Exploded/decoded FRU data structure.
Definition fru.h:522
char * internal
Internal use area as a hex string.
Definition fru.h:549
fru_mr_t mr
The multi-record area descriptor.
Definition fru.h:553
fru_board_t board
The board information structure.
Definition fru.h:551
fru_chassis_t chassis
The chassis information structure.
Definition fru.h:550
fru_product_t product
The product information structure.
Definition fru.h:552