Reorganize the setEventReceiver code
This commit is to re-organise the code to make the
setEventReceiver optional when GetTID gets called.
Currently, it is being called on every GetTID command.
This is and OEM behaviour, which was implemented at -
https://gerrit.openbmc.org/c/openbmc/pldm/+/41779/36
Also, setEventReceiver is a command defined in the platform
Spec, so rightfully placing it under the platform handler.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: Ib60e9d46a8eaf4806c5ec2e9575f4e219bc80eab
diff --git a/libpldmresponder/base.hpp b/libpldmresponder/base.hpp
index 544e913..7ccac27 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -1,8 +1,6 @@
#pragma once
#include "libpldmresponder/platform.hpp"
-#include "pldmd/handler.hpp"
-#include "requester/handler.hpp"
#include <libpldm/base.h>
#include <stdint.h>
@@ -22,13 +20,10 @@
class Handler : public CmdHandler
{
public:
- Handler(uint8_t eid, pldm::InstanceIdDb& instanceIdDb,
- sdeventplus::Event& event,
- pldm::responder::oem_platform::Handler* oemPlatformHandler,
- pldm::requester::Handler<pldm::requester::Request>* handler) :
- eid(eid),
- instanceIdDb(instanceIdDb), event(event),
- oemPlatformHandler(oemPlatformHandler), handler(handler)
+ Handler(sdeventplus::Event& event,
+ pldm::responder::oem_platform::Handler* oemPlatformHandler) :
+ event(event),
+ oemPlatformHandler(oemPlatformHandler)
{
handlers.emplace(
PLDM_GET_PLDM_TYPES,
@@ -82,7 +77,7 @@
*
* @param[in] source - sdeventplus event source
*/
- void processSetEventReceiver(sdeventplus::source::EventBase& source);
+ void _processSetEventReceiver(sdeventplus::source::EventBase& source);
/** @brief Handler for getTID
*
@@ -93,12 +88,6 @@
Response getTID(const pldm_msg* request, size_t payloadLength);
private:
- /** @brief MCTP EID of host firmware */
- uint8_t eid;
-
- /** @brief An instance ID database for allocating instance IDs. */
- InstanceIdDb& instanceIdDb;
-
/** @brief reference of main event loop of pldmd, primarily used to schedule
* work
*/
@@ -107,9 +96,6 @@
/** @brief OEM platform handler */
pldm::responder::oem_platform::Handler* oemPlatformHandler;
- /** @brief PLDM request handler */
- pldm::requester::Handler<pldm::requester::Request>* handler;
-
/** @brief sdeventplus event source */
std::unique_ptr<sdeventplus::source::Defer> survEvent;
};