summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/manager.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2020-01-24 11:05:20 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-02-14 19:15:42 +0000
commit19e729013197be8ba7faccd88004043ac1e7e27f (patch)
treee79843df36fa1ab5de5a0f59c44003f649f86259 /extensions/openpower-pels/manager.hpp
parente95fd0154e723813f5d7bf981e97b7ca6f28f7ef (diff)
downloadphosphor-logging-19e729013197be8ba7faccd88004043ac1e7e27f.tar.gz
phosphor-logging-19e729013197be8ba7faccd88004043ac1e7e27f.zip
PEL: Add PELs from ESELs
When the OpenPower host firmware subsystem hostboot creates PELs, those PELs get added to OpenBMC event logs in the ESEL entry of the AdditionalData property. (Eventually hostboot will update their code to use PLDM to send down PELs.) This commit looks for that ESEL keyword on incoming event logs, extracts the PEL data, and adds it to the PEL repository with all of the other PELs. It extracts the PEL data by converting the string value to a vector of uint8_ts starting after the IPMI data fields contained in that string. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b7f2915dceb9c306466b8181cae05a3ddd65057
Diffstat (limited to 'extensions/openpower-pels/manager.hpp')
-rw-r--r--extensions/openpower-pels/manager.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/extensions/openpower-pels/manager.hpp b/extensions/openpower-pels/manager.hpp
index bec67ca..86030d4 100644
--- a/extensions/openpower-pels/manager.hpp
+++ b/extensions/openpower-pels/manager.hpp
@@ -161,6 +161,20 @@ class Manager : public PELInterface
*/
void hostReject(uint32_t pelID, RejectionReason reason) override;
+ /**
+ * @brief Converts the ESEL field in an OpenBMC event log to a
+ * vector of uint8_ts that just contains the PEL data.
+ *
+ * That data string looks like: "50 48 00 ab ..."
+ *
+ * Throws an exception on any failures.
+ *
+ * @param[in] esel - The ESEL string
+ *
+ * @return std::vector<uint8_t> - The contained PEL data
+ */
+ static std::vector<uint8_t> eselToRawData(const std::string& esel);
+
private:
/**
* @brief Adds a received raw PEL to the PEL repository
@@ -208,6 +222,23 @@ class Manager : public PELInterface
void closeFD(int fd, sdeventplus::source::EventBase& source);
/**
+ * @brief Adds a PEL to the repository given its data
+ *
+ * @param[in] pelData - The PEL to add as a vector of uint8_ts
+ * @param[in] obmcLogID - the OpenBMC event log ID
+ */
+ void addPEL(std::vector<uint8_t>& pelData, uint32_t obmcLogID);
+
+ /**
+ * @brief Adds the PEL stored in the ESEL field of the AdditionalData
+ * property of an OpenBMC event log to the repository.
+ *
+ * @param[in] esel - The ESEL AdditionalData contents
+ * @param[in] obmcLogID - The OpenBMC event log ID
+ */
+ void addESELPEL(const std::string& esel, uint32_t obmcLogID);
+
+ /**
* @brief Reference to phosphor-logging's Manager class
*/
phosphor::logging::internal::Manager& _logManager;
OpenPOWER on IntegriCloud