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/libpldm/pdr.h b/libpldm/pdr.h
index 8f4d893..45ac9a6 100644
--- a/libpldm/pdr.h
+++ b/libpldm/pdr.h
@@ -144,6 +144,18 @@
  */
 void pldm_pdr_remove_remote_pdrs(pldm_pdr *repo);
 
+/** @brief Update the validity of TL PDR - the validity is decided based on
+ * whether the valid bit is set or not as per the spec DSP0248
+ *
+ * @param[in] repo - opaque pointer acting as a PDR repo handle
+ * @param[in] terminusHandle - PLDM terminus handle
+ * @param[in] tid - Terminus ID
+ * @param[in] tlEid - MCTP endpoint EID
+ * @param[in] valid - validity bit of TLPDR
+ */
+void pldm_pdr_update_TL_pdr(const pldm_pdr *repo, uint16_t terminusHandle,
+			    uint8_t tid, uint8_t tlEid, bool valid);
+
 /* ======================= */
 /* FRU Record Set PDR APIs */
 /* ======================= */
@@ -157,13 +169,15 @@
  *  @param[in] entity_type - entity type of FRU
  *  @param[in] entity_instance_num - entity instance number of FRU
  *  @param[in] container_id - container id of FRU
+ *  @param[in] bmc_record_handle - handle used to construct the next record
  *
  *  @return uint32_t - record handle assigned to PDR record
  */
 uint32_t pldm_pdr_add_fru_record_set(pldm_pdr *repo, uint16_t terminus_handle,
 				     uint16_t fru_rsi, uint16_t entity_type,
 				     uint16_t entity_instance_num,
-				     uint16_t container_id);
+				     uint16_t container_id,
+				     uint32_t bmc_record_handle);
 
 /** @brief Find a FRU record set PDR by FRU record set identifier
  *