From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id BE4F3740034 for ; Tue, 27 Feb 2024 14:35:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8/KyhYte1C/26wqCDwOlZREkNkap0LNjSPyxtlyUTyg=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1709044509; v=1; b=r2k0gIDv1bq+vR5T6sgTIeQme88b+7fk9fh3CUWjHZ5sEr9+IKyuM6BeP4Goe3/9ePV8biuj haqRFbj2w39xLSvNYLyEmUwP03jYeE7Pp5l42nsmAmy+EgMLh3Tuzcn8UZayQXegETusW16c5Qb YLa9ayxRQ8ld8H0Y/11QGSDc= X-Received: by 127.0.0.2 with SMTP id VfytYY7687511xB4T9mohQ4D; Tue, 27 Feb 2024 06:35:09 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.100]) by mx.groups.io with SMTP id smtpd.web10.13677.1709044508659932047 for ; Tue, 27 Feb 2024 06:35:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkx8YO0/p0c/5N6OdW/UBOQNenStpt401E3wxytwHn5swlnpICccMcvutyxKPuISY7FGzy8TytcrHGJfGpTLiBXBbN8Fak6+isZINrZOx+QvYRGnV4g8muahvqWb1oUVoltheXTlLDqFoFCdmjaHSYZeo8ZiNfLBFtT+e4y7Gra75olQEP56e5z8LZjdn1dqgBtfLOYtMIu5lmn/fPNpkMrt7UBOWP+CcSM5mPDCwqTd+Ca6UtnlkAJi9eos9D2VCR0j8sbQLO7ZqPl4fwKNRieu50UJFpih0FqPVBgW5HTAd5eWm01h5nE1S+ezlHoAJrN4pp+lRKfSXmflI1ZYiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S/GHE0aorIfTmpOrugjzsiLfCN+I7bswlDGwzjHfA/c=; b=EEQDbwtn+lBC27op1dHbuNgdXiqMNKkitjc8da0SQnfeVd9XZrhh9PHHCZn3+9b06fQSjLqyKZT/B4HEi+sqrsbWd+zqw9v0lKuPBcPzFiBgAQamuB3xusG6CDbhbIGuqqB1kWLiFBsp9yphNlIRYcmcDGue/Bf4bkcdSF0FlP8p86B/h9fdnptlMpRhq6L8NxK8m6f6bGO9JpYxkv0RxC9qpGd7wPjh512RmQmehVfGi7y9VbVms+x7vKLsR1oi8J8929JcMUq50E4943H1vXd40R1MO5P1Y9cJWRCcGrxJQP2HwlVGO+ZQxKo5+rtMOouBdYlgUnvhPmKLvk2VSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by DS0PR10MB7152.namprd10.prod.outlook.com (2603:10b6:8:f1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.37; Tue, 27 Feb 2024 14:35:06 +0000 X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::7840:c724:8a2a:4cf5]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::7840:c724:8a2a:4cf5%5]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 14:35:06 +0000 From: "Igor Kulchytskyy via groups.io" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Nickle Wang Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver Thread-Topic: [EXTERNAL] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver Thread-Index: AQHaaF2vpbBDnsBe6ES5dsJxVyGIPbEeQ46w Date: Tue, 27 Feb 2024 14:35:06 +0000 Message-ID: References: <20240226024338.157-1-abner.chang@amd.com> In-Reply-To: <20240226024338.157-1-abner.chang@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|DS0PR10MB7152:EE_ x-ms-office365-filtering-correlation-id: 7d708290-229b-48b2-adab-08dc37a14abf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Dcv71M+ip9q7n0lkh9SFbMwlqA/wfB1S3D/cFGqAUE2Cte8mMzsc0xMTYQ/PomwbvYS8QR56A8kLNS+17JjfhcLl1/b058G0vKrvcopOYKG5N1ExDovYPzPhwO9ndZ+jg4hThCvG8PZsoNAn0xN17Hp34G6CK3DaW0a0ZDM1ZxO3NFhyK+kVZ0/8X0G0dmoA51JyLR5DrvuHgz3yjg0MYzTYg80aqC5zjW6f/Jxan8Yaqs7ZIKI5tMZ0Db7HJC3Ti34jUSnNwuS7jXtweLtie+4DeozaHsDZjH6vdoEvQfIys+SP5JxkDtiHsniF90ZIVOzzw4ocs3IPfZmY/1Ca5NiS0y+vu+kB8ux4KgOj6xHsZnowTo94MZQPe+WkNzfnUDEPCaGPhB8uqt/j6sbUNECDCikAwt9tP1reUuIJXjvNVgPukduVDRmJjzkmfFZJENIDtx/mMCfpPqu+d/Ik8YDVEnYGWAe4yVb+7SBKcA8Z98hsVUGduACHJ6F+Si2BzdPyynn+jiyQiniMgt1uXH4+PfZvrEBj6xdSyPEicCYeFR5tvkebYwQQesxdWy/KVTzeJmpA02gNoo581Imw9iNwucWqfhQ9Mn+TPOhSnL2WPHi92Q7mBNLvv2aJpHRS/LWLyP56za1Qd3hPS7t15klO+cMZIvS2S+7DGiRwT+zk9uGD0MnGQ+1gQ47de/RjFP+1Yrj0K4+nNYkQzERXQA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?q90Ck4UWAczXpJz26qN4VMjtXxIMRWkHmhUfZyvsayzkMUrVgOfgQN22fCE0?= =?us-ascii?Q?/dPNGSOb2J6LO7OUyATVsKMI673uiIeo5cngsd3TppFXKFLJ/XFbtLbYGTks?= =?us-ascii?Q?zldD/zJ89cftskd6SCDW2QrKwR+77HVbZh58NnwVN3s6PU2CAOxYFsdLJd0q?= =?us-ascii?Q?ALu/ypZDlNtZc5fXOROYQGRk7Jy/75ppxSPebLn87a+YfibRxL4Lxwo2YnTc?= =?us-ascii?Q?YkvijKLm42VJSr2e7t5O9tL3jrw9SafarMsJptaAWnMVAGkAWkCY4Tafwq9j?= =?us-ascii?Q?jDqr+46h7uxYDXcLQfImlSnopDmZYLviYvRawP+KZo6k3ra+AjTWNboZKrZh?= =?us-ascii?Q?BoUoBm6Wnb0Ndex5nyUeB9C17+I5N7vobmEUNsaJmQOFJU63BSwmnfhAAztU?= =?us-ascii?Q?E1aiJ+M+2r+Is2QIRP8YfskAJgdPV+QssJuw/1JVde2idnzfZrU7KxwjQEHO?= =?us-ascii?Q?+l4iU+dJf3UpznIlOYqIKnZwi7zTfNuEDelP2h+gnZnz0APqVMavq9LZl9E6?= =?us-ascii?Q?GE3ufYG7FfPm19WlzrAmDVcDyeUZ9BJwtu1LkutmnMb1LvWzxxW1KHszaCl9?= =?us-ascii?Q?rEKYzKeyV+EVdUCJ590GQRKThmLsTa4TZ5qTWm40UbOx/PqGqsdVHc8Bmiw8?= =?us-ascii?Q?ycD5eYjLXICBeW8kZ1h2Kn1lHjEIRNzyN7yDanZhRqWbtA7NzKqhEDUPKp6V?= =?us-ascii?Q?ooZQtJdivxKTXCXNEQTP2catYCRCKk6iS2DZ2nEmeKtaFF2+X21FEgZviDEv?= =?us-ascii?Q?XESS4HTUcNYwiQTz/PdhaW8KpaGzdg6OI+tmJB/tdzH0L03rTIe+YcUacZgQ?= =?us-ascii?Q?FeWtzDmHk0FPcN+8lSUwN7O5yBb1802Zvf6cnLjVylAM2XR9OnHu/YYVt460?= =?us-ascii?Q?v4k884jKU6I8pUPplPwsEzIxCxVTce4tzSy7pqvpciagzzesx/8tQ8FXzKDI?= =?us-ascii?Q?WAwEvuCXtBCV36KjBxWEqmO9gQ66MWAmkB5STkWox0mdsSo9+w+iyVTyzn4l?= =?us-ascii?Q?C7dFhqVzbVdBvK1hZOOpvtQ0miXWzu5QLHyFsNJyVpEo6FipRIplHxfs23r+?= =?us-ascii?Q?tipcEppc7/D4Qxm7Hkh+fiLM3/3sErS47OBWhdeytwuNqjWI5t6A38e6r9/b?= =?us-ascii?Q?623srjsh6YjK85RFmt/Wr8pJ3bkpdbW4GFFOe1j/Yo2L83pQFi1K7u51bOl8?= =?us-ascii?Q?x3ifzeSLNcg/4eI8fUjxq8bzo8kWyWUaoGvpo4QQ8cqTjqAt7pGW/7Nr9TD4?= =?us-ascii?Q?OBUyvr2TfyXlo7ox3VR0h0PIpekhbz8zQu1pGqWqWuEKpVxTz1GfFPq7JuTx?= =?us-ascii?Q?rreh33mFIzBGctDpDgwaqOXu6goBjvs+H2YCyf88Y2Mkcqv9UoPHlwMLeZ+/?= =?us-ascii?Q?GDpm9MzlZooBI1bJ/8E9bw2RwDrBx0V0JsjO2E69jazxcYSVv3eca9NO/+8r?= =?us-ascii?Q?HdH5fI2oDx89IP0etqRy4bnzSiXqow39cDnNk6KO2iGPSSrbBSny8LevKHej?= =?us-ascii?Q?XpkhXo8/SKdw1P06Kg4AGbfDxynoDBNAllVtBwwBtj0KWxHB2eAHzNA/FVF4?= =?us-ascii?Q?yTGOQAd35eISQO60xA0=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d708290-229b-48b2-adab-08dc37a14abf X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2024 14:35:06.3067 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Vd6LY/iNyOOhmAk9xOEjV5/w/WRRSx8iVPw9dXCnnHnkbjvedgjQVKKVtzx/jQcw X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7152 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,igork@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PqG8njejyMJIturq1l9wQd8qx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=r2k0gIDv; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Reviewed-by: Igor Kulchytskyy Regards, Igor -----Original Message----- From: abner.chang@amd.com Sent: Sunday, February 25, 2024 9:44 PM To: devel@edk2.groups.io Cc: Nickle Wang ; Igor Kulchytskyy Subject: [EXTERNAL] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JS= ON C Structure DXE driver **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** From: Abner Chang BZ #: 4711 - Add mode debug messages. - This driver shouldn't have a dependency on Redfish package and the references of "Redfish" terminology. Remove the references of "Redfish" from this driver. - Fix the missing parameter of DEBUG macros used in this driver. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy --- .../RestJsonStructureDxe.inf | 3 +- .../RestJsonStructureInternal.h | 3 +- .../RestJsonStructureDxe.c | 96 ++++++++++++++++++- 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf b/Red= fishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf index 61e6253d318..e74c9dfd38b 100644 --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf @@ -2,6 +2,7 @@ # Implementation of EFI REST JSON Structure Protocol. # # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -17,7 +18,6 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - RedfishPkg/RedfishPkg.dec [Sources] RestJsonStructureDxe.c @@ -26,6 +26,7 @@ [LibraryClasses] BaseLib BaseMemoryLib + DebugLib MemoryAllocationLib UefiBootServicesTableLib UefiDriverEntryPoint diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h b/= RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h index 8d7175125c1..04be5cc80b5 100644 --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h @@ -3,6 +3,7 @@ Protocol. (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -25,7 +26,7 @@ typedef struct _REST_JSON_STRUCTURE_INSTANCE { LIST_ENTRY NextRestJsonStructureInstan= ce; ///< Next convertor instance UINTN NumberOfNameSpaceToConvert;= ///< Number of resource type this convertor supports. - EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *SupportedRsrcIndentifier; = ///< The resource type linklist + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *SupportedRsrcIndentifier; = ///< The supported resource type array. EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure; = ///< JSON to C structure function EFI_REST_JSON_STRUCTURE_TO_JSON StructureToJson; = ///< C structure to JSON function EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE DestroyStructure; = ///< Destory C struture function. diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c b/Redfi= shPkg/RestJsonStructureDxe/RestJsonStructureDxe.c index 404866fb319..0da5132e5ae 100644 --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c @@ -4,12 +4,14 @@ Protocol. (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include +#include #include #include "RestJsonStructureInternal.h" @@ -72,6 +74,8 @@ RestJsonStructureRegister ( } } + DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to regis= ter for the name spaces.\n", __func__, NumberOfNS)); + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof (REST_JSON_ST= RUCTURE_INSTANCE) + NumberOfNS * sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTI= FIER)); if (Instance =3D=3D NULL) { @@ -88,6 +92,10 @@ RestJsonStructureRegister ( ThisSupportedInterp =3D JsonStructureSupported; for (Index =3D 0; Index < NumberOfNS; Index++) { CopyMem ((VOID *)CloneSupportedInterpId, (VOID *)&ThisSupportedInterp-= >RestResourceInterp, sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); + DEBUG ((DEBUG_MANAGEABILITY, " Resource type : %a\n", ThisSupportedIn= terp->RestResourceInterp.NameSpace.ResourceTypeName)); + DEBUG ((DEBUG_MANAGEABILITY, " Major version : %a\n", ThisSupportedIn= terp->RestResourceInterp.NameSpace.MajorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Minor version : %a\n", ThisSupportedIn= terp->RestResourceInterp.NameSpace.MinorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Errata version: %a\n\n", ThisSupported= Interp->RestResourceInterp.NameSpace.ErrataVersion)); ThisSupportedInterp =3D (EFI_REST_JSON_STRUCTURE_SUPPORTED *)ThisSuppo= rtedInterp->NextSupportedRsrcInterp.ForwardLink; CloneSupportedInterpId++; } @@ -125,6 +133,8 @@ InterpreterInstanceToStruct ( EFI_STATUS Status; EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; + DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__)); + if ((This =3D=3D NULL) || (InterpreterInstance =3D=3D NULL) || (ResourceRaw =3D=3D NULL) || @@ -146,9 +156,23 @@ InterpreterInstanceToStruct ( ResourceRaw, RestJSonHeader ); + if (EFI_ERROR (Status)) { + if (Status =3D=3D EFI_UNSUPPORTED) { + DEBUG (( + DEBUG_MANAGEABILITY, + "%a %a.%a.%a REST JSON to C structure interpreter has no capabil= ity to interpret the resource.\n", + InterpreterInstance->SupportedRsrcIndentifier->NameSpace.Resourc= eTypeName, + InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MajorVe= rsion, + InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MinorVe= rsion, + InterpreterInstance->SupportedRsrcIndentifier->NameSpace.ErrataV= ersion + )); + } else { + DEBUG ((DEBUG_MANAGEABILITY, "REST JsonToStructure returns failure= - %r\n", Status)); + } + } } else { // - // Check if the namesapce and version is supported by this interpreter= . + // Check if the namespace and version is supported by this interpreter= . // ThisSupportedRsrcTypeId =3D InterpreterInstance->SupportedRsrcIndentif= ier; for (Index =3D 0; Index < InterpreterInstance->NumberOfNameSpaceToConv= ert; Index++) { @@ -171,6 +195,11 @@ InterpreterInstanceToStruct ( ResourceRaw, RestJSonHeader ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_MANAGEABILITY, "Don't check version of this reso= urce type identifier JsonToStructure returns %r\n", Status)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName =3D= %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); + } + break; } else { // @@ -195,6 +224,14 @@ InterpreterInstanceToStruct ( ResourceRaw, RestJSonHeader ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_MANAGEABILITY, "Check version of this resource= type identifier JsonToStructure returns %r\n", Status)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName = =3D %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported MajorVersion = =3D %a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported MinorVersion = =3D %a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported ErrataVersion = =3D %a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion)); + } + break; } } @@ -232,6 +269,8 @@ InterpreterEfiStructToInstance ( EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier; + DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__)); + if ((This =3D=3D NULL) || (InterpreterInstance =3D=3D NULL) || (RestJSonHeader =3D=3D NULL) || @@ -284,6 +323,14 @@ InterpreterEfiStructToInstance ( RestJSonHeader, ResourceRaw ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_MANAGEABILITY, "StructureToJson returns %r\n", Sta= tus)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName =3D %= a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported MajorVersion =3D %= a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported MinorVersion =3D %= a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " Supported ErrataVersion =3D %= a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion)); + } + break; } } @@ -416,6 +463,35 @@ RestJsonStructureToStruct ( return EFI_UNSUPPORTED; } + if (RsrcTypeIdentifier !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, "%a: Looking for the REST JSON to C Struc= ture converter:\n", __func__)); + if (RsrcTypeIdentifier->NameSpace.ResourceTypeName !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: %a\n", RsrcTypeIdentif= ier->NameSpace.ResourceTypeName)); + } else { + DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: NULL")); + } + + if (RsrcTypeIdentifier->NameSpace.MajorVersion !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: %a\n", RsrcTypeIdentif= ier->NameSpace.MajorVersion)); + } else { + DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: NULL")); + } + + if (RsrcTypeIdentifier->NameSpace.MinorVersion !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: %a\n", RsrcTypeIdentif= ier->NameSpace.MinorVersion)); + } else { + DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: NULL")); + } + + if (RsrcTypeIdentifier->NameSpace.ErrataVersion !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: %a\n", RsrcTypeIdenti= fier->NameSpace.ErrataVersion)); + } else { + DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: NULL")); + } + } else { + DEBUG ((DEBUG_MANAGEABILITY, "%a: RsrcTypeIdentifier is given as NULL,= go through all of the REST JSON to C structure interpreters.\n", __func__)= ); + } + Status =3D EFI_SUCCESS; Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); while (TRUE) { @@ -427,10 +503,12 @@ RestJsonStructureToStruct ( JsonStructure ); if (!EFI_ERROR (Status)) { + DEBUG ((DEBUG_MANAGEABILITY, "%a: REST JSON to C structure is interp= reted successfully.\n", __func__)); break; } if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStruc= tureInstance)) { + DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter fo= und.\n", __func__)); Status =3D EFI_UNSUPPORTED; break; } @@ -483,6 +561,7 @@ RestJsonStructureDestroyStruct ( } if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStruc= tureInstance)) { + DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter fo= und.\n", __func__)); Status =3D EFI_UNSUPPORTED; break; } @@ -512,8 +591,9 @@ RestJsonStructureToJson ( OUT CHAR8 **ResourceRaw ) { - EFI_STATUS Status; - REST_JSON_STRUCTURE_INSTANCE *Instance; + EFI_STATUS Status; + REST_JSON_STRUCTURE_INSTANCE *Instance; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier; if ((This =3D=3D NULL) || (RestJSonHeader =3D=3D NULL) || (ResourceRaw = =3D=3D NULL)) { return EFI_INVALID_PARAMETER; @@ -523,6 +603,13 @@ RestJsonStructureToJson ( return EFI_UNSUPPORTED; } + RsrcTypeIdentifier =3D &RestJSonHeader->JsonRsrcIdentifier; + DEBUG ((DEBUG_MANAGEABILITY, "Looking for the REST C Structure to JSON r= esource converter:\n")); + DEBUG ((DEBUG_MANAGEABILITY, " ResourceType : %a\n", RsrcTypeIdentifier= ->NameSpace.ResourceTypeName)); + DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion : %a\n", RsrcTypeIdentifier= ->NameSpace.MajorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion : %a\n", RsrcTypeIdentifier= ->NameSpace.MinorVersion)); + DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: %a\n", RsrcTypeIdentifier= ->NameSpace.ErrataVersion)); + Status =3D EFI_SUCCESS; Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); while (TRUE) { @@ -537,6 +624,7 @@ RestJsonStructureToJson ( } if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStruc= tureInstance)) { + DEBUG ((DEBUG_ERROR, "%a: No REST C structure to JSON interpreter fo= und.\n", __func__)); Status =3D EFI_UNSUPPORTED; break; } @@ -587,7 +675,7 @@ RestJsonStructureEntryPoint ( } /** - This is the unload handle for Redfish discover module. + This is the unload handle for REST JSON to C structure module. Disconnect the driver specified by ImageHandle from all the devices in t= he handle database. Uninstall all the protocols installed in the driver entry point. -- 2.37.1.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116047): https://edk2.groups.io/g/devel/message/116047 Mute This Topic: https://groups.io/mt/104575985/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-