Increase FRU data field length up to 63 bytes
IPMI spec v2.0 rev. 1.1, the type/length byte (section 43.15)
has bit 5 reserved and only bits [4:0] for data length (with value 11111b reserved),
which limits the data length up to 31 bytes max.
However, FRU spec v1.0 rev. 1.3, the type/length byte (section 13)
has bits [5:0] used for data length, allowing up to 63 bytes of data.
Change-Id: I105b58fba04cdfed1f338284ac1454fd11784cc5
Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
diff --git a/ipmi_fru_info_area.cpp b/ipmi_fru_info_area.cpp
index b220f02..4093ae5 100644
--- a/ipmi_fru_info_area.cpp
+++ b/ipmi_fru_info_area.cpp
@@ -40,7 +40,7 @@
static constexpr auto manufacturingDateSize = 0x3;
static constexpr auto areaSizeOffset = 0x1;
static constexpr uint8_t typeASCII = 0xC0;
-static constexpr auto maxRecordAttributeValue = 0x1F;
+static constexpr auto maxRecordAttributeValue = 0x3F;
static constexpr auto secs_from_1970_1996 = 820454400;
static constexpr auto maxMfgDateValue = 0xFFFFFF; // 3 Byte length
@@ -174,8 +174,8 @@
value.erase(0, 2);
}
- // 5 bits for length
- // if length is greater then 31(2^5) bytes then trim the data to 31
+ // 6 bits for length as per FRU spec v1.0
+ // if length is greater then 63(2^6) bytes then trim the data to 63
// bytess.
auto valueLength = (value.length() > maxRecordAttributeValue)
? maxRecordAttributeValue