1a743e384SChau Ly #pragma once 2a743e384SChau Ly 3a743e384SChau Ly #include "common/instance_id.hpp" 4a743e384SChau Ly #include "common/types.hpp" 5a743e384SChau Ly #include "oem_event_manager.hpp" 6a743e384SChau Ly #include "platform-mc/manager.hpp" 7a743e384SChau Ly #include "requester/handler.hpp" 8a743e384SChau Ly #include "requester/request.hpp" 9a743e384SChau Ly 10*fe252795SManojkiran Eda #include <libpldm/pldm.h> 11*fe252795SManojkiran Eda 12a743e384SChau Ly namespace pldm 13a743e384SChau Ly { 14a743e384SChau Ly namespace oem_ampere 15a743e384SChau Ly { 16a743e384SChau Ly using namespace pldm::pdr; 174a503837SDung Cao #define NORMAL_EVENT_POLLING_TIME 5000000 // ms 18a743e384SChau Ly 19a743e384SChau Ly using EventToMsgMap_t = std::unordered_map<uint8_t, std::string>; 20a743e384SChau Ly 21a743e384SChau Ly enum sensor_ids 22a743e384SChau Ly { 23cebf476dSChau Ly DDR_STATUS = 51, 244cca3dc9SChau Ly PCP_VR_STATE = 75, 254cca3dc9SChau Ly SOC_VR_STATE = 80, 264cca3dc9SChau Ly DPHY_VR1_STATE = 85, 274cca3dc9SChau Ly DPHY_VR2_STATE = 90, 284cca3dc9SChau Ly D2D_VR_STATE = 95, 294cca3dc9SChau Ly IOC_VR1_STATE = 100, 304cca3dc9SChau Ly IOC_VR2_STATE = 105, 314cca3dc9SChau Ly PCI_D_VR_STATE = 110, 324cca3dc9SChau Ly PCI_A_VR_STATE = 115, 333de0d94eSChau Ly PCIE_HOT_PLUG = 169, 34ef214b5aSChau Ly SOC_HEALTH_AVAILABILITY = 170, 35a743e384SChau Ly BOOT_OVERALL = 175, 36b01357fcSChau Ly WATCH_DOG = 179, 3779f9ff6bSThu Nguyen CORE_UE = 192, 3879f9ff6bSThu Nguyen MCU_UE = 194, 3979f9ff6bSThu Nguyen PCIE_UE = 196, 4079f9ff6bSThu Nguyen SOC_UE = 198, 4179f9ff6bSThu Nguyen SOC_BERT = 200, 42a743e384SChau Ly }; 43a743e384SChau Ly 44a743e384SChau Ly namespace boot 45a743e384SChau Ly { 46a743e384SChau Ly namespace status 47a743e384SChau Ly { 48a743e384SChau Ly enum boot_status 49a743e384SChau Ly { 50a743e384SChau Ly BOOT_STATUS_SUCCESS = 0x80, 51a743e384SChau Ly BOOT_STATUS_FAILURE = 0x81, 52a743e384SChau Ly }; 53a743e384SChau Ly } // namespace status 54a743e384SChau Ly namespace stage 55a743e384SChau Ly { 56a743e384SChau Ly enum boot_stage 57a743e384SChau Ly { 58a743e384SChau Ly UEFI_STATUS_CLASS_CODE_MIN = 0x00, 59a743e384SChau Ly UEFI_STATUS_CLASS_CODE_MAX = 0x7f, 60a743e384SChau Ly SECPRO = 0x90, 61a743e384SChau Ly MPRO = 0x91, 62a743e384SChau Ly ATF_BL1 = 0x92, 63a743e384SChau Ly ATF_BL2 = 0x93, 64a743e384SChau Ly DDR_INITIALIZATION = 0x94, 65a743e384SChau Ly DDR_TRAINING = 0x95, 66a743e384SChau Ly S0_DDR_TRAINING_FAILURE = 0x96, 67a743e384SChau Ly ATF_BL31 = 0x97, 68a743e384SChau Ly ATF_BL32 = 0x98, 69a743e384SChau Ly S1_DDR_TRAINING_FAILURE = 0x99, 70a743e384SChau Ly }; 71a743e384SChau Ly } // namespace stage 72a743e384SChau Ly } // namespace boot 73a743e384SChau Ly 74a743e384SChau Ly enum class log_level : int 75a743e384SChau Ly { 76a743e384SChau Ly OK, 773de0d94eSChau Ly WARNING, 783de0d94eSChau Ly CRITICAL, 79a743e384SChau Ly BIOSFWPANIC, 80a743e384SChau Ly }; 81a743e384SChau Ly 823de0d94eSChau Ly /* 833de0d94eSChau Ly * PresentReading value format 843de0d94eSChau Ly * FIELD | COMMENT 853de0d94eSChau Ly * Bit 31 | Reserved 863de0d94eSChau Ly * Bit 30:24 | Media slot number (0 - 63) This field can be used by UEFI 873de0d94eSChau Ly * | to indicate the media slot number (such as NVMe/SSD slot) 883de0d94eSChau Ly * | (7 bits) 893de0d94eSChau Ly * Bit 23 | Operation status: 1 = operation failed 903de0d94eSChau Ly * | 0 = operation successful 913de0d94eSChau Ly * Bit 22 | Action: 0 - Insertion 1 - Removal 923de0d94eSChau Ly * Bit 21:18 | Function (4 bits) 933de0d94eSChau Ly * Bit 17:13 | Device (5 bits) 943de0d94eSChau Ly * Bit 12:5 | Bus (8 bits) 953de0d94eSChau Ly * Bit 4:0 | Segment (5 bits) 963de0d94eSChau Ly */ 973de0d94eSChau Ly typedef union 983de0d94eSChau Ly { 993de0d94eSChau Ly uint32_t value; 1003de0d94eSChau Ly struct 1013de0d94eSChau Ly { 1023de0d94eSChau Ly uint32_t segment:5; 1033de0d94eSChau Ly uint32_t bus:8; 1043de0d94eSChau Ly uint32_t device:5; 1053de0d94eSChau Ly uint32_t function:4; 1063de0d94eSChau Ly uint32_t action:1; 1073de0d94eSChau Ly uint32_t opStatus:1; 1083de0d94eSChau Ly uint32_t mediaSlot:7; 1093de0d94eSChau Ly uint32_t reserved:1; 1103de0d94eSChau Ly } __attribute__((packed)) bits; 1113de0d94eSChau Ly } PCIeHotPlugEventRecord_t; 1123de0d94eSChau Ly 113cebf476dSChau Ly typedef union 114cebf476dSChau Ly { 115cebf476dSChau Ly uint32_t value; 116cebf476dSChau Ly struct 117cebf476dSChau Ly { 118cebf476dSChau Ly uint32_t type:2; 119cebf476dSChau Ly uint32_t mcuRankIdx:3; 120cebf476dSChau Ly uint32_t reserved_1:3; // byte0 121cebf476dSChau Ly uint32_t sliceNum:4; 122cebf476dSChau Ly uint32_t upperNibbStatErr:1; 123cebf476dSChau Ly uint32_t lowerNibbStatErr:1; 124cebf476dSChau Ly uint32_t reserved_2:2; // byte1 125cebf476dSChau Ly uint32_t syndrome:4; 126cebf476dSChau Ly uint32_t reserved_3:4; // byte2 127cebf476dSChau Ly uint32_t reserved_byte:8; 128cebf476dSChau Ly } __attribute__((packed)) bits; 129cebf476dSChau Ly } DIMMTrainingFailure_t; 130cebf476dSChau Ly 131cebf476dSChau Ly namespace ddr 132cebf476dSChau Ly { 133cebf476dSChau Ly namespace status 134cebf476dSChau Ly { 135cebf476dSChau Ly enum ddr_status 136cebf476dSChau Ly { 137cebf476dSChau Ly NO_SYSTEM_LEVEL_ERROR = 0x01, 138cebf476dSChau Ly ECC_INITIALIZATION_FAILURE = 0x04, 139cebf476dSChau Ly CONFIGURATION_FAILURE = 0x05, 140cebf476dSChau Ly TRAINING_FAILURE = 0x06, 141cebf476dSChau Ly OTHER_FAILURE = 0x07, 142cebf476dSChau Ly BOOT_FAILURE_NO_VALID_CONFIG = 0x08, 143cebf476dSChau Ly FAILSAFE_ACTIVATED_NEXT_BOOT_SUCCESS = 0x09, 144cebf476dSChau Ly }; 145cebf476dSChau Ly } 146cebf476dSChau Ly } // namespace ddr 147cebf476dSChau Ly 148cebf476dSChau Ly namespace dimm 149cebf476dSChau Ly { 150cebf476dSChau Ly namespace status 151cebf476dSChau Ly { 152cebf476dSChau Ly enum dimm_status 153cebf476dSChau Ly { 154cebf476dSChau Ly INSTALLED_NO_ERROR = 0x01, 155cebf476dSChau Ly NOT_INSTALLED = 0x02, 156cebf476dSChau Ly OTHER_FAILURE = 0x07, 157cebf476dSChau Ly INSTALLED_BUT_DISABLED = 0x10, 158cebf476dSChau Ly TRAINING_FAILURE = 0x12, 159cebf476dSChau Ly PMIC_HIGH_TEMP = 0x13, 160cebf476dSChau Ly TSx_HIGH_TEMP = 0x14, 161cebf476dSChau Ly SPD_HUB_HIGH_TEMP = 0x15, 162cebf476dSChau Ly PMIC_TEMP_ALERT = 0x16, 163cebf476dSChau Ly }; 164cebf476dSChau Ly } // namespace status 165cebf476dSChau Ly 166cebf476dSChau Ly namespace training_failure 167cebf476dSChau Ly { 168cebf476dSChau Ly enum dimm_training_failure_type 169cebf476dSChau Ly { 170cebf476dSChau Ly PHY_TRAINING_FAILURE_TYPE = 0x01, 171cebf476dSChau Ly DIMM_TRAINING_FAILURE_TYPE = 0x02, 172cebf476dSChau Ly }; 173cebf476dSChau Ly 174cebf476dSChau Ly namespace phy_syndrome 175cebf476dSChau Ly { 176cebf476dSChau Ly enum phy_training_failure_syndrome 177cebf476dSChau Ly { 178cebf476dSChau Ly NA = 0x00, 179cebf476dSChau Ly PHY_TRAINING_SETUP_FAILURE = 0x01, 180cebf476dSChau Ly CA_LEVELING = 0x02, 181cebf476dSChau Ly PHY_WRITE_LEVEL_FAILURE = 0x03, 182cebf476dSChau Ly PHY_READ_GATE_LEVELING_FAILURE = 0x04, 183cebf476dSChau Ly PHY_READ_LEVEL_FAILURE = 0x05, 184cebf476dSChau Ly WRITE_DQ_LEVELING = 0x06, 185cebf476dSChau Ly PHY_SW_TRAINING_FAILURE = 0x07, 186cebf476dSChau Ly }; 187cebf476dSChau Ly } // namespace phy_syndrome 188cebf476dSChau Ly 189cebf476dSChau Ly namespace dimm_syndrome 190cebf476dSChau Ly { 191cebf476dSChau Ly enum dimm_training_failure_syndrome 192cebf476dSChau Ly { 193cebf476dSChau Ly NA = 0x00, 194cebf476dSChau Ly DRAM_VREFDQ_TRAINING_FAILURE = 0x01, 195cebf476dSChau Ly LRDIMM_DB_TRAINING_FAILURE = 0x02, 196cebf476dSChau Ly LRDRIMM_DB_SW_TRAINING_FAILURE = 0x03, 197cebf476dSChau Ly }; 198cebf476dSChau Ly } // namespace dimm_syndrome 199cebf476dSChau Ly } // namespace training_failure 200cebf476dSChau Ly } // namespace dimm 201cebf476dSChau Ly 2024cca3dc9SChau Ly /* 2034cca3dc9SChau Ly * PresentReading value format 2044cca3dc9SChau Ly * FIELD | COMMENT 2054cca3dc9SChau Ly * Bit 31:30 | Reserved (2 bits) 2064cca3dc9SChau Ly * Bit 29 | A VR Critical condition observed (1 bit) 2074cca3dc9SChau Ly * Bit 28 | A VR Warning condition observed (1 bit) 2084cca3dc9SChau Ly * Bit 27:16 | Reserved (12 bits) 2094cca3dc9SChau Ly * Bit 15:8 | VR status byte high - The bit definition is the same as the 2104cca3dc9SChau Ly * | corresponding VR PMBUS STATUS_WORD (upper byte) (8 bits) 2114cca3dc9SChau Ly * Bit 7:0 | VR status byte low - The bit definition is the same as the 2124cca3dc9SChau Ly * | corresponding VR PMBUS STATUS_WORD (lower byte) (8 bits) 2134cca3dc9SChau Ly */ 2144cca3dc9SChau Ly typedef union 2154cca3dc9SChau Ly { 2164cca3dc9SChau Ly uint32_t value; 2174cca3dc9SChau Ly struct 2184cca3dc9SChau Ly { 2194cca3dc9SChau Ly uint32_t vr_status_byte_low:8; 2204cca3dc9SChau Ly uint32_t vr_status_byte_high:8; 2214cca3dc9SChau Ly uint32_t reserved_1:12; 2224cca3dc9SChau Ly uint32_t warning:1; 2234cca3dc9SChau Ly uint32_t critical:1; 2244cca3dc9SChau Ly uint32_t reserved_2:2; 2254cca3dc9SChau Ly } __attribute__((packed)) bits; 2264cca3dc9SChau Ly } VRDStatus_t; 2274cca3dc9SChau Ly 228a743e384SChau Ly /** 229a743e384SChau Ly * @brief OemEventManager 230a743e384SChau Ly * 231a743e384SChau Ly * 232a743e384SChau Ly */ 233a743e384SChau Ly class OemEventManager 234a743e384SChau Ly { 235a743e384SChau Ly public: 236a743e384SChau Ly OemEventManager() = delete; 237a743e384SChau Ly OemEventManager(const OemEventManager&) = delete; 238a743e384SChau Ly OemEventManager(OemEventManager&&) = delete; 239a743e384SChau Ly OemEventManager& operator=(const OemEventManager&) = delete; 240a743e384SChau Ly OemEventManager& operator=(OemEventManager&&) = delete; 241a743e384SChau Ly virtual ~OemEventManager() = default; 242a743e384SChau Ly OemEventManager(sdeventplus::Event & event,requester::Handler<requester::Request> *,pldm::InstanceIdDb &,platform_mc::Manager * platformManager)243a743e384SChau Ly explicit OemEventManager( 244a743e384SChau Ly sdeventplus::Event& event, 245a743e384SChau Ly requester::Handler<requester::Request>* /* handler */, 2464a503837SDung Cao pldm::InstanceIdDb& /* instanceIdDb */, 2474a503837SDung Cao platform_mc::Manager* platformManager) : 2484a503837SDung Cao event(event), manager(platformManager) {}; 249a743e384SChau Ly 250a743e384SChau Ly /** @brief Decode sensor event messages and handle correspondingly. 251a743e384SChau Ly * 252a743e384SChau Ly * @param[in] request - the request message of sensor event 253a743e384SChau Ly * @param[in] payloadLength - the payload length of sensor event 254a743e384SChau Ly * @param[in] formatVersion - the format version of sensor event 255a743e384SChau Ly * @param[in] tid - TID 256a743e384SChau Ly * @param[in] eventDataOffset - the event data offset of sensor event 257a743e384SChau Ly * 258a743e384SChau Ly * @return int - returned error code 259a743e384SChau Ly */ 260a743e384SChau Ly int handleSensorEvent(const pldm_msg* request, size_t payloadLength, 261a743e384SChau Ly uint8_t /* formatVersion */, pldm_tid_t tid, 262a743e384SChau Ly size_t eventDataOffset); 263a743e384SChau Ly 26472c8aa06SDung Cao /** @brief Handle the polled CPER (0x07, 0xFA) event class. 26572c8aa06SDung Cao * 26672c8aa06SDung Cao * @param[in] tid - terminus ID 26772c8aa06SDung Cao * @param[out] eventId - Event ID 26872c8aa06SDung Cao * @param[in] eventData - event data 26972c8aa06SDung Cao * @param[in] eventDataSize - size of event data 27072c8aa06SDung Cao * 27172c8aa06SDung Cao * @return int - PLDM completion code 27272c8aa06SDung Cao */ 27372c8aa06SDung Cao int processOemMsgPollEvent(pldm_tid_t tid, uint16_t eventId, 27472c8aa06SDung Cao const uint8_t* eventData, size_t eventDataSize); 27572c8aa06SDung Cao 27679f9ff6bSThu Nguyen /** @brief Decode sensor event messages and handle correspondingly. 27779f9ff6bSThu Nguyen * 27879f9ff6bSThu Nguyen * @param[in] request - the request message of sensor event 27979f9ff6bSThu Nguyen * @param[in] payloadLength - the payload length of sensor event 28079f9ff6bSThu Nguyen * @param[in] formatVersion - the format version of sensor event 28179f9ff6bSThu Nguyen * @param[in] tid - TID 28279f9ff6bSThu Nguyen * @param[in] eventDataOffset - the event data offset of sensor event 28379f9ff6bSThu Nguyen * 28479f9ff6bSThu Nguyen * @return int - returned error code 28579f9ff6bSThu Nguyen */ 28679f9ff6bSThu Nguyen int handlepldmMessagePollEvent( 28779f9ff6bSThu Nguyen const pldm_msg* request, size_t payloadLength, 28879f9ff6bSThu Nguyen uint8_t /* formatVersion */, pldm_tid_t tid, size_t eventDataOffset); 28979f9ff6bSThu Nguyen 2904a503837SDung Cao /** @brief A Coroutine to do OEM PollForPlatformEvent action 2914a503837SDung Cao * 2924a503837SDung Cao * @param[in] tid - the destination TID 2934a503837SDung Cao * @return coroutine return_value - PLDM completion code 2944a503837SDung Cao */ 2954a503837SDung Cao exec::task<int> oemPollForPlatformEvent(pldm_tid_t tid); 2964a503837SDung Cao 297a743e384SChau Ly protected: 298a743e384SChau Ly /** @brief Create prefix string for logging message. 299a743e384SChau Ly * 300a743e384SChau Ly * @param[in] tid - TID 301a743e384SChau Ly * @param[in] sensorId - Sensor ID 302a743e384SChau Ly * 303a743e384SChau Ly * @return std::string - the prefeix string 304a743e384SChau Ly */ 305a743e384SChau Ly std::string prefixMsgStrCreation(pldm_tid_t tid, uint16_t sensorId); 306a743e384SChau Ly 307a743e384SChau Ly /** @brief Log the message into Redfish SEL. 308a743e384SChau Ly * 309a743e384SChau Ly * @param[in] description - the logging message 310a743e384SChau Ly * @param[in] logLevel - the logging level 311a743e384SChau Ly */ 312a743e384SChau Ly void sendJournalRedfish(const std::string& description, 313a743e384SChau Ly log_level& logLevel); 314a743e384SChau Ly 315a743e384SChau Ly /** @brief Convert the one-hot DIMM index byte into a string of DIMM 316a743e384SChau Ly * indexes. 317a743e384SChau Ly * 318a743e384SChau Ly * @param[in] dimmIdxs - the one-hot DIMM index byte 319a743e384SChau Ly * 320a743e384SChau Ly * @return std::string - the string of DIMM indexes 321a743e384SChau Ly */ 322a743e384SChau Ly std::string dimmIdxsToString(uint32_t dimmIdxs); 323a743e384SChau Ly 32493d0ca3eSThu Nguyen /** @brief Convert sensor ID to DIMM index. Return maxDIMMInstantNum 32593d0ca3eSThu Nguyen * in failure. 32693d0ca3eSThu Nguyen * 32793d0ca3eSThu Nguyen * @param[in] sensorId - sensorID 32893d0ca3eSThu Nguyen * 32993d0ca3eSThu Nguyen * @return uint8_t - DIMM index 33093d0ca3eSThu Nguyen */ 33193d0ca3eSThu Nguyen uint8_t sensorIdToDIMMIdx(const uint16_t& sensorId); 33293d0ca3eSThu Nguyen 333cebf476dSChau Ly /** @brief Convert the DIMM training failure into logging string. 334cebf476dSChau Ly * 335cebf476dSChau Ly * @param[in] failureInfo - the one-hot DIMM index byte 336cebf476dSChau Ly * 337cebf476dSChau Ly * @return std::string - the returned logging string 338cebf476dSChau Ly */ 339cebf476dSChau Ly std::string dimmTrainingFailureToMsg(uint32_t failureInfo); 340cebf476dSChau Ly 3413de0d94eSChau Ly /** @brief Handle numeric sensor event message from PCIe hot-plug sensor. 3423de0d94eSChau Ly * 3433de0d94eSChau Ly * @param[in] tid - TID 3443de0d94eSChau Ly * @param[in] sensorId - Sensor ID 3453de0d94eSChau Ly * @param[in] presentReading - the present reading of the sensor 3463de0d94eSChau Ly */ 3473de0d94eSChau Ly void handlePCIeHotPlugEvent(pldm_tid_t tid, uint16_t sensorId, 3483de0d94eSChau Ly uint32_t presentReading); 3493de0d94eSChau Ly 350a743e384SChau Ly /** @brief Handle numeric sensor event message from boot overall sensor. 351a743e384SChau Ly * 352a743e384SChau Ly * @param[in] tid - TID 353a743e384SChau Ly * @param[in] sensorId - Sensor ID 354a743e384SChau Ly * @param[in] presentReading - the present reading of the sensor 355a743e384SChau Ly */ 356a743e384SChau Ly void handleBootOverallEvent(pldm_tid_t /*tid*/, uint16_t /*sensorId*/, 357a743e384SChau Ly uint32_t presentReading); 358a743e384SChau Ly 359cebf476dSChau Ly /** @brief Handle numeric sensor event message from DIMM status sensor. 360cebf476dSChau Ly * 361cebf476dSChau Ly * @param[in] tid - TID 362cebf476dSChau Ly * @param[in] sensorId - Sensor ID 363cebf476dSChau Ly * @param[in] presentReading - the present reading of the sensor 364cebf476dSChau Ly */ 365cebf476dSChau Ly void handleDIMMStatusEvent(pldm_tid_t tid, uint16_t sensorId, 366cebf476dSChau Ly uint32_t presentReading); 367cebf476dSChau Ly 368cebf476dSChau Ly /** @brief Handle numeric sensor event message from DDR status sensor. 369cebf476dSChau Ly * 370cebf476dSChau Ly * @param[in] tid - TID 371cebf476dSChau Ly * @param[in] sensorId - Sensor ID 372cebf476dSChau Ly * @param[in] presentReading - the present reading of the sensor 373cebf476dSChau Ly */ 374cebf476dSChau Ly void handleDDRStatusEvent(pldm_tid_t tid, uint16_t sensorId, 375cebf476dSChau Ly uint32_t presentReading); 376cebf476dSChau Ly 3774cca3dc9SChau Ly /** @brief Handle numeric sensor event message from VRD status sensor. 3784cca3dc9SChau Ly * 3794cca3dc9SChau Ly * @param[in] tid - TID 3804cca3dc9SChau Ly * @param[in] sensorId - Sensor ID 3814cca3dc9SChau Ly * @param[in] presentReading - the present reading of the sensor 3824cca3dc9SChau Ly */ 3834cca3dc9SChau Ly void handleVRDStatusEvent(pldm_tid_t tid, uint16_t sensorId, 3844cca3dc9SChau Ly uint32_t presentReading); 3854cca3dc9SChau Ly 386b01357fcSChau Ly /** @brief Handle numeric sensor event message from Watchdog status sensor. 387b01357fcSChau Ly * 388b01357fcSChau Ly * @param[in] tid - TID 389b01357fcSChau Ly * @param[in] sensorId - Sensor ID 390b01357fcSChau Ly * @param[in] presentReading - the present reading of the sensor 391b01357fcSChau Ly */ 392b01357fcSChau Ly void handleNumericWatchdogEvent(pldm_tid_t tid, uint16_t sensorId, 393b01357fcSChau Ly uint32_t presentReading); 394b01357fcSChau Ly 395a743e384SChau Ly /** @brief Handle numeric sensor event messages. 396a743e384SChau Ly * 397a743e384SChau Ly * @param[in] tid - TID 398a743e384SChau Ly * @param[in] sensorId - Sensor ID 399a743e384SChau Ly * @param[in] sensorData - the sensor data 400a743e384SChau Ly * @param[in] sensorDataLength - the length of sensor data 401a743e384SChau Ly * 402a743e384SChau Ly * @return int - returned error code 403a743e384SChau Ly */ 404a743e384SChau Ly int processNumericSensorEvent(pldm_tid_t tid, uint16_t sensorId, 405a743e384SChau Ly const uint8_t* sensorData, 406a743e384SChau Ly size_t sensorDataLength); 407a743e384SChau Ly 408a743e384SChau Ly /** @brief Handle state sensor event messages. 409a743e384SChau Ly * 410a743e384SChau Ly * @param[in] tid - TID 411a743e384SChau Ly * @param[in] sensorId - Sensor ID 412a743e384SChau Ly * @param[in] sensorData - the sensor data 413a743e384SChau Ly * @param[in] sensorDataLength - the length of sensor data 414a743e384SChau Ly * 415a743e384SChau Ly * @return int - returned error code 416a743e384SChau Ly */ 417a743e384SChau Ly int processStateSensorEvent(pldm_tid_t tid, uint16_t sensorId, 418a743e384SChau Ly const uint8_t* sensorData, 419a743e384SChau Ly size_t sensorDataLength); 420a743e384SChau Ly 421a743e384SChau Ly /** @brief Handle op state sensor event messages. 422a743e384SChau Ly * 423a743e384SChau Ly * @param[in] tid - TID 424a743e384SChau Ly * @param[in] sensorId - Sensor ID 425a743e384SChau Ly * @param[in] sensorData - the sensor data 426a743e384SChau Ly * @param[in] sensorDataLength - the length of sensor data 427a743e384SChau Ly * 428a743e384SChau Ly * @return int - returned error code 429a743e384SChau Ly */ 430a743e384SChau Ly int processSensorOpStateEvent(pldm_tid_t tid, uint16_t sensorId, 431a743e384SChau Ly const uint8_t* sensorData, 432a743e384SChau Ly size_t sensorDataLength); 433a743e384SChau Ly 434a743e384SChau Ly /** @brief reference of main event loop of pldmd, primarily used to schedule 435a743e384SChau Ly * work 436a743e384SChau Ly */ 437a743e384SChau Ly sdeventplus::Event& event; 4384a503837SDung Cao 4394a503837SDung Cao /** @brief Latest OEM PollForPlatformEvent message timeStamp. */ 4404a503837SDung Cao std::map<pldm_tid_t, uint64_t> timeStampMap; 4414a503837SDung Cao 4424a503837SDung Cao /** @brief A Manager interface for calling the hook functions */ 4434a503837SDung Cao platform_mc::Manager* manager; 444a743e384SChau Ly }; 445a743e384SChau Ly } // namespace oem_ampere 446a743e384SChau Ly } // namespace pldm 447