Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 1 | #pragma once |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 2 | |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 3 | #include "inband_code_update.hpp" |
| 4 | #include "libpldmresponder/oem_handler.hpp" |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 5 | #include "libpldmresponder/pdr_utils.hpp" |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 6 | #include "libpldmresponder/platform.hpp" |
Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 7 | #include "requester/handler.hpp" |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 8 | |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 9 | #include <libpldm/entity.h> |
Andrew Jeffery | 21f128d | 2024-01-15 15:34:26 +1030 | [diff] [blame] | 10 | #include <libpldm/oem/ibm/state_set.h> |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 11 | #include <libpldm/platform.h> |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 12 | |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 13 | #include <sdbusplus/bus/match.hpp> |
| 14 | #include <sdeventplus/event.hpp> |
| 15 | #include <sdeventplus/utility/timer.hpp> |
| 16 | |
Christian Geddes | 7f9523c | 2021-08-03 13:44:38 -0500 | [diff] [blame] | 17 | typedef ibm_oem_pldm_state_set_firmware_update_state_values CodeUpdateState; |
| 18 | |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 19 | namespace pldm |
| 20 | { |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 21 | namespace responder |
| 22 | { |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 23 | namespace oem_ibm_platform |
| 24 | { |
Sagar Srinivas | 78a225a | 2020-08-27 00:52:20 -0500 | [diff] [blame] | 25 | constexpr uint16_t ENTITY_INSTANCE_0 = 0; |
| 26 | constexpr uint16_t ENTITY_INSTANCE_1 = 1; |
| 27 | |
Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 28 | constexpr uint32_t BMC_PDR_START_RANGE = 0x00000000; |
| 29 | constexpr uint32_t BMC_PDR_END_RANGE = 0x00FFFFFF; |
| 30 | constexpr uint32_t HOST_PDR_START_RANGE = 0x01000000; |
| 31 | constexpr uint32_t HOST_PDR_END_RANGE = 0x01FFFFFF; |
| 32 | |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 33 | const pldm::pdr::TerminusID HYPERVISOR_TID = 208; |
| 34 | |
| 35 | static constexpr uint8_t HEARTBEAT_TIMEOUT_DELTA = 10; |
| 36 | |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 37 | enum SetEventReceiverCount |
| 38 | { |
| 39 | SET_EVENT_RECEIVER_SENT = 0x2, |
| 40 | }; |
| 41 | |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 42 | class Handler : public oem_platform::Handler |
| 43 | { |
| 44 | public: |
| 45 | Handler(const pldm::utils::DBusHandler* dBusIntf, |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 46 | pldm::responder::CodeUpdate* codeUpdate, int mctp_fd, |
Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 47 | uint8_t mctp_eid, pldm::InstanceIdDb& instanceIdDb, |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 48 | sdeventplus::Event& event, |
Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 49 | pldm::requester::Handler<pldm::requester::Request>* handler) : |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 50 | oem_platform::Handler(dBusIntf), codeUpdate(codeUpdate), |
| 51 | platformHandler(nullptr), mctp_fd(mctp_fd), mctp_eid(mctp_eid), |
| 52 | instanceIdDb(instanceIdDb), event(event), handler(handler), |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 53 | timer(event, std::bind(std::mem_fn(&Handler::setSurvTimer), this, |
| 54 | HYPERVISOR_TID, false)), |
| 55 | hostTransitioningToOff(true) |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 56 | { |
| 57 | codeUpdate->setVersions(); |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 58 | setEventReceiverCnt = 0; |
| 59 | |
| 60 | using namespace sdbusplus::bus::match::rules; |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 61 | hostOffMatch = std::make_unique<sdbusplus::bus::match_t>( |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 62 | pldm::utils::DBusHandler::getBus(), |
| 63 | propertiesChanged("/xyz/openbmc_project/state/host0", |
| 64 | "xyz.openbmc_project.State.Host"), |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 65 | [this](sdbusplus::message_t& msg) { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 66 | pldm::utils::DbusChangedProps props{}; |
| 67 | std::string intf; |
| 68 | msg.read(intf, props); |
| 69 | const auto itr = props.find("CurrentHostState"); |
| 70 | if (itr != props.end()) |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 71 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 72 | pldm::utils::PropertyValue value = itr->second; |
| 73 | auto propVal = std::get<std::string>(value); |
| 74 | if (propVal == |
| 75 | "xyz.openbmc_project.State.Host.HostState.Off") |
| 76 | { |
| 77 | hostOff = true; |
| 78 | setEventReceiverCnt = 0; |
| 79 | disableWatchDogTimer(); |
| 80 | startStopTimer(false); |
| 81 | } |
| 82 | else if (propVal == |
| 83 | "xyz.openbmc_project.State.Host.HostState.Running") |
| 84 | { |
| 85 | hostOff = false; |
| 86 | hostTransitioningToOff = false; |
| 87 | } |
| 88 | else if ( |
| 89 | propVal == |
| 90 | "xyz.openbmc_project.State.Host.HostState.TransitioningToOff") |
| 91 | { |
| 92 | hostTransitioningToOff = true; |
| 93 | } |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 94 | } |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 95 | }); |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 96 | |
Patrick Williams | 4f152f9 | 2024-06-18 02:38:34 -0500 | [diff] [blame] | 97 | powerStateOffMatch = std::make_unique<sdbusplus::bus::match_t>( |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 98 | pldm::utils::DBusHandler::getBus(), |
| 99 | propertiesChanged("/xyz/openbmc_project/state/chassis0", |
| 100 | "xyz.openbmc_project.State.Chassis"), |
Andrew Jeffery | a933c09 | 2024-07-25 20:51:47 +0930 | [diff] [blame] | 101 | [](sdbusplus::message_t& msg) { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 102 | pldm::utils::DbusChangedProps props{}; |
| 103 | std::string intf; |
| 104 | msg.read(intf, props); |
| 105 | const auto itr = props.find("CurrentPowerState"); |
| 106 | if (itr != props.end()) |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 107 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 108 | pldm::utils::PropertyValue value = itr->second; |
| 109 | auto propVal = std::get<std::string>(value); |
| 110 | if (propVal == |
| 111 | "xyz.openbmc_project.State.Chassis.PowerState.Off") |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 112 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 113 | static constexpr auto searchpath = |
| 114 | "/xyz/openbmc_project/inventory/system/chassis/motherboard"; |
| 115 | int depth = 0; |
| 116 | std::vector<std::string> powerInterface = { |
| 117 | "xyz.openbmc_project.State.Decorator.PowerState"}; |
| 118 | pldm::utils::GetSubTreeResponse response = |
| 119 | pldm::utils::DBusHandler().getSubtree( |
| 120 | searchpath, depth, powerInterface); |
| 121 | for (const auto& [objPath, serviceMap] : response) |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 122 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 123 | pldm::utils::DBusMapping dbusMapping{ |
| 124 | objPath, |
| 125 | "xyz.openbmc_project.State.Decorator.PowerState", |
| 126 | "PowerState", "string"}; |
| 127 | value = |
| 128 | "xyz.openbmc_project.State.Decorator.PowerState.State.Off"; |
| 129 | try |
| 130 | { |
| 131 | pldm::utils::DBusHandler().setDbusProperty( |
| 132 | dbusMapping, value); |
| 133 | } |
| 134 | catch (const std::exception& e) |
| 135 | { |
| 136 | error( |
| 137 | "Unable to set the slot power state to Off error - {ERROR}", |
| 138 | "ERROR", e); |
| 139 | } |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | } |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame^] | 143 | }); |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | int getOemStateSensorReadingsHandler( |
Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 147 | pldm::pdr::EntityType entityType, |
| 148 | pldm::pdr::EntityInstance entityInstance, |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 149 | pldm::pdr::StateSetId stateSetId, |
| 150 | pldm::pdr::CompositeCount compSensorCnt, |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 151 | std::vector<get_sensor_state_field>& stateField); |
| 152 | |
Sampa Misra | 3a0e3b9 | 2020-10-21 05:58:00 -0500 | [diff] [blame] | 153 | int oemSetStateEffecterStatesHandler( |
Varsha Kaverappa | 3fbd39e | 2020-09-28 01:40:22 -0500 | [diff] [blame] | 154 | uint16_t entityType, uint16_t entityInstance, uint16_t stateSetId, |
| 155 | uint8_t compEffecterCnt, |
| 156 | std::vector<set_effecter_state_field>& stateField, uint16_t effecterId); |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 157 | |
| 158 | /** @brief Method to set the platform handler in the |
| 159 | * oem_ibm_handler class |
| 160 | * @param[in] handler - pointer to PLDM platform handler |
| 161 | */ |
| 162 | void setPlatformHandler(pldm::responder::platform::Handler* handler); |
| 163 | |
Sagar Srinivas | 78a225a | 2020-08-27 00:52:20 -0500 | [diff] [blame] | 164 | /** @brief Method to fetch the effecter ID of the code update PDRs |
| 165 | * |
| 166 | * @return platformHandler->getNextEffecterId() - returns the |
| 167 | * effecter ID from the platform handler |
| 168 | */ |
Manojkiran Eda | 6b1d883 | 2021-03-27 11:25:06 +0530 | [diff] [blame] | 169 | virtual uint16_t getNextEffecterId() |
Sagar Srinivas | 78a225a | 2020-08-27 00:52:20 -0500 | [diff] [blame] | 170 | { |
| 171 | return platformHandler->getNextEffecterId(); |
| 172 | } |
| 173 | |
| 174 | /** @brief Method to fetch the sensor ID of the code update PDRs |
| 175 | * |
| 176 | * @return platformHandler->getNextSensorId() - returns the |
| 177 | * Sensor ID from the platform handler |
| 178 | */ |
Manojkiran Eda | 6b1d883 | 2021-03-27 11:25:06 +0530 | [diff] [blame] | 179 | virtual uint16_t getNextSensorId() |
Sagar Srinivas | 78a225a | 2020-08-27 00:52:20 -0500 | [diff] [blame] | 180 | { |
| 181 | return platformHandler->getNextSensorId(); |
| 182 | } |
| 183 | |
| 184 | /** @brief Method to Generate the OEM PDRs |
| 185 | * |
| 186 | * @param[in] repo - instance of concrete implementation of Repo |
| 187 | */ |
| 188 | void buildOEMPDR(pdr_utils::Repo& repo); |
| 189 | |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 190 | /** @brief Method to send code update event to host |
| 191 | * @param[in] sensorId - sendor ID |
| 192 | * @param[in] sensorEventClass - event class of sensor |
| 193 | * @param[in] sensorOffset - sensor offset |
| 194 | * @param[in] eventState - new code update event state |
| 195 | * @param[in] prevEventState - previous code update event state |
| 196 | * @return none |
| 197 | */ |
| 198 | void sendStateSensorEvent(uint16_t sensorId, |
| 199 | enum sensor_event_class_states sensorEventClass, |
| 200 | uint8_t sensorOffset, uint8_t eventState, |
| 201 | uint8_t prevEventState); |
| 202 | |
| 203 | /** @brief Method to send encoded request msg of code update event to host |
| 204 | * @param[in] requestMsg - encoded request msg |
Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 205 | * @param[in] instanceId - instance id of the message |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 206 | * @return PLDM status code |
| 207 | */ |
Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 208 | int sendEventToHost(std::vector<uint8_t>& requestMsg, uint8_t instanceId); |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 209 | |
Sampa Misra | 3a0e3b9 | 2020-10-21 05:58:00 -0500 | [diff] [blame] | 210 | /** @brief _processEndUpdate processes the actual work that needs |
| 211 | * to be carried out after EndUpdate effecter is set. This is done async |
| 212 | * after sending response for EndUpdate set effecter |
| 213 | * @param[in] source - sdeventplus event source |
| 214 | */ |
| 215 | void _processEndUpdate(sdeventplus::source::EventBase& source); |
| 216 | |
| 217 | /** @brief _processStartUpdate processes the actual work that needs |
| 218 | * to be carried out after StartUpdate effecter is set. This is done async |
| 219 | * after sending response for StartUpdate set effecter |
| 220 | * @param[in] source - sdeventplus event source |
| 221 | */ |
| 222 | void _processStartUpdate(sdeventplus::source::EventBase& source); |
| 223 | |
Sagar Srinivas | 9a64b4a | 2021-02-09 07:55:38 -0600 | [diff] [blame] | 224 | /** @brief _processSystemReboot processes the actual work that needs to be |
| 225 | * carried out after the System Power State effecter is set to reboot |
| 226 | * the system |
| 227 | * @param[in] source - sdeventplus event source |
| 228 | */ |
| 229 | void _processSystemReboot(sdeventplus::source::EventBase& source); |
| 230 | |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 231 | /*keeps track how many times setEventReceiver is sent */ |
| 232 | void countSetEventReceiver() |
| 233 | { |
| 234 | setEventReceiverCnt++; |
| 235 | } |
| 236 | |
| 237 | /* disables watchdog if running and Host is up */ |
| 238 | void checkAndDisableWatchDog(); |
| 239 | |
Sagar Srinivas | 79669c9 | 2021-04-28 15:43:30 -0500 | [diff] [blame] | 240 | /** @brief To check if the watchdog app is running |
| 241 | * |
| 242 | * @return the running status of watchdog app |
| 243 | */ |
| 244 | bool watchDogRunning(); |
| 245 | |
| 246 | /** @brief Method to reset the Watchdog timer on receiving platform Event |
| 247 | * Message for heartbeat elapsed time from Hostboot |
| 248 | */ |
| 249 | void resetWatchDogTimer(); |
| 250 | |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 251 | /** @brief To disable to the watchdog timer on host poweron completion*/ |
| 252 | void disableWatchDogTimer(); |
| 253 | |
Pavithra Barithaya | 99854a7 | 2021-09-29 06:58:11 -0500 | [diff] [blame] | 254 | /** @brief to check the BMC state*/ |
| 255 | int checkBMCState(); |
| 256 | |
Kamalkumar Patel | 15ce5a1 | 2024-05-07 11:45:11 -0500 | [diff] [blame] | 257 | /** @brief update the dbus object paths */ |
| 258 | void updateOemDbusPaths(std::string& dbusPath); |
| 259 | |
Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 260 | /** @brief Method to fetch the last BMC record from the PDR repo |
| 261 | * |
| 262 | * @param[in] repo - pointer to BMC's primary PDR repo |
| 263 | * |
| 264 | * @return the last BMC record from the repo |
| 265 | */ |
| 266 | const pldm_pdr_record* fetchLastBMCRecord(const pldm_pdr* repo); |
| 267 | |
| 268 | /** @brief Method to check if the record handle passed is in remote PDR |
| 269 | * record handle range |
| 270 | * |
| 271 | * @param[in] record_handle - record handle of the PDR |
| 272 | * |
| 273 | * @return true if record handle passed is in host PDR record handle range |
| 274 | */ |
| 275 | bool checkRecordHandleInRange(const uint32_t& record_handle); |
| 276 | |
Sagar Srinivas | 90314a3 | 2023-10-17 10:38:03 -0500 | [diff] [blame] | 277 | /** *brief Method to call the setEventReceiver command*/ |
| 278 | void processSetEventReceiver(); |
| 279 | |
| 280 | /** @brief Method to call the setEventReceiver through the platform |
| 281 | * handler |
| 282 | */ |
| 283 | virtual void setEventReceiver() |
| 284 | { |
| 285 | platformHandler->setEventReceiver(); |
| 286 | } |
| 287 | |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 288 | /** @brief Method to Enable/Disable timer to see if remote terminus sends |
| 289 | * the surveillance ping and logs informational error if remote terminus |
| 290 | * fails to send the surveillance pings |
| 291 | * |
| 292 | * @param[in] tid - TID of the remote terminus |
| 293 | * @param[in] value - true or false, to indicate if the timer is |
| 294 | * running or not |
| 295 | */ |
| 296 | void setSurvTimer(uint8_t tid, bool value); |
| 297 | |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 298 | ~Handler() = default; |
| 299 | |
| 300 | pldm::responder::CodeUpdate* codeUpdate; //!< pointer to CodeUpdate object |
| 301 | pldm::responder::platform::Handler* |
| 302 | platformHandler; //!< pointer to PLDM platform handler |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 303 | |
| 304 | /** @brief fd of MCTP communications socket */ |
| 305 | int mctp_fd; |
| 306 | |
| 307 | /** @brief MCTP EID of host firmware */ |
| 308 | uint8_t mctp_eid; |
| 309 | |
Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 310 | /** @brief reference to an InstanceIdDb object, used to obtain a PLDM |
| 311 | * instance id. */ |
| 312 | pldm::InstanceIdDb& instanceIdDb; |
Sampa Misra | 3a0e3b9 | 2020-10-21 05:58:00 -0500 | [diff] [blame] | 313 | /** @brief sdeventplus event source */ |
| 314 | std::unique_ptr<sdeventplus::source::Defer> assembleImageEvent; |
| 315 | std::unique_ptr<sdeventplus::source::Defer> startUpdateEvent; |
Sagar Srinivas | 9a64b4a | 2021-02-09 07:55:38 -0600 | [diff] [blame] | 316 | std::unique_ptr<sdeventplus::source::Defer> systemRebootEvent; |
Sampa Misra | 3a0e3b9 | 2020-10-21 05:58:00 -0500 | [diff] [blame] | 317 | |
| 318 | /** @brief reference of main event loop of pldmd, primarily used to schedule |
| 319 | * work |
| 320 | */ |
| 321 | sdeventplus::Event& event; |
Sagar Srinivas | 9a64b4a | 2021-02-09 07:55:38 -0600 | [diff] [blame] | 322 | |
| 323 | private: |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 324 | /** @brief Method to reset or stop the surveillance timer |
| 325 | * |
| 326 | * @param[in] value - true or false, to indicate if the timer |
| 327 | * should be reset or turned off |
| 328 | */ |
| 329 | void startStopTimer(bool value); |
| 330 | |
Sagar Srinivas | 9a64b4a | 2021-02-09 07:55:38 -0600 | [diff] [blame] | 331 | /** @brief D-Bus property changed signal match for CurrentPowerState*/ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 332 | std::unique_ptr<sdbusplus::bus::match_t> chassisOffMatch; |
Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 333 | |
| 334 | /** @brief PLDM request handler */ |
| 335 | pldm::requester::Handler<pldm::requester::Request>* handler; |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 336 | |
| 337 | /** @brief D-Bus property changed signal match */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 338 | std::unique_ptr<sdbusplus::bus::match_t> hostOffMatch; |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 339 | |
Pavithra Barithaya | 0fd6a09 | 2024-05-31 08:24:27 -0500 | [diff] [blame] | 340 | /** @brief D-Bus property changed signal match */ |
| 341 | std::unique_ptr<sdbusplus::bus::match_t> powerStateOffMatch; |
| 342 | |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 343 | /** @brief Timer used for monitoring surveillance pings from host */ |
| 344 | sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer; |
| 345 | |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 346 | bool hostOff = true; |
| 347 | |
Sagar Srinivas | 18145f7 | 2022-04-11 07:38:26 -0500 | [diff] [blame] | 348 | bool hostTransitioningToOff; |
| 349 | |
Sagar Srinivas | 7f760b3 | 2021-05-12 07:46:56 -0500 | [diff] [blame] | 350 | int setEventReceiverCnt = 0; |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 351 | }; |
| 352 | |
Varsha Kaverappa | bb585b2 | 2020-09-10 06:15:42 -0500 | [diff] [blame] | 353 | /** @brief Method to encode code update event msg |
| 354 | * @param[in] eventType - type of event |
| 355 | * @param[in] eventDataVec - vector of event data to be sent to host |
| 356 | * @param[in/out] requestMsg - request msg to be encoded |
| 357 | * @param[in] instanceId - instance ID |
| 358 | * @return PLDM status code |
| 359 | */ |
| 360 | int encodeEventMsg(uint8_t eventType, const std::vector<uint8_t>& eventDataVec, |
| 361 | std::vector<uint8_t>& requestMsg, uint8_t instanceId); |
| 362 | |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 363 | } // namespace oem_ibm_platform |
| 364 | |
| 365 | } // namespace responder |
| 366 | |
| 367 | } // namespace pldm |