[Skiboot] [PATCH V3 06/15] core/pldm: Find PDR record by record handle

Christophe Lombard clombard at linux.vnet.ibm.com
Tue Sep 13 20:27:15 AEST 2022


Add a wrapper for the libpldm api: pldm_pdr_find_record()

Signed-off-by: Christophe Lombard <clombard at linux.vnet.ibm.com>
---
 core/pldm/pldm-platform-requests.c | 22 ++++++++++++++++++++++
 core/pldm/pldm.h                   |  4 ++++
 2 files changed, 26 insertions(+)

diff --git a/core/pldm/pldm-platform-requests.c b/core/pldm/pldm-platform-requests.c
index e7c54e65..f355d9aa 100644
--- a/core/pldm/pldm-platform-requests.c
+++ b/core/pldm/pldm-platform-requests.c
@@ -39,6 +39,28 @@ static void pdr_init_complete(bool success)
 	pdr_ready = true;
 }
 
+/*
+ * Find PDR record by record handle.
+ */
+int pldm_platform_pdr_find_record(uint32_t record_handle,
+				  uint8_t **pdr_data,
+				  uint32_t *pdr_data_size,
+				  uint32_t *next_record_handle)
+{
+	const pldm_pdr_record *pdr_record;
+
+	pdr_record = pldm_pdr_find_record(pdrs_repo,
+					  record_handle,
+					  pdr_data,
+					  pdr_data_size,
+					  next_record_handle);
+
+	if (!pdr_record)
+		return OPAL_PARAMETER;
+
+	return OPAL_SUCCESS;
+}
+
 /*
  * Search the matching record and return the effecter id.
  * PDR type = PLDM_STATE_EFFECTER_PDR
diff --git a/core/pldm/pldm.h b/core/pldm/pldm.h
index 688b767c..88ba4892 100644
--- a/core/pldm/pldm.h
+++ b/core/pldm/pldm.h
@@ -73,6 +73,10 @@ int pldm_platform_reload_pdrs(void);
 int pldm_platform_init(void);
 void pldm_platform_exit(void);
 
+int pldm_platform_pdr_find_record(uint32_t record_handle,
+				  uint8_t **pdr_data,
+				  uint32_t *pdr_data_size,
+				  uint32_t *next_record_handle);
 int pldm_requester_handle_response(struct pldm_rx_data *rx);
 int pldm_requester_queue(void *request_msg, size_t request_len,
 			 void (*complete)(struct pldm_rx_data *rx, void *data),
-- 
2.37.3



More information about the Skiboot mailing list