| /openbmc/pldm/libpldmresponder/ |
| H A D | pdr_numeric_effecter.hpp | 21 /** @brief Parse PDR JSON file and generate numeric effecter PDR structure 23 * @param[in] json - the JSON Object with the numeric effecter PDR 25 * @param[out] repo - pdr::RepoInterface 40 pldm_numeric_effecter_value_pdr* pdr = in generateNumericEffecterPDR() local 42 if (!pdr) in generateNumericEffecterPDR() 44 error("Failed to get numeric effecter PDR."); in generateNumericEffecterPDR() 47 pdr->hdr.record_handle = 0; in generateNumericEffecterPDR() 48 pdr->hdr.version = 1; in generateNumericEffecterPDR() 49 pdr->hdr.type = PLDM_NUMERIC_EFFECTER_PDR; in generateNumericEffecterPDR() 50 pdr->hdr.record_change_num = 0; in generateNumericEffecterPDR() [all …]
|
| H A D | pdr_state_sensor.hpp | 21 /** @brief Parse PDR JSON file and generate state sensor PDR structure 23 * @param[in] json - the JSON Object with the state sensor PDR 25 * @param[out] repo - pdr::RepoInterface 45 … "Malformed PDR JSON return pdrEntry; no state set info for state sensor pdr '{STATE_SENSOR_PDR}'", in generateStateSensorPDR() 57 pldm_state_sensor_pdr* pdr = in generateStateSensorPDR() local 59 if (!pdr) in generateStateSensorPDR() 61 error("Failed to get state sensor PDR."); in generateStateSensorPDR() 64 pdr->hdr.record_handle = 0; in generateStateSensorPDR() 65 pdr->hdr.version = 1; in generateStateSensorPDR() 66 pdr->hdr.type = PLDM_STATE_SENSOR_PDR; in generateStateSensorPDR() [all …]
|
| H A D | pdr_state_effecter.hpp | 3 #include "pdr.hpp" 22 /** @brief Parse PDR JSON file and generate state effecter PDR structure 24 * @param[in] json - the JSON Object with the state effecter PDR 26 * @param[out] repo - pdr::RepoInterface 46 …"Malformed PDR JSON return pdrEntry; no state set info for state effecter pdr '{STATE_EFFECTER_PDR… in generateStateEffecterPDR() 58 pldm_state_effecter_pdr* pdr = new (entry.data()) in generateStateEffecterPDR() local 60 if (!pdr) in generateStateEffecterPDR() 62 error("Failed to get state effecter PDR."); in generateStateEffecterPDR() 65 pdr->hdr.record_handle = 0; in generateStateEffecterPDR() 66 pdr->hdr.version = 1; in generateStateEffecterPDR() [all …]
|
| H A D | pdr_utils.hpp | 6 #include <libpldm/pdr.h> 32 /** @struct Type ID associated with pdr 58 * PDR entry structure that acts as a PDR record structure in the PDR 59 * repository to handle PDR APIs. 84 /** @brief Parse PDR JSON file and output Json object 86 * @param[in] path - path of PDR JSON file 101 error("Error opening PDR JSON file at '{PATH}'", "PATH", path); in readJson() 109 * value for the effecter PDR enumeration attribute. 113 * @param[in] pv - Possible values for the effecter PDR enumeration attribute 123 * @brief Abstract class describing the interface API to the PDR repository, [all …]
|
| H A D | platform_numeric_effecter.hpp | 4 #include "libpldmresponder/pdr.hpp" 26 /** @brief Function to get the effecter value by PDR factor coefficient, etc. 27 * @param[in] pdr - The structure of pldm_numeric_effecter_value_pdr. 36 const pldm_numeric_effecter_value_pdr* pdr, T& effecterValue, in getEffecterRawValue() argument 43 switch (pdr->effecter_data_size) in getEffecterRawValue() 48 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue() 49 if (pdr->min_settable.value_u8 < pdr->max_settable.value_u8 && in getEffecterRawValue() 50 (rawValue < pdr->min_settable.value_u8 || in getEffecterRawValue() 51 rawValue > pdr->max_settable.value_u8)) in getEffecterRawValue() 71 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue() [all …]
|
| H A D | pdr.hpp | 14 namespace pdr namespace 17 /** @brief Build (if not built already) and retrieve PDR by the PDR types 19 * @param[in] dir - directory housing platform specific PDR JSON files 22 * @return Repo - Instance of pdr::Repo 28 /** @brief Get the record of PDR by the record handle 30 * @param[in] pdrRepo - pdr::RepoInterface 31 * @param[in] recordHandle - The recordHandle value for the PDR to be 33 * @param[out] pdrEntry - PDR entry structure reference 35 * @return pldm_pdr_record - Instance of pdr::RepoInterface 42 } // namespace pdr
|
| H A D | platform.cpp | 6 #include "pdr.hpp" 25 using namespace pldm::responder::pdr; 80 // A map of PDR type to a lambda that handles creation of that PDR type. in generate() 81 // The lambda essentially would parse the platform specific PDR JSONs to in generate() 82 // generate the PDR structures. This function iterates through the map to in generate() 83 // invoke all lambdas, so that all PDR types can be created. in generate() 140 … "PDR config directory '{PATH}' does not exist or empty for '{TYPE}' pdr, error - {ERROR}", in generate() 146 "Failed to parse PDR JSON file for '{TYPE}' pdr, error - {ERROR}", in generate() 154 "Failed to parse PDR JSON file for '{TYPE}' pdr, error - {ERROR}", in generate() 174 // Build FRU table if not built, since entity association PDR's in getPDR() [all …]
|
| /openbmc/pldm/oem/ibm/test/ |
| H A D | libpldmresponder_oem_platform_test.cpp | 6 #include "libpldmresponder/pdr.hpp" 17 #include <libpldm/pdr.h> 28 using namespace pldm::responder::pdr; 251 auto record1 = pdr::getRecordByHandle(inRepo, 1, e); in TEST() 254 pldm_state_effecter_pdr* pdr = in TEST() local 257 ASSERT_EQ(pdr->hdr.record_handle, 1); in TEST() 258 ASSERT_EQ(pdr->hdr.version, 1); in TEST() 259 ASSERT_EQ(pdr->hdr.type, PLDM_STATE_EFFECTER_PDR); in TEST() 260 ASSERT_EQ(pdr->hdr.record_change_num, 0); in TEST() 261 ASSERT_EQ(pdr->hdr.length, 16); in TEST() [all …]
|
| /openbmc/pldm/libpldmresponder/test/ |
| H A D | libpldmresponder_pdr_effecter_test.cpp | 14 using namespace pldm::responder::pdr; 42 // Check first PDR in TEST() 44 auto record2 = pdr::getRecordByHandle(outRepo, 2, e); in TEST() 46 pldm_state_effecter_pdr* pdr = new (e.data) pldm_state_effecter_pdr; in TEST() local 48 ASSERT_EQ(pdr->hdr.record_handle, 2); in TEST() 49 ASSERT_EQ(pdr->hdr.version, 1); in TEST() 50 ASSERT_EQ(pdr->hdr.type, PLDM_STATE_EFFECTER_PDR); in TEST() 51 ASSERT_EQ(pdr->hdr.record_change_num, 0); in TEST() 52 ASSERT_EQ(pdr->hdr.length, 23); in TEST() 54 ASSERT_EQ(pdr->terminus_handle, TERMINUS_HANDLE); in TEST() [all …]
|
| H A D | libpldmresponder_pdr_sensor_test.cpp | 14 using namespace pldm::responder::pdr; 47 // Check first PDR in TEST() 49 auto record = pdr::getRecordByHandle(outRepo, 2, e); in TEST() 52 pldm_state_sensor_pdr* pdr = new (e.data) pldm_state_sensor_pdr; in TEST() local 53 EXPECT_EQ(pdr->hdr.record_handle, 2); in TEST() 54 EXPECT_EQ(pdr->hdr.version, 1); in TEST() 55 EXPECT_EQ(pdr->hdr.type, PLDM_STATE_SENSOR_PDR); in TEST() 56 EXPECT_EQ(pdr->hdr.record_change_num, 0); in TEST() 57 EXPECT_EQ(pdr->hdr.length, 17); in TEST() 59 EXPECT_EQ(pdr->sensor_id, 1); in TEST() [all …]
|
| /openbmc/pldm/pldmtool/ |
| H A D | pldm_platform_cmd.cpp | 154 …"Retrieve individual PDR, all PDRs, PDRs of a requested type or retrieve all PDRs of the requested… in GetPDR() 157 "retrieve individual PDRs from a PDR Repository\n" in GetPDR() 158 "eg: The recordHandle value for the PDR to be retrieved and 0 " in GetPDR() 159 "means get first PDR in the repository."); in GetPDR() 181 "retrieve all PDRs from a PDR repository"); in GetPDR() 239 // Retrieve all PDR records starting from the first in exec() 367 const std::map<pldm::pdr::EntityType, std::string> entityType = { 594 {PLDM_TERMINUS_LOCATOR_PDR, "Terminus Locator PDR"}, 595 {PLDM_NUMERIC_SENSOR_PDR, "Numeric Sensor PDR"}, 597 "Numeric Sensor Initialization PDR"}, [all …]
|
| /openbmc/pldm/docs/ |
| H A D | pdr_implementation.md | 1 # PDR Implementation 5 PDR information is encoded in platform specific JSON files. JSON files must be 6 named based on the PDR type number. For example a state effecter PDR JSON file 8 additional processing (apart from PDR creation) for specific PDR types, for eg 11 The PLDM responder implementation finds and parses PDR JSON files to create the 12 PDR repository. Platform specific PDR modifications would likely just result in 13 JSON updates. New PDR type support would require JSON updates as well as PDR 14 generation code. The PDR generator is a map of PDR Type -> C++ lambda to create 15 PDR entries for that type based on the JSON, and to update the central PDR repo.
|
| /openbmc/pldm/pldmd/ |
| H A D | dbus_impl_pdr.hpp | 3 #include "xyz/openbmc_project/PLDM/PDR/server.hpp" 5 #include <libpldm/pdr.h> 19 sdbusplus::xyz::openbmc_project::PLDM::server::PDR>; 21 /** @class Pdr 22 * @brief OpenBMC PLDM.PDR Implementation 24 * xyz.openbmc_project.PLDM.PDR DBus APIs. 26 class Pdr : public PdrIntf class 29 Pdr() = delete; 30 Pdr(const Pdr&) = delete; 31 Pdr& operator=(const Pdr&) = delete; [all …]
|
| /openbmc/libpldm/include/libpldm/ |
| H A D | pdr.h | 14 * opaque structure that acts as a handle to a PDR repository 19 * opaque structure that acts as a handle to a PDR record 24 /* Common PDR access APIs */ 27 /** @brief Make a new PDR repository 38 /** @brief Destroy a PDR repository (and free up associated resources) 40 * @param[in/out] repo - pointer to opaque pointer acting as a PDR repo handle 44 /** @brief Get number of records in a PDR repository 48 * @param[in] repo - opaque pointer acting as a PDR repo handle 54 /** @brief Get size of a PDR repository, in bytes 58 * @param[in] repo - opaque pointer acting as a PDR repo handle [all …]
|
| /openbmc/pldm/oem/ibm/libpldmresponder/ |
| H A D | oem_ibm_handler.cpp | 18 using namespace pldm::pdr; 29 pldm::pdr::EntityType entityType, EntityInstance entityInstance, in getOemStateSensorReadingsHandler() 211 pldm_state_effecter_pdr* pdr = in buildAllCodeUpdateEffecterPDR() local 213 if (!pdr) in buildAllCodeUpdateEffecterPDR() 215 error("Failed to get record by PDR type, error - {ERROR}", "ERROR", in buildAllCodeUpdateEffecterPDR() 220 pdr->hdr.record_handle = 0; in buildAllCodeUpdateEffecterPDR() 221 pdr->hdr.version = 1; in buildAllCodeUpdateEffecterPDR() 222 pdr->hdr.type = PLDM_STATE_EFFECTER_PDR; in buildAllCodeUpdateEffecterPDR() 223 pdr->hdr.record_change_num = 0; in buildAllCodeUpdateEffecterPDR() 224 pdr->hdr.length = sizeof(pldm_state_effecter_pdr) - sizeof(pldm_pdr_hdr); in buildAllCodeUpdateEffecterPDR() [all …]
|
| /openbmc/libpldm/ |
| H A D | CHANGELOG.md | 22 - platform: Added file descriptor PDR encoding support 148 - pdr: Add pldm_pdr_delete_by_effecter_id() API 151 - pdr: Add pldm_pdr_delete_by_sensor_id() API 152 - pdr: Add pldm_entity_association_tree_delete_node() API 171 - pdr: Stabilize pldm_pdr_delete_by_record_handle() 224 - pdr: Add pldm_pdr_delete_by_record_handle() API 227 - pdr: Add pldm_file_descriptor_pdr struct 266 - pdr: Indicates success or failure depending on the outcome of the entity 267 association PDR creation 281 - pdr: Remove PDR if the contained entity to be removed is the last one [all …]
|
| /openbmc/pldm/tools/visualize-pdr/ |
| H A D | pldm_visualise_pdrs.py | 3 """Tool to visualize PLDM PDR's""" 119 """This function is responsible to parse the state sensor pdr 120 and the state effecter pdr dictionaries and creating the 169 def draw_entity_associations(pdr, counter): argument 172 PDR's received from the BMC. 175 pdr: list of entity association PDR's 176 counter: variable to capture the count of PDR's to unflatten 192 for value in pdr.values(): 314 """Using pldmtool, generate (record handle, PDR) tuples for each record in 315 the PDR repository. [all …]
|
| /openbmc/pldm/platform-mc/ |
| H A D | terminus.cpp | 68 * terminus. The entity auxiliary name PDR of that terminus with the in findTerminusName() 123 for (auto& pdr : pdrs) in parseTerminusPDRs() local 125 auto pdrHdr = new (pdr.data()) pldm_pdr_hdr; in parseTerminusPDRs() 130 auto sensorAuxNames = parseSensorAuxiliaryNamesPDR(pdr); in parseTerminusPDRs() 134 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 144 auto parsedPdr = parseNumericSensorPDR(pdr); in parseTerminusPDRs() 148 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 158 auto parsedPdr = parseCompactNumericSensorPDR(pdr); in parseTerminusPDRs() 162 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 167 auto sensorAuxNames = parseCompactNumericSensorNames(pdr); in parseTerminusPDRs() [all …]
|
| H A D | numeric_sensor.cpp | 173 std::shared_ptr<pldm_numeric_sensor_value_pdr> pdr, std::string& sensorName, in NumericSensor() argument 176 if (!pdr) in NumericSensor() 181 sensorId = pdr->sensor_id; in NumericSensor() 184 setSensorUnit(pdr->base_unit); in NumericSensor() 227 getSensorDataValue(pdr->sensor_data_size, pdr->max_readable); in NumericSensor() 229 getSensorDataValue(pdr->sensor_data_size, pdr->min_readable); in NumericSensor() 230 hysteresis = getSensorDataValue(pdr->sensor_data_size, pdr->hysteresis); in NumericSensor() 242 if (pdr->supported_thresholds.bits.bit0) in NumericSensor() 246 getRangeFieldValue(pdr->range_field_format, pdr->warning_high); in NumericSensor() 249 if (pdr->supported_thresholds.bits.bit3) in NumericSensor() [all …]
|
| /openbmc/pldm/host-bmc/ |
| H A D | host_pdr_handler.hpp | 26 // vector which would hold the PDR record handle data returned by 34 * PlatformEventMessage command to a host sensor PDR. This struct is a key 39 pdr::TerminusID terminusID; 40 pdr::SensorID sensorID; 54 using HostStateSensorMap = std::map<SensorEntry, pdr::SensorInfo>; 60 * receiving the PDRs, they are stored into the BMC's primary PDR repo. 77 std::tuple<pdr::TerminusID, pdr::EID, pdr::TerminusValidity>; 78 using TLPDRMap = std::map<pdr [all...] |
| H A D | host_pdr_handler.cpp | 38 uint16_t extractTerminusHandle(std::vector<uint8_t>& pdr) in extractTerminusHandle() argument 43 var = (T*)(pdr.data() + sizeof(pldm_pdr_hdr)); in extractTerminusHandle() 47 var = (T*)(pdr.data()); in extractTerminusHandle() 58 std::vector<uint8_t>& pdr) in updateContainerId() argument 67 t = (T*)(pdr.data() + sizeof(pldm_pdr_hdr)); in updateContainerId() 71 t = (T*)(pdr.data()); in updateContainerId() 220 error("Failed to encode get pdr request, response code '{RC}'", "RC", in getHostPDR() 240 pdr::EventState state) in handleStateSensorEvent() 253 const std::vector<uint8_t>& pdr, [[maybe_unused]] const uint32_t& size, in mergeEntityAssociations() argument 259 auto entityPdr = new (const_cast<uint8_t*>(pdr.data()) + in mergeEntityAssociations() [all …]
|
| /openbmc/phosphor-dbus-interfaces/yaml/xyz/openbmc_project/PLDM/ |
| H A D | PDR.interface.yaml | 8 An implementation of this interface should maintain the primary PDR 11 A OpenBMC implementation should implement the xyz.openbmc_project.PLDM.PDR 14 More information about PDR can be found at DSP0248 version 1.2.0 section 25. 19 Obtain the state effecter PDR, for the input TID, entity ID and state 22 effecter PDRs are returned. More than one PDR can be returned for the 25 When the PDR for the given input TID, entity id and state set id is 59 Array of State Effecter PDRs, where a PDR is an array[byte]. 70 Obtain the state sensor PDR, for the input TID, entity ID and state 73 PDRs are returned. More than one PDR can be returned for the same 76 When the PDR for the given input TID, entity id and state set id is [all …]
|
| /openbmc/pldm/common/test/ |
| H A D | pldm_utils_test.cpp | 182 std::vector<uint8_t> pdr( in TEST() local 186 auto rec = new (pdr.data()) pldm_state_effecter_pdr; in TEST() 199 ASSERT_EQ(pldm_pdr_add(repo, pdr.data(), pdr.size(), false, 1, &handle), 0); in TEST() 203 EXPECT_EQ(pdr, record[0]); in TEST() 215 std::vector<uint8_t> pdr( in TEST() local 219 auto rec = new (pdr.data()) pldm_state_effecter_pdr; in TEST() 232 ASSERT_EQ(pldm_pdr_add(repo, pdr.data(), pdr.size(), false, 1, &handle), 0); in TEST() 248 std::vector<uint8_t> pdr( in TEST() local 264 std::vector<uint8_t> pdr( in TEST() local 268 auto rec = new (pdr.data()) pldm_state_effecter_pdr; in TEST() [all …]
|
| /openbmc/pldm/softoff/ |
| H A D | softoff.cpp | 39 pldm::pdr::TerminusID TID = 0; 65 pldm::pdr::EntityType entityType = entry.value("entityType", 0); in SoftPowerOff() 66 pldm::pdr::StateSetId stateSetId = entry.value("stateSetId", 0); in SoftPowerOff() 131 pldm::pdr::TerminusID msgTID; in hostSoftOffComplete() 132 pldm::pdr::SensorID msgSensorID; in hostSoftOffComplete() 133 pldm::pdr::SensorOffset msgSensorOffset; in hostSoftOffComplete() 134 pldm::pdr::EventState msgEventState; in hostSoftOffComplete() 135 pldm::pdr::EventState msgPreviousEventState; in hostSoftOffComplete() 175 bool SoftPowerOff::getEffecterID(pldm::pdr::EntityType& entityType, in getEffecterID() 176 pldm::pdr::StateSetId& stateSetId) in getEffecterID() [all …]
|
| H A D | softoff.hpp | 108 * hosting softoff PDR 109 * @param[in] stateSetId - state set ID of the softoff PDR 113 bool getEffecterID(pldm::pdr::EntityType& entityType, 114 pldm::pdr::StateSetId& stateSetId); 119 * hosting softoff PDR 120 * @param[in] stateSetId - state set ID of the softoff PDR 124 int getSensorInfo(pldm::pdr::EntityType& entityType, 125 pldm::pdr::StateSetId& stateSetId); 133 pldm::pdr::SensorID sensorID; 137 pldm::pdr::SensorOffset sensorOffset;
|