BMC RR : Read and update the status for BMC reset
This commit reads the status of the host owned sensors by
sending a getStateSensorReading command and then
updates the D-Bus backend for BMC reset.
This commit also updates the TLPDR from the host
based on the valid bit in the TLPDR.
Earlier the PDR record handles where assigned in an incremental order
starting from 0, now the numbering has been decided
to be within the specified range as below
BMC: 0x00000001 to 0x00FFFFFF (0x00000000 is reserved per PLDM spec)
Hostboot: 0x01000000 to 0x01FFFFFF
PHYP: 0x02000000 to 0x02FFFFFF
Reserved: 0x03000000 to 0xFFFFFFFF
This commit handles the numbering of the PDR record handles.
Tested the following scenarios on a rainier system
1. restart pldmd when Host is not running
2. restart pldmd when Host is running
3. restart pldmd when Host is not running and then ipl
Using pldmtool the DBus backened is verified.
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Change-Id: Idb9eb642dbf766bb587a3a4075e4dce2c9da2de5
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index 094ea34..d53b8a7 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -161,6 +161,7 @@
// added for the FRU
uint16_t recordSetIdentifier = 0;
auto numRecsCount = numRecs;
+ static uint32_t bmc_record_handle = 0;
for (auto const& [recType, encType, fieldInfos] : recordInfos)
{
@@ -221,9 +222,11 @@
if (numRecs == numRecsCount)
{
recordSetIdentifier = nextRSI();
+ bmc_record_handle = nextRecordHandle();
pldm_pdr_add_fru_record_set(
pdrRepo, 0, recordSetIdentifier, entity.entity_type,
- entity.entity_instance_num, entity.entity_container_id);
+ entity.entity_instance_num, entity.entity_container_id,
+ bmc_record_handle);
}
auto curSize = table.size();
table.resize(curSize + recHeaderSize + tlvs.size());
diff --git a/libpldmresponder/fru.hpp b/libpldmresponder/fru.hpp
index 963a606..986a3d2 100644
--- a/libpldmresponder/fru.hpp
+++ b/libpldmresponder/fru.hpp
@@ -155,6 +155,12 @@
return ++rsi;
}
+ uint32_t nextRecordHandle()
+ {
+ return ++rh;
+ }
+
+ uint32_t rh = 0;
uint16_t rsi = 0;
uint16_t numRecs = 0;
uint8_t padBytes = 0;