From patchwork Tue Sep 13 10:27:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lombard X-Patchwork-Id: 1677239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ZpzLzDuw; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MRfqb2cHRz1ync for ; Tue, 13 Sep 2022 20:30:19 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MRfqb27F5z3cdB for ; Tue, 13 Sep 2022 20:30:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ZpzLzDuw; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clombard@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ZpzLzDuw; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MRfmP0gkyz3c5v for ; Tue, 13 Sep 2022 20:27:32 +1000 (AEST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28D9g4bC010025 for ; Tue, 13 Sep 2022 10:27:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=XiZmunGnGgNXRAb0r357v5t/oK8X9iI2E7He7GJxONw=; b=ZpzLzDuwdoqVfN+NeRUafXXIdj8hOosTH6EeZtLnwbLLhUW+lWqdN+jbgbop4f81VfYM VXo8dOAknwfqp3h+AIOJB9Lg3FdfINnqj7iLif76g5dk/RDW1rzrsbAY6wDS447ff8ad YsDMpIfaQ/+ZEIDIhLcn32yueM2lm8ZempcIbt8K4WoGcNzq3ik7wjkNy3EdI3HCyiRa iHvVeRdOBe4a+W+3nFW6ZpzzxqlqF5PR/OqvFsh3XUKMVwaPygVmSJOM2TU0b/76KFAj gDivvdkUgAjW8Wpr4WKbw83213ZoT+kw81T/V8DxgiUv6r8Zlfvf2xYobQHqkAnHP8Ym rQ== Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jjqf2hj20-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Sep 2022 10:27:30 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 28DAJk9f022809 for ; Tue, 13 Sep 2022 10:27:28 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03fra.de.ibm.com with ESMTP id 3jgj78tptc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Sep 2022 10:27:28 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 28DARQqN36700422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 13 Sep 2022 10:27:26 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F034111C050 for ; Tue, 13 Sep 2022 10:27:25 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C8F7F11C04A for ; Tue, 13 Sep 2022 10:27:25 +0000 (GMT) Received: from li-ac0ca24c-3330-11b2-a85c-93224c50ad7a.ibm.com.com (unknown [9.171.35.136]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Tue, 13 Sep 2022 10:27:25 +0000 (GMT) From: Christophe Lombard To: skiboot@lists.ozlabs.org Date: Tue, 13 Sep 2022 12:27:15 +0200 Message-Id: <20220913102724.65563-7-clombard@linux.vnet.ibm.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913102724.65563-1-clombard@linux.vnet.ibm.com> References: <20220913102724.65563-1-clombard@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PpMeS0jEcnKq5OFtQBHs56k_oj_3SkXX X-Proofpoint-GUID: PpMeS0jEcnKq5OFtQBHs56k_oj_3SkXX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_03,2022-09-13_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130045 Subject: [Skiboot] [PATCH V3 06/15] core/pldm: Find PDR record by record handle X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add a wrapper for the libpldm api: pldm_pdr_find_record() Signed-off-by: Christophe Lombard Reviewed-by: Abhishek Singh Tomar --- 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),