oem_ibm: Add Slot enable infrastructure in BMC
With this commit PDRs are created for each of these
PCIe slots and adapters which have a corresponding
entry in the entity associate map. The sensor/effector
states are monitored and accordingly D-Bus calls are
sent for enabling a slot, process property change
of a PCIe slot, etc.
Tested By: SIMICS power on/off and reset reload.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I51b79b75c909ddf2cc29872fec6aa01c2d56b418
diff --git a/pldmd/oem_ibm.hpp b/pldmd/oem_ibm.hpp
index 67ad482..6003125 100644
--- a/pldmd/oem_ibm.hpp
+++ b/pldmd/oem_ibm.hpp
@@ -75,6 +75,7 @@
oemIbmFruHandler->setIBMFruHandler(fruHandler);
createCodeUpdate();
+ createSlotHandler();
createOemPlatformHandler();
createOemIbmUtilsHandler();
codeUpdate->setOemPlatformHandler(oemPlatformHandler.get());
@@ -82,6 +83,7 @@
hostPDRHandler->setOemUtilsHandler(oemUtilsHandler.get());
platformHandler->setOemPlatformHandler(oemPlatformHandler.get());
baseHandler->setOemPlatformHandler(oemPlatformHandler.get());
+ slotHandler->setOemPlatformHandler(oemPlatformHandler.get());
createOemIbmPlatformHandler();
oemIbmPlatformHandler->setPlatformHandler(platformHandler);
@@ -99,6 +101,13 @@
codeUpdate->clearDirPath(LID_STAGING_DIR);
}
+ /** @brief Method for creating slot handler */
+ void createSlotHandler()
+ {
+ slotHandler =
+ std::make_unique<pldm::responder::SlotHandler>(event, repo);
+ }
+
/** @brief Method for creating oemPlatformHandler
*
* This method also assigns the oemPlatformHandler to the below
@@ -106,10 +115,9 @@
*/
void createOemPlatformHandler()
{
- oemPlatformHandler =
- std::make_unique<responder::oem_ibm_platform::Handler>(
- dBusIntf, codeUpdate.get(), mctp_fd, mctp_eid, instanceIdDb,
- event, reqHandler);
+ oemPlatformHandler = std::make_unique<oem_ibm_platform::Handler>(
+ dBusIntf, codeUpdate.get(), slotHandler.get(), mctp_fd, mctp_eid,
+ instanceIdDb, event, reqHandler);
}
/** @brief Method for creating oemIbmPlatformHandler */
@@ -195,6 +203,9 @@
/** @brief pointer to the CodeUpdate class*/
std::unique_ptr<pldm::responder::CodeUpdate> codeUpdate{};
+ /** @brief pointer to the SlotHanlder class*/
+ std::unique_ptr<pldm::responder::SlotHandler> slotHandler{};
+
/** @brief oem IBM Platform handler*/
pldm::responder::oem_ibm_platform::Handler* oemIbmPlatformHandler = nullptr;