platform-mc: PDR handling
Get PDRs of new terminus if it supports GetPDR PLDM command. It doesn't
handle the event receiver related initialization steps, and either
doesn't support primary PDR repository to maintain terminus locator PDR
information yet.
Added parse PDR member functions to terminus class for parsing Numeric
sensor PDR and sensor auxiliary names PDR.
Added sensor auxiliary names PDR and numeric sensor PDR struct in
libpldm/platform.h
Signed-off-by: Gilbert Chen <gilbert.chen@arm.com>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: I30a0cc594a3c08fc17f2dad861b5c5d41c80ebdd
diff --git a/platform-mc/platform_manager.hpp b/platform-mc/platform_manager.hpp
index a7fd412..8187ca1 100644
--- a/platform-mc/platform_manager.hpp
+++ b/platform-mc/platform_manager.hpp
@@ -6,6 +6,8 @@
#include "terminus.hpp"
#include "terminus_manager.hpp"
+#include <vector>
+
namespace pldm
{
@@ -40,6 +42,53 @@
exec::task<int> initTerminus();
private:
+ /** @brief Fetch all PDRs from terminus.
+ *
+ * @param[in] terminus - The terminus object to store fetched PDRs
+ * @return coroutine return_value - PLDM completion code
+ */
+ exec::task<int> getPDRs(std::shared_ptr<Terminus> terminus);
+
+ /** @brief Fetch PDR from terminus
+ *
+ * @param[in] tid - Destination TID
+ * @param[in] recordHndl - Record handle
+ * @param[in] dataTransferHndl - Data transfer handle
+ * @param[in] transferOpFlag - Transfer Operation Flag
+ * @param[in] requstCnt - Request Count of data
+ * @param[in] recordChgNum - Record change number
+ * @param[out] nextRecordHndl - Next record handle
+ * @param[out] nextDataTransferHndl - Next data transfer handle
+ * @param[out] transferFlag - Transfer flag
+ * @param[out] responseCnt - Response count of record data
+ * @param[out] recordData - Returned record data
+ * @param[out] transferCrc - CRC value when record data is last part of PDR
+ * @return coroutine return_value - PLDM completion code
+ */
+ exec::task<int>
+ getPDR(const pldm_tid_t tid, const uint32_t recordHndl,
+ const uint32_t dataTransferHndl, const uint8_t transferOpFlag,
+ const uint16_t requestCnt, const uint16_t recordChgNum,
+ uint32_t& nextRecordHndl, uint32_t& nextDataTransferHndl,
+ uint8_t& transferFlag, uint16_t& responseCnt,
+ std::vector<uint8_t>& recordData, uint8_t& transferCrc);
+
+ /** @brief get PDR repository information.
+ *
+ * @param[in] tid - Destination TID
+ * @param[out] repositoryState - the state of repository
+ * @param[out] recordCount - number of records
+ * @param[out] repositorySize - repository size
+ * @param[out] largestRecordSize - largest record size
+ * *
+ * @return coroutine return_value - PLDM completion code
+ */
+ exec::task<int> getPDRRepositoryInfo(const pldm_tid_t tid,
+ uint8_t& repositoryState,
+ uint32_t& recordCount,
+ uint32_t& repositorySize,
+ uint32_t& largestRecordSize);
+
/** reference of TerminusManager for sending PLDM request to terminus*/
TerminusManager& terminusManager;