ibm-oem: add FileAck handler for PELs
Extend the FileAck* commands to let the host firmware to ack PELs it has
received from the BMC.
Signed-off-by: vkaverap <vkaverap@in.ibm.com>
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: Iafc1c92c64c8ea7a51367c2c36842613af1f46b5
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.cpp b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
index 06ced26..8029b47 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pel.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
@@ -141,6 +141,29 @@
return rc;
}
+int PelHandler::fileAck(uint8_t /*fileStatus*/)
+{
+ static constexpr auto logObjPath = "/xyz/openbmc_project/logging";
+ static constexpr auto logInterface = "org.open_power.Logging.PEL";
+ static sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
+
+ try
+ {
+ auto service = getService(bus, logObjPath, logInterface);
+ auto method = bus.new_method_call(service.c_str(), logObjPath,
+ logInterface, "HostAck");
+ method.append(fileHandle);
+ bus.call_noreply(method);
+ }
+ catch (const std::exception& e)
+ {
+ std::cerr << "HostAck D-Bus call failed";
+ return PLDM_ERROR;
+ }
+
+ return PLDM_SUCCESS;
+}
+
int PelHandler::storePel(std::string&& pelFileName)
{
static constexpr auto logObjPath = "/xyz/openbmc_project/logging";