Add hooks to route BIOS events to Redfish
This adds a hook to check the content of an IPMI SEL record
before it is added to the SEL. If it comes from the BIOS,
the message will be logged as a Redfish event instead of
an IPMI SEL.
Change-Id: Ib6e6acfefc9f0a26e0e70f0712e1a5eb804edba4
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/src/sensorcommands.cpp b/src/sensorcommands.cpp
index bf1f430..ba64fe4 100644
--- a/src/sensorcommands.cpp
+++ b/src/sensorcommands.cpp
@@ -20,6 +20,7 @@
#include <cmath>
#include <commandutils.hpp>
#include <iostream>
+#include <ipmi_to_redfish_hooks.hpp>
#include <ipmid/api.hpp>
#include <ipmid/utils.hpp>
#include <phosphor-logging/log.hpp>
@@ -311,6 +312,16 @@
return ipmi::responseReqDataLenInvalid();
}
+ // Send this request to the Redfish hooks to see if it should be a
+ // Redfish message instead. If so, no need to add it to the SEL, so
+ // just return success.
+ if (intel_oem::ipmi::sel::checkRedfishHooks(
+ generatorID, evmRev, sensorType, sensorNum, eventType, eventData1,
+ eventData2.value_or(0xFF), eventData3.value_or(0xFF)))
+ {
+ return ipmi::responseSuccess();
+ }
+
bool assert = eventType & directionMask ? false : true;
std::vector<uint8_t> eventData;
eventData.push_back(eventData1);