Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 3 | #include "common/utils.hpp" |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 4 | #include "libpldmresponder/pdr_utils.hpp" |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 5 | |
| 6 | #include <stdint.h> |
| 7 | |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 8 | using namespace pldm::responder::pdr_utils; |
| 9 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 10 | namespace pldm |
| 11 | { |
| 12 | |
| 13 | namespace responder |
| 14 | { |
| 15 | |
| 16 | namespace pdr |
| 17 | { |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 18 | |
Sampa Misra | 12afe11 | 2020-05-25 11:40:44 -0500 | [diff] [blame] | 19 | constexpr uint8_t BmcMctpEid = 8; |
| 20 | constexpr uint8_t BmcPldmTerminusHandle = 1; |
| 21 | constexpr uint8_t BmcTerminusId = 1; |
| 22 | |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 23 | /** @brief Build (if not built already) and retrieve PDR by the PDR types |
| 24 | * |
| 25 | * @param[in] dir - directory housing platform specific PDR JSON files |
| 26 | * @param[in] pdrType - the type of PDRs |
| 27 | * |
| 28 | * @return Repo - Instance of pdr::Repo |
| 29 | */ |
Deepak Kodihalli | c682fe2 | 2020-03-04 00:42:54 -0600 | [diff] [blame] | 30 | void getRepoByType(const Repo& inRepo, Repo& outRepo, Type pdrType); |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 31 | |
| 32 | /** @brief Get the record of PDR by the record handle |
| 33 | * |
| 34 | * @param[in] pdrRepo - pdr::RepoInterface |
| 35 | * @param[in] recordHandle - The recordHandle value for the PDR to be |
| 36 | * retrieved. |
| 37 | * @param[out] pdrEntry - PDR entry structure reference |
| 38 | * |
| 39 | * @return pldm_pdr_record - Instance of pdr::RepoInterface |
| 40 | */ |
Deepak Kodihalli | c682fe2 | 2020-03-04 00:42:54 -0600 | [diff] [blame] | 41 | const pldm_pdr_record* getRecordByHandle(const RepoInterface& pdrRepo, |
George Liu | e53193f | 2020-02-24 09:23:26 +0800 | [diff] [blame] | 42 | RecordHandle recordHandle, |
| 43 | PdrEntry& pdrEntry); |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 44 | |
| 45 | } // namespace pdr |
| 46 | } // namespace responder |
| 47 | } // namespace pldm |