libfru 3.1.0.g6643c5c
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/time.h>
16#include <sys/types.h>
17
51#define LIBFRU_MAJOR 3L
52#define LIBFRU_MINOR 1L
53#define LIBFRU_SUBMINOR 0L
54
65#define LIBFRU_VERSION (LIBFRU_MAJOR << 16 | \
66 LIBFRU_MINOR << 8 | \
67 LIBFRU_SUBMINOR)
68
71/*
72 * Private macro definitions.
73 *
74 * These macros aren't for library users, but they are needed for public
75 * interfaces definition.
76 *
77 * @cond PRIVATE
78 */
79
81#define fru__zfree(buf) do { \
82 int err = errno; /* Prevent errno corruption */ \
83 free(buf); \
84 (buf) = NULL; \
85 errno = err; \
86} while(0)
87
88#define FRU__BIT(x) (1 << (x))
89
90/*
91 * Field types per Section 13 of IPMI FRU Specification,
92 * in their binary/encoded representation
93 */
94#define FRU__TYPE_BINARY 0x00
95#define FRU__TYPE_BCDPLUS 0x01
96#define FRU__TYPE_ASCII_6BIT 0x02
97#define FRU__TYPE_TEXT 0x03
98
99#define FRU__TYPE_BITS_MASK 0xC0
100#define FRU__FIELDLEN(x) ((size_t)(((x) & ~FRU__TYPE_BITS_MASK)))
101
105#define FRU__FIELDMAXLEN FRU__FIELDLEN(UINT8_MAX)
108/*
109 * The `+0LL` trick is to make some old versions of gcc happy
110 * when `a` is of a smaller type than `b`. Without this trick
111 * the compiler would always throw a 'comparison is always
112 * false' warning. Newer versions of gcc don't have that bug,
113 * but `+0LL` is a no-op anyway, so it's here unconditionally.
114 */
115#define FRU_MAX(a, b) (((intmax_t)((a) + 0LL) > (intmax_t)((b) + 0LL)) ? (a) : (b))
116#define FRU_MIN(a, b) (((intmax_t)((a) + 0LL) > (intmax_t)((b) + 0LL)) ? (b) : (a))
117
134// BCD+ decoded data is twice the length of encoded,
135// so is hex string for binary data
136#define FRU_FIELDMAXARRAY ((2 * FRU__FIELDMAXLEN) + 1)
137
138/*
139 * Public definitions
140 */
141
146#define FRU_INFO_AREAS 3
147#define FRU_FIRST_INFO_AREA FRU_CHASSIS_INFO
148#define FRU_LAST_INFO_AREA FRU_PRODUCT_INFO
150#define FRU_IS_INFO_AREA(atype) (FRU_FIRST_INFO_AREA <= (atype) \
151 && (atype) <= FRU_LAST_INFO_AREA)
152
157#define FRU_ATYPE_TO_INFOIDX(atype) (FRU_IS_INFO_AREA(atype) ? (int)((atype) - FRU_FIRST_INFO_AREA) : -1)
158
163#define FRU_INFOIDX_TO_ATYPE(idx) (((idx) >= 0 && (idx) < FRU_INFO_AREAS) \
164 ? (fru_area_type_t)((idx) + FRU_FIRST_INFO_AREA) \
165 : (fru_area_type_t)(-1))
166
184#define FRU_INFOIDX(a) FRU_ATYPE_TO_INFOIDX(FRU_##a##_INFO)
185
202#define FRU_FOREACH_INFOIDX(it) for ((it) = 0; (it) <= FRU_INFO_AREAS; (it)++)
203
223#define FRU_FOREACH_INFOFIELD(fru, atype, f, idx) \
224 for (size_t idx = FRU_LIST_HEAD; \
225 (f = fru_getfield(fru, atype, idx)); \
226 idx++)
227
247#define FRU_FOREACH_INFOCUSTOM(fru, atype, f, idx) \
248 for (size_t idx = FRU_LIST_HEAD; \
249 (f = fru_get_custom(fru, atype, idx)); \
250 idx++)
251
265typedef enum {
273 FRU_FE_BINARY = (FRU__TYPE_BINARY + FRU_FE_BASE),
277 FRU_FE_BCDPLUS = (FRU__TYPE_BCDPLUS + FRU_FE_BASE),
280 FRU_FE_6BITASCII = (FRU__TYPE_ASCII_6BIT + FRU_FE_BASE),
284 FRU_FE_TEXT = (FRU__TYPE_TEXT + FRU_FE_BASE),
301
307#define FRU_REAL_FE(t) ((t) - FRU_FE_BASE)
308
314#define FRU_FE_FROMREAL(t) ((t) + FRU_FE_BASE)
315
321#define FRU_FE_IS_REAL(t) (FRU_FE_MIN <= (t) && (t) <= FRU_FE_MAX)
322
328#define FRU_FIELD_IS_REAL_ENC(f) ((f) && FRU_FE_IS_REAL((f)->enc))
329
335#define FRU_FIELD_IS_AUTO_ENC(f) ((f) && FRU_FE_AUTO == ((f)->enc))
336
347typedef struct {
354
356typedef void * fru_custom_t; // The actual type is not for public use
357
379
411
437
453
475
493
498#define FRU_MAX_FIELD_COUNT FRU_PROD_FIELD_COUNT
499
506typedef void * fru_mr_t; // The actual type is not for public use
507
508
530#define FRU_IS_VALID_AREA(atype) (FRU_MIN_AREA <= (atype) && (atype) <= FRU_MAX_AREA)
531
556#define FRU_FOREACH_AREA(it) for ((it) = FRU_MIN_AREA; (it) <= FRU_MAX_AREA; (it)++)
557
610
612#define FRU_ATYPE_HAS_TYPE(atype) (FRU_CHASSIS_INFO == (atype))
614#define FRU_ATYPE_HAS_LANG(atype) (FRU_BOARD_INFO == (atype) || FRU_PRODUCT_INFO == (atype))
615
625typedef enum {
627 FRU_IGNFVER = FRU__BIT(0),
628 FRU_IGNFHCKSUM = FRU__BIT(1),
629 FRU_IGNFDCKSUM = FRU__BIT(2),
630 FRU_IGNAVER = FRU__BIT(3),
631 FRU_IGNRVER = FRU__BIT(4),
633 FRU_IGNACKSUM = FRU__BIT(5),
634 FRU_IGNRHCKSUM = FRU__BIT(6),
636 FRU_IGNRDCKSUM = FRU__BIT(7),
638 FRU_IGNRNOEOL = FRU__BIT(8),
641 FRU_IGNBIG = FRU__BIT(9),
644 FRU_IGNAEOF = FRU__BIT(10),
645 FRU_IGNMRVER = FRU__BIT(11),
646 FRU_IGNMRDATALEN = FRU__BIT(12),
685 fru_field_enc_t encoding,
686 const char * string);
687
716 const void * buf,
717 size_t size);
718
759 fru_area_type_t atype,
760 size_t index);
799 fru_area_type_t atype,
800 size_t index,
801 fru_field_enc_t encoding,
802 const char * string);
803
829 fru_area_type_t atype,
830 size_t index);
831
855 fru_area_type_t atype,
856 size_t index);
857
866#define FRU_ARRAY_SZ(a) (sizeof(a) / sizeof((a)[0]))
867
880int16_t fru_hex2byte(const char * hex);
881
890#define FRU_LIST_HEAD 0
892#define FRU_LIST_TAIL INT_MAX
893
894
918#define FRU_IS_APOS_VALID(pos) (FRU_APOS_LAST <= (pos) && (pos) <= FRU_APOS_MAX)
919
920
952
990 const char * filename,
991 fru_flags_t flags);
992
1009 const void * buf,
1010 size_t size,
1011 fru_flags_t flags);
1012
1013
1031void fru_wipe(fru_t * fru);
1032
1043#define fru_free(fru) do { fru_wipe(fru); fru__zfree(fru); } while(0)
1044
1104 fru_area_type_t area,
1105 fru_area_position_t after);
1106
1127
1139 fru_area_type_t area,
1140 fru_area_position_t after);
1141
1184bool fru_savebuffer(void ** bufptr, size_t * size, const fru_t * fru);
1185
1199bool fru_savefile(const char * fname, const fru_t * fru);
1200
1244
1246#define FRU_MR_IS_VALID_TYPE(t) (FRU_MR_MIN <= (t) && (t) <= FRU_MR_MAX)
1247
1249#define FRU_MR_OEM_COUNT (FRU_MR_OEM_END - FRU_MR_OEM_START + 1)
1250
1252#define FRU_MR_OEM(n) (FRU_MR_OEM_START + (n))
1253
1255#define FRU__FILE_MRR_MAXDATA (UINT8_MAX)
1258#define FRU__FILE_MRR_OEM_MFGID_LEN 3
1265/*
1266 * Encoded data must not exceed maximum possible MR record
1267 * data size. That's why we subtract the MFG ID length.
1268 */
1269#define FRU_MRR_OEM_MAXDATA \
1270 ((FRU__FILE_MRR_MAXDATA - FRU__FILE_MRR_OEM_MFGID_LEN) * 2 + 1)
1271
1275#define FRU_MRR_RAW_MAXDATA \
1276 (FRU__FILE_MRR_MAXDATA * 2 + 1)
1277
1296
1298#define FRU_MR_MGMT_IS_SUBTYPE_VALID(mt) ((mt) >= FRU_MR_MGMT_MIN && (mt) <= FRU_MR_MGMT_MAX)
1299
1304#define FRU_MR_MGMT_SUBTYPE_TO_IDX(mt) (FRU_MR_MGMT_IS_SUBTYPE_VALID(mt) \
1305 ? (int)((mt) - FRU_MR_MGMT_MIN) \
1306 : -1)
1311#define FRU_MR_MGMT_IDX_TO_SUBTYPE(i) (((i) >= 0 && (i) <= FRU_MR_MGMT_MAX) \
1312 ? ((i) + FRU_MR_MGMT_MIN) \
1313 : FRU_MR_MGMT_INVALID)
1314
1320typedef enum {
1323
1327#define FRU__FILE_MR_MGMT_HDR_LEN (sizeof(uint8_t))
1328
1330#define FRU__FILE_MR_MGMT_MAXDATA \
1331 (FRU__FILE_MRR_MAXDATA - FRU__FILE_MR_MGMT_HDR_LEN)
1332
1336/*
1337 * All management subtype records are plain text strings,
1338 * and even UUID, which is binary, in decoded form is
1339 * represented as a sting of 32 hex digits, which is at
1340 * least twice less than the maximum length for any of the
1341 * plain text subtypes.
1342 *
1343 * Hence, encoded and decoded lengths for plain text strings
1344 * are the same, we just use the max encoded length here
1345 */
1346#define FRU_MR_MGMT_MAXDATA (FRU__FILE_MR_MGMT_MAXDATA)
1347
1377typedef struct {
1379 union {
1382 struct {
1383 } psu;
1386 struct {
1387 } dco;
1390 struct {
1391 } edco;
1394 struct {
1395 } dcl;
1398 struct {
1399 } edcl;
1401 struct {
1404
1418 char data[FRU_MR_MGMT_MAXDATA + 1]; /* 1 byte for terminator */
1419 } mgmt;
1422 struct {
1423 } bcr;
1426 struct {
1427 } ecr;
1430 struct {
1431 union {
1434 struct {
1435 } smbus;
1438 struct {
1439 } legacy;
1442 struct {
1443 } rc;
1444 };
1445 } asf;
1446
1449 struct {
1450 union {
1453 struct {
1455 uint8_t p1v8_init;
1456 uint8_t p1v8_max;
1457 uint8_t p3v3_init;
1458 uint8_t p3v3_max;
1460 uint8_t p5v_init;
1461 uint8_t p5v_max;
1462 uint8_t p12v_init;
1463 uint8_t p12v_max;
1464 uint8_t ptherm_max;
1465 uint64_t capacity_lo;
1466 uint32_t capacity_mid;
1467 uint8_t capacity_hi;
1468 } info;
1471 struct {
1472 } pcie;
1475 struct {
1476 } topology;
1477 };
1478 } nvme;
1479
1482 struct {
1483 uint32_t mfg_id;
1494 char data[FRU_MRR_OEM_MAXDATA];
1495 } oem;
1496
1503 struct {
1504 uint8_t type;
1505 fru_field_enc_t enc;
1516 char data[FRU_MRR_RAW_MAXDATA];
1517 } raw;
1518 };
1519} fru_mr_rec_t;
1520
1545fru_mr_rec_t * fru_add_mr(fru_t * fru, size_t index, fru_mr_rec_t * rec);
1546
1576fru_mr_rec_t * fru_get_mr(const fru_t * fru, size_t index);
1577
1604fru_mr_rec_t * fru_find_mr(const fru_t * fru, fru_mr_type_t type, size_t * index);
1605
1624bool fru_replace_mr(fru_t * fru, size_t index, fru_mr_rec_t * rec);
1625
1642bool fru_delete_mr(fru_t * fru, size_t index);
1643
1670bool fru_set_internal_binary(fru_t * fru, const void * buffer, size_t size);
1671
1710bool fru_set_internal_hexstring(fru_t * fru, const void * hexstr);
1711
1727
#define FRU_FIELDMAXARRAY
For C-string allocation.
Definition fru.h:136
fru_board_field_t
Indices of mandatory fields in Board Info Area.
Definition fru.h:445
fru_lang_t
Language code definitions as per IPMI FRU Specification, Table 15-1.
Definition fru.h:407
@ FRU_BOARD_MFG
Definition fru.h:446
@ FRU_BOARD_SERIAL
Definition fru.h:448
@ FRU_BOARD_PARTNO
Definition fru.h:449
@ FRU_BOARD_FIELD_COUNT
Definition fru.h:451
@ FRU_BOARD_FILE
Definition fru.h:450
@ FRU_BOARD_PRODNAME
Definition fru.h:447
@ FRU_LANG_ENGLISH
English language code.
Definition fru.h:409
@ FRU_LANG_DEFAULT
Default Language code, implies English as per Table 15-1.
Definition fru.h:408
fru_chassis_field_t
Indices of mandatory fields in Chassis Info Area.
Definition fru.h:387
@ FRU_CHASSIS_SERIAL
Definition fru.h:389
@ FRU_CHASSIS_PARTNO
Definition fru.h:388
@ FRU_CHASSIS_FIELD_COUNT
Definition fru.h:390
fru_flags_t
Debug flags to FRU decoding functions.
Definition fru.h:625
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:905
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:519
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.
@ FRU_IGNRDCKSUM
Ignore record data checksum for multirecord area.
Definition fru.h:636
@ FRU_IGNMRDATALEN
Ignore invalid MR record data length where possible.
Definition fru.h:646
@ FRU_IGNACKSUM
Ignore area checksum.
Definition fru.h:633
@ FRU_IGNFHCKSUM
Ignore FRU header checksum.
Definition fru.h:628
@ FRU_IGNRVER
Ignore record version for multirecord area.
Definition fru.h:631
@ 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:641
@ FRU_IGNFVER
Ignore FRU version in FRU header.
Definition fru.h:627
@ FRU_IGNAVER
Ignore area version.
Definition fru.h:630
@ FRU_NOFLAGS
No flags, operate normally.
Definition fru.h:626
@ FRU_IGNMRVER
Ignore invalid MR record version where possible.
Definition fru.h:645
@ FRU_IGNRHCKSUM
Ignore record header checksum for multirecord area.
Definition fru.h:634
@ FRU_IGNAEOF
Ignore no end-of-fields marker in info areas.
Definition fru.h:644
@ FRU_IGNRNOEOL
Ignore absence of EOL-flagged MR area record, use any previous valid records.
Definition fru.h:638
@ FRU_IGNFDCKSUM
Ignore FRU data checksum.
Definition fru.h:629
@ FRU_APOS_FIRST
Put an area first in the order.
Definition fru.h:907
@ FRU_AFTER_BOARD
Put an area after Board Info Area.
Definition fru.h:913
@ FRU_AFTER_INTERNAL
Put an area after Internal Use Area.
Definition fru.h:910
@ FRU_AFTER_PRODUCT
Put an area after Product Info Area.
Definition fru.h:914
@ FRU_APOS_AUTO
Position an area automatically as per the default order given in FRU Spec.
Definition fru.h:908
@ FRU_APOS_LAST
Put an area last in the order.
Definition fru.h:906
@ FRU_APOS_MAX
Maximum 'real' position.
Definition fru.h:916
@ FRU_AFTER_MR
Put an area after Multirecord Area.
Definition fru.h:915
@ FRU_APOS_MIN
Minimum 'real' position.
Definition fru.h:911
@ FRU_AFTER_CHASSIS
Put an area after Chassis Info Area.
Definition fru.h:912
@ FRU_BOARD_INFO
Board information area.
Definition fru.h:523
@ FRU_INTERNAL_USE
Internal use area.
Definition fru.h:520
@ FRU_MR
Multirecord area.
Definition fru.h:525
@ FRU_MAX_AREA
Maximum area type (equals FRU_MR)
Definition fru.h:526
@ FRU_TOTAL_AREAS
Maximum total count of areas in a FRU file.
Definition fru.h:527
@ FRU_PRODUCT_INFO
Product information area.
Definition fru.h:524
@ FRU_CHASSIS_INFO
Chassis information area.
Definition fru.h:522
@ FRU_MIN_AREA
Minimum area type (equals FRU_INTERNAL_USE)
Definition fru.h:521
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:356
fru_field_enc_t
Field encoding type.
Definition fru.h:265
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:289
@ FRU_FE_BINARY
Encode the field as binary, the value is a hex string (e.g., 1337C0DE)
Definition fru.h:273
@ FRU_FE_TOTALCOUNT
Total count of all field encodings (including the extensions)
Definition fru.h:295
@ FRU_FE_MAX
Maximim valid 'real' field encoding, equals FRU_FE_TEXT.
Definition fru.h:287
@ FRU_FE_PRESERVE
Preserve the field encoding as it was, fail if impossible.
Definition fru.h:292
@ FRU_FE_BASE
Base encoding, starting at which all the binary FRU file field encodings are mapped.
Definition fru.h:271
@ FRU_FE_EMPTY
The field is empty.
Definition fru.h:266
@ FRU_FE_UNKNOWN
Field encoding couldn't be detected or wasn't set.
Definition fru.h:291
@ FRU_FE_TEXT
Encode the field as plain text (ASCII+Latin1).
Definition fru.h:284
@ 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:280
@ FRU_FE_BCDPLUS
Encode the field as BCD+, the value may only contain digits 0-9, space, dash, or period.
Definition fru.h:277
@ FRU_FE_MIN
The minumum non-auto (real) encoding, equals FRU_FE_BINARY.
Definition fru.h:275
@ FRU_FE_REALCOUNT
Total count of standard field encodings (not including the extensions)
Definition fru.h:297
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:1275
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:1346
fru_nvme_ff_t
NVMe Form-Factor, see NVMe-MI Spec rev 1.2b, Figure 160.
Definition fru.h:1320
fru_mr_type_t
MultiRecord Area Record Types (Table 16-2)
Definition fru.h:1214
void * fru_mr_t
A pointer to multi-record area descriptor.
Definition fru.h:506
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:1269
fru_mr_mgmt_type_t
Management Access Record subtypes (Table 18-6)
Definition fru.h:1281
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:1321
@ FRU_MR_ECR
Extended Compatibility Record.
Definition fru.h:1221
@ FRU_MR_RAW
The raw type.
Definition fru.h:1239
@ FRU_MR_DC_OUT
DC Output.
Definition fru.h:1217
@ FRU_MR_PSU_INFO
PSU Information.
Definition fru.h:1216
@ FRU_MR_DC_LOAD
DC Load.
Definition fru.h:1218
@ FRU_MR_NVME_PCIE_PORT
NVMe PCIe Port.
Definition fru.h:1231
@ FRU_MR_ASF_FIXED_SMBUS
ASF Fixed SMBus Addresses.
Definition fru.h:1223
@ FRU_MR_OEM_END
End of OEM range.
Definition fru.h:1237
@ FRU_MR_NVME
NVMe Information.
Definition fru.h:1230
@ FRU_MR_BCR
Base Compatibility Record.
Definition fru.h:1220
@ FRU_MR_NVME_RSVD_F
Reserved.
Definition fru.h:1234
@ FRU_MR_MIN
The minimum valid MR record type that can be saved.
Definition fru.h:1215
@ FRU_MR_EXT_DC_OUT
Extended DC Output.
Definition fru.h:1227
@ FRU_MR_MGMT_ACCESS
Management Access Record.
Definition fru.h:1219
@ FRU_MR_EMPTY
MR Record is empty, will be skipped during saving.
Definition fru.h:1242
@ FRU_MR_TYPE_COUNT
Total number of MR record types (including 'raw')
Definition fru.h:1240
@ FRU_MR_ASF_LEGACY_ALERTS
ASF Lecacy-Device Alerts.
Definition fru.h:1224
@ FRU_MR_OEM_START
Start of OEM range.
Definition fru.h:1236
@ FRU_MR_ASF_REMOTE_CTRL
ASF Remote Control.
Definition fru.h:1225
@ FRU_MR_MAX
The maximum valid MR record type that can be saved.
Definition fru.h:1238
@ FRU_MR_NVME_RSVD_E
Reserved.
Definition fru.h:1233
@ FRU_MR_ANY
Any MR Record type, for use with fru_find_mr() only.
Definition fru.h:1241
@ FRU_MR_EXT_DC_LOAD
Extended DC Load.
Definition fru.h:1228
@ FRU_MR_NVME_TOPOLOGY
NVMe Topolgy.
Definition fru.h:1232
@ FRU_MR_MGMT_SYS_NAME
System Name.
Definition fru.h:1285
@ FRU_MR_MGMT_MIN
The minimum valid (real) subtype.
Definition fru.h:1283
@ FRU_MR_MGMT_INVALID
Invalid subtype, do not use.
Definition fru.h:1282
@ FRU_MR_MGMT_SYS_UUID
System Unique ID.
Definition fru.h:1290
@ FRU_MR_MGMT_INDEX_COUNT
The count of 0-based indices of valid subtypes, can be used as an array dimension.
Definition fru.h:1292
@ FRU_MR_MGMT_COMPONENT_URL
Component URL.
Definition fru.h:1287
@ FRU_MR_MGMT_MAX
The maximum valid subtype.
Definition fru.h:1291
@ FRU_MR_MGMT_COMPONENT_NAME
Component Name.
Definition fru.h:1288
@ FRU_MR_MGMT_SYS_PING
System Ping Address.
Definition fru.h:1286
@ FRU_MR_MGMT_SYS_URL
System URL.
Definition fru.h:1284
@ FRU_MR_MGMT_COMPONENT_PING
Component Ping Address.
Definition fru.h:1289
fru_prod_field_t
Indices of mandatory fields in Product Info Area.
Definition fru.h:483
@ FRU_PROD_NAME
Definition fru.h:485
@ FRU_PROD_FILE
Definition fru.h:490
@ FRU_PROD_FIELD_COUNT
Definition fru.h:491
@ FRU_PROD_ASSET
Definition fru.h:489
@ FRU_PROD_SERIAL
Definition fru.h:488
@ FRU_PROD_MFG
Definition fru.h:484
@ FRU_PROD_MODELPN
Definition fru.h:486
@ FRU_PROD_VERSION
Definition fru.h:487
int16_t fru_hex2byte(const char *hex)
Convert 2 first bytes of hex string into a binary byte.
The exploded representation of board info area.
Definition fru.h:420
fru_field_t serial
Board serial number.
Definition fru.h:432
fru_field_t pname
Board product name.
Definition fru.h:431
fru_field_t file
FRU File ID.
Definition fru.h:434
fru_field_t mfg
Board manufacturer name.
Definition fru.h:430
fru_lang_t lang
Language code.
Definition fru.h:421
bool tv_auto
On save, use current date/time.
Definition fru.h:423
fru_custom_t cust
List of custom fields.
Definition fru.h:435
fru_field_t pn
Board part number.
Definition fru.h:433
The exploded representation of chassis info area.
Definition fru.h:373
uint8_t type
Chassis type as per SMBIOS specification.
Definition fru.h:374
fru_field_t pn
Part Number.
Definition fru.h:375
fru_custom_t cust
List of custom fields.
Definition fru.h:377
fru_field_t serial
Serial Number.
Definition fru.h:376
A generic input (decoded) field structure.
Definition fru.h:347
fru_field_enc_t enc
The encoding of the field.
Definition fru.h:348
MultiRecord area record type.
Definition fru.h:1377
fru_field_enc_t enc
OEM data encoding.
Definition fru.h:1485
uint8_t p1v8_max
Definition fru.h:1456
uint8_t p3v3_init
Definition fru.h:1457
uint8_t p12v_init
Definition fru.h:1462
uint8_t p12v_max
Definition fru.h:1463
uint8_t p3v3_aux_max
Definition fru.h:1459
uint8_t p5v_max
Definition fru.h:1461
fru_mr_type_t type
Record Type.
Definition fru.h:1378
uint32_t mfg_id
Manufacturer ID, 24 bits.
Definition fru.h:1483
uint8_t type
The actual record Type.
Definition fru.h:1504
uint8_t p5v_init
Definition fru.h:1460
fru_nvme_ff_t formfactor
Form-Factor as per NVMe-MI 1.2b Figure 160.
Definition fru.h:1454
uint8_t ptherm_max
Definition fru.h:1464
uint64_t capacity_lo
Total capacity, higher 8 bytes, 13:6 of 13, host-endian.
Definition fru.h:1465
uint8_t p1v8_init
Definition fru.h:1455
uint8_t p3v3_max
Definition fru.h:1458
uint32_t capacity_mid
Total capacity, middle 4 bytes, 5:2 of 13, host-endian.
Definition fru.h:1466
fru_mr_mgmt_type_t subtype
Management Access Record subtype.
Definition fru.h:1403
uint8_t capacity_hi
Total capacity, middle 4 bytes, 1 of 13.
Definition fru.h:1467
The exploded representation of product info area.
Definition fru.h:464
fru_field_t file
FRU File ID.
Definition fru.h:472
fru_field_t serial
Product serial number.
Definition fru.h:470
fru_field_t mfg
Product manufacturer.
Definition fru.h:466
fru_lang_t lang
Definition fru.h:465
fru_field_t atag
Product asset tag.
Definition fru.h:471
fru_field_t pn
Product part number.
Definition fru.h:468
fru_field_t pname
Product name.
Definition fru.h:467
fru_field_t ver
Product version.
Definition fru.h:469
fru_custom_t cust
List of custom fields.
Definition fru.h:473
Exploded/decoded FRU data structure.
Definition fru.h:574
char * internal
Internal use area as a hex string.
Definition fru.h:601
fru_mr_t mr
The multi-record area descriptor.
Definition fru.h:605
fru_board_t board
The board information structure.
Definition fru.h:603
fru_chassis_t chassis
The chassis information structure.
Definition fru.h:602
fru_product_t product
The product information structure.
Definition fru.h:604