From 19e729013197be8ba7faccd88004043ac1e7e27f Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Fri, 24 Jan 2020 11:05:20 -0600 Subject: 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 Change-Id: I2b7f2915dceb9c306466b8181cae05a3ddd65057 --- extensions/openpower-pels/manager.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'extensions/openpower-pels/manager.hpp') 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 - The contained PEL data + */ + static std::vector eselToRawData(const std::string& esel); + private: /** * @brief Adds a received raw PEL to the PEL repository @@ -207,6 +221,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& 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 */ -- cgit v1.2.1