/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 = 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 getEffecterRawValue(const pldm_numeric_effecter_value_pdr* pdr, 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 | platform.cpp | 6 #include "pdr.hpp" 26 using namespace pldm::responder::pdr; 81 // A map of PDR type to a lambda that handles creation of that PDR type. in generate() 82 // The lambda essentially would parse the platform specific PDR JSONs to in generate() 83 // generate the PDR structures. This function iterates through the map to in generate() 84 // invoke all lambdas, so that all PDR types can be created. in generate() 141 "PDR config directory '{PATH}' does not exist or empty for '{TYPE}' pdr, error - {ERROR}", in generate() 147 "Failed to parse PDR JSO in generate() 738 auto pdr = reinterpret_cast<pldm_terminus_locator_pdr*>(pdrBuffer.data()); generateTerminusLocatorPDR() local 847 pldm_state_sensor_pdr* pdr = nullptr; isOemStateSensor() local 918 pldm_state_effecter_pdr* pdr = nullptr; isOemStateEffecter() local [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
|
/openbmc/linux/drivers/soc/qcom/ |
H A D | pdr_interface.c | 43 /* control access to pdr lookup/indack lists */ 75 struct pdr_handle *pdr = container_of(qmi, struct pdr_handle, in pdr_locator_new_server() local 79 mutex_lock(&pdr->lock); in pdr_locator_new_server() 81 pdr->locator_addr.sq_family = AF_QIPCRTR; in pdr_locator_new_server() 82 pdr->locator_addr.sq_node = svc->node; in pdr_locator_new_server() 83 pdr->locator_addr.sq_port = svc->port; in pdr_locator_new_server() 85 pdr->locator_init_complete = true; in pdr_locator_new_server() 86 mutex_unlock(&pdr->lock); in pdr_locator_new_server() 89 mutex_lock(&pdr->list_lock); in pdr_locator_new_server() 90 list_for_each_entry(pds, &pdr->lookups, node) { in pdr_locator_new_server() [all …]
|
/openbmc/pldm/pldmtool/ |
H A D | pldm_platform_cmd.cpp | 96 "Retrieve individual PDR, all PDRs, PDRs of a requested type or retrieve all PDRs of the requested terminusID"); in GetPDR() 99 "retrieve individual PDRs from a PDR Repository\n" in GetPDR() 100 "eg: The recordHandle value for the PDR to be retrieved and 0 " in GetPDR() 101 "means get first PDR in the repository."); in GetPDR() 120 "retrieve all PDRs from a PDR repository"); in GetPDR() 178 // Retrieve all PDR records starting from the first in exec() 306 const std::map<pldm::pdr::EntityType, std::string> entityType = { 533 {PLDM_TERMINUS_LOCATOR_PDR, "Terminus Locator PDR"}, 534 {PLDM_NUMERIC_SENSOR_PDR, "Numeric Sensor PDR"}, 536 "Numeric Sensor Initialization PDR"}, 809 auto pdr = reinterpret_cast<const pldm_state_sensor_pdr*>(data); printStateSensorPDR() local 855 pldm_pdr_fru_record_set* pdr = printPDRFruRecordSet() local 883 pldm_pdr_entity_association* pdr = printPDREntityAssociation() local 989 struct pldm_numeric_effecter_value_pdr* pdr = printNumericEffecterPDR() local 1116 auto pdr = reinterpret_cast<const pldm_state_effecter_pdr*>(data); printStateEffecterPDR() local 1161 struct pldm_pdr_hdr* pdr = (struct pldm_pdr_hdr*)data; checkTerminusHandle() local 1226 auto pdr = reinterpret_cast<const pldm_terminus_locator_pdr*>(data); printTerminusLocatorPDR() local 1249 struct pldm_pdr_hdr* pdr = (struct pldm_pdr_hdr*)data; getTerminusHandle() local 1252 auto pdr = reinterpret_cast<const pldm_terminus_locator_pdr*>(data); getTerminusHandle() local 1271 struct pldm_numeric_sensor_value_pdr pdr; printNumericSensorPDR() local 1439 struct pldm_compact_numeric_sensor_pdr* pdr = printCompactNumericSensorPDR() local 1508 struct pldm_pdr_hdr* pdr = (struct pldm_pdr_hdr*)data; printPDRMsg() local [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 = in TEST() local 49 ASSERT_EQ(pdr->hdr.record_handle, 2); in TEST() 50 ASSERT_EQ(pdr->hdr.version, 1); in TEST() 51 ASSERT_EQ(pdr->hdr.type, PLDM_STATE_EFFECTER_PDR); in TEST() 52 ASSERT_EQ(pdr->hdr.record_change_num, 0); in TEST() 53 ASSERT_EQ(pdr->hdr.length, 23); in TEST() 55 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 = in TEST() local 54 EXPECT_EQ(pdr->hdr.record_handle, 2); in TEST() 55 EXPECT_EQ(pdr->hdr.version, 1); in TEST() 56 EXPECT_EQ(pdr->hdr.type, PLDM_STATE_SENSOR_PDR); in TEST() 57 EXPECT_EQ(pdr->hdr.record_change_num, 0); in TEST() 58 EXPECT_EQ(pdr->hdr.length, 17); in TEST() 60 EXPECT_EQ(pdr->sensor_id, 1); in TEST() [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/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/pldm/platform-mc/ |
H A D | terminus.cpp | 66 * terminus. The entity auxiliary name PDR of that terminus with the in findTerminusName() 119 for (auto& pdr : pdrs) in parseTerminusPDRs() local 121 auto pdrHdr = reinterpret_cast<pldm_pdr_hdr*>(pdr.data()); in parseTerminusPDRs() 126 auto sensorAuxNames = parseSensorAuxiliaryNamesPDR(pdr); in parseTerminusPDRs() 130 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 140 auto parsedPdr = parseNumericSensorPDR(pdr); in parseTerminusPDRs() 144 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 154 auto parsedPdr = parseCompactNumericSensorPDR(pdr); in parseTerminusPDRs() 158 "Failed to parse PDR with type {TYPE} handle {HANDLE}", in parseTerminusPDRs() 163 auto sensorAuxNames = parseCompactNumericSensorNames(pdr); in parseTerminusPDRs() [all …]
|
H A D | numeric_sensor.cpp | 157 std::shared_ptr<pldm_numeric_sensor_value_pdr> pdr, std::string& sensorName, in NumericSensor() 160 if (!pdr) in NumericSensor() 165 sensorId = pdr->sensor_id; in NumericSensor() 168 setSensorUnit(pdr->base_unit); in NumericSensor() 211 getSensorDataValue(pdr->sensor_data_size, pdr->max_readable); in NumericSensor() 213 getSensorDataValue(pdr->sensor_data_size, pdr->min_readable); in NumericSensor() 214 hysteresis = getSensorDataValue(pdr->sensor_data_size, pdr in NumericSensor() 45 NumericSensor(const pldm_tid_t tid,const bool sensorDisabled,std::shared_ptr<pldm_numeric_sensor_value_pdr> pdr,std::string & sensorName,std::string & associationPath) NumericSensor() argument 436 NumericSensor(const pldm_tid_t tid,const bool sensorDisabled,std::shared_ptr<pldm_compact_numeric_sensor_pdr> pdr,std::string & sensorName,std::string & associationPath) NumericSensor() argument [all...] |
/openbmc/linux/drivers/net/wireless/intersil/orinoco/ |
H A D | hermes_dld.c | 75 struct pdr { struct 79 char next[]; /* next PDR starts here */ 107 /*** PDR Access functions ***/ 110 pdr_id(const struct pdr *pdr) in pdr_id() argument 112 return le32_to_cpu(pdr->id); in pdr_id() 116 pdr_addr(const struct pdr *pdr) in pdr_addr() argument 118 return le32_to_cpu(pdr->addr); in pdr_addr() 122 pdr_len(const struct pdr *pdr) in pdr_len() argument 124 return le32_to_cpu(pdr->len); in pdr_len() 145 * Scan PDR for the record with the specified RECORD_ID. [all …]
|
/openbmc/libpldm/ |
H A D | CHANGELOG.md | 80 4. pdr: Add pldm_entity_association_pdr_remove_contained_entity() 81 5. pdr: Add pldm_pdr_remove_fru_record_set_by_rsi() 220 7. dsp: pdr: Bounds check pldm_entity_association_pdr_extract() 233 18. dsp: pdr: Rework test in pldm_entity_association_pdr_extract() 251 2. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 252 3. pdr: Add pldm_entity_association_pdr_create_new() 254 5. pdr: Add pldm_pdr_get_terminus_handle() API 255 6. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 270 1. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 338 2. pdr: Error propagation for [all …]
|
/openbmc/pldm/oem/ibm/libpldmresponder/ |
H A D | oem_ibm_handler.cpp | 17 using namespace pldm::pdr; 28 pldm::pdr::EntityType entityType, EntityInstance entityInstance, in getOemStateSensorReadingsHandler() 189 pldm_state_effecter_pdr* pdr = in buildAllCodeUpdateEffecterPDR() local 191 if (!pdr) in buildAllCodeUpdateEffecterPDR() 193 error("Failed to get record by PDR type, error - {ERROR}", "ERROR", in buildAllCodeUpdateEffecterPDR() 198 pdr->hdr.record_handle = 0; in buildAllCodeUpdateEffecterPDR() 199 pdr->hdr.version = 1; in buildAllCodeUpdateEffecterPDR() 200 pdr->hdr.type = PLDM_STATE_EFFECTER_PDR; in buildAllCodeUpdateEffecterPDR() 201 pdr->hdr.record_change_num = 0; in buildAllCodeUpdateEffecterPDR() 202 pdr->hdr.length = sizeof(pldm_state_effecter_pdr) - sizeof(pldm_pdr_hdr); in buildAllCodeUpdateEffecterPDR() [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::TerminusHandle, TerminusInfo>; 84 * @param[in] repo - pointer to BMC's primary PDR repo 109 * @param[in] pdrTypes - list of PDR types that need to be looked up in the [all …]
|
H A D | host_pdr_handler.cpp | 35 uint16_t extractTerminusHandle(std::vector<uint8_t>& pdr) in extractTerminusHandle() argument 40 var = (T*)(pdr.data() + sizeof(pldm_pdr_hdr)); in extractTerminusHandle() 44 var = (T*)(pdr.data()); in extractTerminusHandle() 55 std::vector<uint8_t>& pdr) in updateContainerId() argument 64 t = (T*)(pdr.data() + sizeof(pldm_pdr_hdr)); in updateContainerId() 68 t = (T*)(pdr.data()); in updateContainerId() 188 error("Failed to encode get pdr request, response code '{RC}'", "RC", in getHostPDR() 206 pdr::EventState state) in handleStateSensorEvent() 219 const std::vector<uint8_t>& pdr, [[maybe_unused]] const uint32_t& size, in mergeEntityAssociations() argument 226 const_cast<uint8_t*>(pdr.data()) + sizeof(pldm_pdr_hdr)); in mergeEntityAssociations() [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/common/test/ |
H A D | pldm_utils_test.cpp | 146 std::vector<uint8_t> pdr( in TEST() local 150 auto rec = reinterpret_cast<pldm_state_effecter_pdr*>(pdr.data()); in TEST() 164 ASSERT_EQ(pldm_pdr_add(repo, pdr.data(), pdr.size(), false, 1, &handle), 0); in TEST() 168 EXPECT_EQ(pdr, record[0]); in TEST() 180 std::vector<uint8_t> pdr( in TEST() local 184 auto rec = reinterpret_cast<pldm_state_effecter_pdr*>(pdr.data()); in TEST() 198 ASSERT_EQ(pldm_pdr_add(repo, pdr.data(), pdr.size(), false, 1, &handle), 0); in TEST() 214 std::vector<uint8_t> pdr( in TEST() local 230 std::vector<uint8_t> pdr( in TEST() local 234 auto rec = reinterpret_cast<pldm_state_effecter_pdr*>(pdr.data()); in TEST() [all …]
|
/openbmc/pldm/softoff/ |
H A D | softoff.cpp | 36 pldm::pdr::TerminusID TID = 0; 62 pldm::pdr::EntityType entityType = entry.value("entityType", 0); in SoftPowerOff() 63 pldm::pdr::StateSetId stateSetId = entry.value("stateSetId", 0); in SoftPowerOff() 127 pldm::pdr::TerminusID msgTID; in hostSoftOffComplete() 128 pldm::pdr::SensorID msgSensorID; in hostSoftOffComplete() 129 pldm::pdr::SensorOffset msgSensorOffset; in hostSoftOffComplete() 130 pldm::pdr::EventState msgEventState; in hostSoftOffComplete() 131 pldm::pdr::EventState msgPreviousEventState; in hostSoftOffComplete() 171 bool SoftPowerOff::getEffecterID(pldm::pdr::EntityType& entityType, in getEffecterID() 172 pldm::pdr::StateSetId& stateSetId) in getEffecterID() [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 …]
|