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 31F02740045 for ; Mon, 26 Feb 2024 13:49:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Ztm3WDtDnBjs/qK8WlHD/aUHpbvOfj21oGQ3owkDOUE=; 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; s=20140610; t=1708955380; v=1; b=UJyrORVzW/0XztTNaimjsnKtF+xlLThiRUNFStZqdPs+f2N6HmBv0bhDogRY+Ymj5NZxjGnD E9fQIJ7UB2m8V9A4r1dyPvZQRQ70UVqA/iq72xtkFv4aHsiznQYCg5gpP8XmnLLQ5vL6enTmaop ra0gcmy4xxkeVzkPrLWlWS2s= X-Received: by 127.0.0.2 with SMTP id CDa9YY7687511xkA8mI9qNdX; Mon, 26 Feb 2024 05:49:40 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.78]) by mx.groups.io with SMTP id smtpd.web10.20599.1708955380103373119 for ; Mon, 26 Feb 2024 05:49:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dGSTMghT3Xypu0lOGOPE7aVuFUmxXwCFXfekF19FOHW7VNDp1ED42nzgHuB5WoS/EezMopmibfk6qDftgkyiKXlt5S1XMYYoYmZXI0xZuwjQ0ylGLgXN0D0+mjgoSb3Kn8RZBwzqoo+9rHIhNLstyh7+Snm8yE+FqV934kKe8vGty757uM91GUZhOL722Pfi3O4a5I86NG563VjI2MiYDWLsddm9ZIxILnxIVrgRy6hxLGku/4S/D2cEqicUPzRnl9IIuD2qyABKaG7UKqlSexLyFHpVdPJAAl9Im3p7jVry9soiAAOL0xO0OpHY5Cm4tGquVu/49tqbRm/jVIjSpg== 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=HBxCKxbLKNufuvLkKCBD4vdoZ/J0dnHUByCcEOjVYhw=; b=bZz9AYtPBOJueiQ9ahmkb2DcoHX4BhwNOqqLBlkRo5YJGsu1DQG7Tt98Z3Q39h5P0iklOYQ+Yn8sre0x5J+pzoTNE2tDndebi0qOcOpuQQ4hCGUfuhEJHpiOYVUuj/2ANF5p6pB2Y324GN8Zl07odX7TafVmfJ4NTW5DIyTlAvkzgKl/yZtXioK1p5zl51e3agqeFTlsP+tnouRzov4YZth/Xmp2OJR/zM7qFy4ncU4VZ2Uk4vCeWynw3kwi0RrTl79bYXkvtIOuOXJQXjeOpLZ2ZWTqlh+HjpaqQuQBb6gQRUG2YaV6px7qVUBmN0/dPJvjGRtKPjZGxPPWEDXKIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by DM4PR12MB5167.namprd12.prod.outlook.com (2603:10b6:5:396::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 13:49:36 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::aa79:3ab0:fbcd:d61b]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::aa79:3ab0:fbcd:d61b%5]) with mapi id 15.20.7316.034; Mon, 26 Feb 2024 13:49:36 +0000 From: "Nickle Wang via groups.io" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver Thread-Topic: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver Thread-Index: AQHaaF2u8GL//+nleE2c+PIAkCXI27Eco60A Date: Mon, 26 Feb 2024 13:49:36 +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-Mentions: abner.chang@amd.com X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|DM4PR12MB5167:EE_ x-ms-office365-filtering-correlation-id: 298d957d-f60e-44c6-20cb-08dc36d1c501 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: GMUgL385DIU/K1YlnGwzamZJGiEDauTfZwEBiDB0MbAQPeQg/ElK65dU5hvPBOuA4gGf4/7EFasZE5Gt5yD4+YLMJ26yUNdXxMCfLanx2DJzn8BPVKO3qgK9dzKNY4wECdC/0Nryn45dD2+HpaR+0UZs97qAyVEHk1axtjwl11Ttnzibbobyu4ZuGq61vJH1ejNlwqduIRZ6qHk0AOfxdsH1F82qIGMJ+lDe/FVpSxAfN89emuH5XcRRC2IS9jYBRlQ7WgXSSPKxsp+MQXcSe7aEwDBNGVRi3aU2uQ+x09uJyKF/Fo/IlFvRSYMuUhAxbqQeMEKyNZunxags5lY2DpV4Zrf7SjVseItBZZlVMlU2So5jwuU773pNTD+y65N77UeyOf2AhRXOMSYOVyqrBtou/ZaAmBKV+fWvDzVdnz7vlNUDdTDhSgSdDxlqFjECptYuikTfUwbHw4zb4HMPBKl5bCKNLyc8QsTy3qvaQzW+Iy2OmN9uOTYw8XQFId9T0LdbcXUlek1gRNX4BgosJ/tSoGmTk4x3lslwk/uO2JOgi0DBlHa9/mWoHiY2XZt64xTTmY1Lsc5Vf66POT6ovf7r2xQgeohjFcU9mgJI/q1nxInaH5NCAvowoeHRMhlhQL2dQuL7YFRBONMUiFJnpqGAXsmzK+T+Ls2K6qmoMm0NW6H1b3e4EcXUQEZeAV/UB95loJ+jqRRtNl/BPUnSiw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uhSo7BajTzykvHcRw9lToT+ASfuLdQ3AxwcGF1itoFLTx1sF3zfo2ONnuFxY?= =?us-ascii?Q?KOEMjaMtYYa6B89knZu945ObdnAVNo5hdUBZcfEjhXGQ4Pvm1nI3voS1S8l2?= =?us-ascii?Q?yGfyBEIULc0tzKBChlFo3/6XUpoDDHLe+btEpEaB5XU/Vj544i3nkuKzx28y?= =?us-ascii?Q?fYM3puGSAQwpvefiKmC+2tu70Bxvh9Qo/U8En4OXWwHKLX7L3M1BEkoWVnxW?= =?us-ascii?Q?NM8z/u7e/cWvafPJe1dmvnTxBYmCjuOB8Lzr5xeKwodu5CCxYOJ6X4HydPK8?= =?us-ascii?Q?e2oL31d2pCI8tR6HsAaJpc1BdUcfHgmu6VTz33sG116CpmvnkC7tTZcgeQOw?= =?us-ascii?Q?4PgiRDgs3o5gCgsIFqcQxJSAmVjsERFiZjmuKV3Kpjvn8kiAhs3hhDQl8Uxv?= =?us-ascii?Q?qL1GjsSsG8edcFlBfGJEXw+cUHIr9CO38cyOhM+bUhT+sGhwS/0uo7utFf1k?= =?us-ascii?Q?nyNHUnY0gfNzAOiTHJE1faaUgdym1fXZ0wpVk2eExyWztDHHdkWsVhsrLbwV?= =?us-ascii?Q?BeC8/WRJ6c+RiyxeC131Rh4aCNtzxH7oS2hIgoYovmAYZCQphpvTQGC8l1/E?= =?us-ascii?Q?A/gEZJi2Y/662UP8yrUmTORQrTed7g6ayB2Ym9EvQ6jmqPY7uBERfqgb+kjX?= =?us-ascii?Q?BNh4lKohA05ua7K5Yp4vRNIWzl1apUuj7KJmZhFckmPgYm16xXffsk/gL5LO?= =?us-ascii?Q?MAM0dtV5MkWgI9cn2rse2gIzZ6wbU8XhPtOef3+9FyH0CCQAfSpgHDLCOdIw?= =?us-ascii?Q?IozYCzQdQv8Y+5Nx40l98uM8JS6JTfUDMAuGb92fvv+ttCJq/5TUW6th35CK?= =?us-ascii?Q?vH99toCYGJPaPNZc7g6wX6A2k7B3WNF10deW4wGnskcwIT7AZDrvQdqZvkxk?= =?us-ascii?Q?e9P86vMchpeGmJLujdp6mXY7YviC+WDV2bLvMsRAdkvsq3IsC2h9KvP0C4iS?= =?us-ascii?Q?TZ5TIJWpIJDbBI7sKnZmsVXhZpUkELynLQBHJ59Nyp/+FYtY4YRPFeTYm3Xr?= =?us-ascii?Q?L77XluYMZvqkjS22Wgxyh0IdeMaomxQBJnEFgTvBjVWuxt/uW9SOY9an926d?= =?us-ascii?Q?0RVit13TS2tYaNTaxRKJsZ3muDAaXJeFDB6aoZDW/xHy/gJfTiJwjHxUUSFQ?= =?us-ascii?Q?LJKwX93YCIPxGi7PG+zYy63hIn2uwlwZaH35ayn1hdtzDJQMD6mJ/GTUi1Tp?= =?us-ascii?Q?YTOpyWbFMj6/E3OkagBTECoqyllbtFx60IzaFvcpAn9sjnD2WmqnjAMhqm9p?= =?us-ascii?Q?sqicdhValFR0RmgQU3J09opvU5Cq8YclaozygVgvIxEyXyGXNddo6h6OcEnv?= =?us-ascii?Q?KffD9CJIw/5DcvhcbnmXvV098sG6KahePyKaoW0tYtADQBE6CfHDjrJBMVo0?= =?us-ascii?Q?s473H1Nj9ff6qlgmcSQOcRGE7qegxwlblPDaGYwbz487LFbcyaN1ILaP9pAj?= =?us-ascii?Q?17z/icwA3BGLe2zD9wp2en2gQi/+0gLaovCq5qW0B0Tu7EOlIQ9QYMVS4QbW?= =?us-ascii?Q?4F2Nd1UtOQ4c8S7fO1ffr5AeQUe7ddSSJwqrHZA58QMB9Y5+972dLVW1d0xr?= =?us-ascii?Q?LqQxg9ADVDb0rQvmW9Z/2QUdZM6ZoNh2lZnYjj2ykkTcJUOFCJbsPlaLYbQL?= =?us-ascii?Q?MllDRkRK4JF+S8kAqciBgweqPPVFqimKxYriRz1iVJyO?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 298d957d-f60e-44c6-20cb-08dc36d1c501 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2024 13:49:36.0621 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QNaDfAAwWgB9OpaXsTXVjMOWcODHOPHaQFSZc3oNn6dQ8tZsB+0NvhvP1klOBFA1eyY9e/XD1Z1gYtsX3ybh6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5167 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: VsCpIrdndjYXGEcE01NOiU3Hx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR12MB70310D0A1683C8E3F7D092E6D95A2MW4PR12MB7031namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=UJyrORVz; 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}") --_000_MW4PR12MB70310D0A1683C8E3F7D092E6D95A2MW4PR12MB7031namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi @abner.chang@amd.com, RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not h= ave dependency to RedfishPkg? Do we need to move it to MdeModulePkg for thi= s goal (removing dependency to RedfishPkg)? Regards, Nickle > -----Original Message----- > From: abner.chang@amd.com > Sent: Monday, February 26, 2024 10:44 AM > To: devel@edk2.groups.io > Cc: Nickle Wang ; Igor Kulchytskyy > Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Stru= cture > DXE driver > > External email: Use caution opening links or attachments > > > 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/RedfishPkg/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 NextRestJsonStructureInst= ance; ///< Next > convertor instance > UINTN NumberOfNameSpaceToConver= t; ///< 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/RedfishPkg/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 "RestJsonStructureInte= rnal.h" > > @@ -72,6 +74,8 @@ RestJsonStructureRegister ( > } > } > > + DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to > + register for the name spaces.\n", __func__, NumberOfNS)); > + > Instance =3D > (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof > (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS * sizeof > (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); > if (Instance =3D=3D NULL) { > @@ -88,6 +92,10 @@ RestJsonStructureRegister ( > ThisSupportedInterp =3D JsonStructureSupported; > for (Index =3D 0; Index < NumberOfNS; Index++) { > CopyMem ((VOID *)CloneSupportedInterpId, (VOID *)&ThisSupportedInter= p- > >RestResourceInterp, sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); > + DEBUG ((DEBUG_MANAGEABILITY, " Resource type : %a\n", > ThisSupportedInterp->RestResourceInterp.NameSpace.ResourceTypeName)); > + DEBUG ((DEBUG_MANAGEABILITY, " Major version : %a\n", > ThisSupportedInterp->RestResourceInterp.NameSpace.MajorVersion)); > + DEBUG ((DEBUG_MANAGEABILITY, " Minor version : %a\n", > ThisSupportedInterp->RestResourceInterp.NameSpace.MinorVersion)); > + DEBUG ((DEBUG_MANAGEABILITY, " Errata version: %a\n\n", > + ThisSupportedInterp->RestResourceInterp.NameSpace.ErrataVersion)); > ThisSupportedInterp =3D (EFI_REST_JSON_STRUCTURE_SUPPORTED > *)ThisSupportedInterp->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 capab= ility to > interpret the resource.\n", > + InterpreterInstance->SupportedRsrcIndentifier- > >NameSpace.ResourceTypeName, > + InterpreterInstance->SupportedRsrcIndentifier- > >NameSpace.MajorVersion, > + InterpreterInstance->SupportedRsrcIndentifier- > >NameSpace.MinorVersion, > + InterpreterInstance->SupportedRsrcIndentifier- > >NameSpace.ErrataVersion > + )); > + } else { > + DEBUG ((DEBUG_MANAGEABILITY, "REST JsonToStructure returns failu= re - > %r\n", Status)); > + } > + } > } else { > // > - // Check if the namesapce and version is supported by this interpret= er. > + // Check if the namespace and version is supported by this interpret= er. > // > ThisSupportedRsrcTypeId =3D InterpreterInstance->SupportedRsrcIndent= ifier; > for (Index =3D 0; Index < InterpreterInstance->NumberOfNameSpaceToCo= nvert; > Index++) { @@ -171,6 +195,11 @@ InterpreterInstanceToStruct ( > ResourceRaw, > RestJSonHeader > ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_MANAGEABILITY, "Don't check version of this re= source > 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 resour= ce 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", > 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; > } > } > @@ -416,6 +463,35 @@ RestJsonStructureToStruct ( > return EFI_UNSUPPORTED; > } > > + if (RsrcTypeIdentifier !=3D NULL) { > + DEBUG ((DEBUG_MANAGEABILITY, "%a: Looking for the REST JSON to C > Structure converter:\n", __func__)); > + if (RsrcTypeIdentifier->NameSpace.ResourceTypeName !=3D NULL) { > + DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: %a\n", > RsrcTypeIdentifier->NameSpace.ResourceTypeName)); > + } else { > + DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: NULL")); > + } > + > + if (RsrcTypeIdentifier->NameSpace.MajorVersion !=3D NULL) { > + DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: %a\n", > RsrcTypeIdentifier->NameSpace.MajorVersion)); > + } else { > + DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: NULL")); > + } > + > + if (RsrcTypeIdentifier->NameSpace.MinorVersion !=3D NULL) { > + DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: %a\n", > RsrcTypeIdentifier->NameSpace.MinorVersion)); > + } else { > + DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: NULL")); > + } > + > + if (RsrcTypeIdentifier->NameSpace.ErrataVersion !=3D NULL) { > + DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: %a\n", > RsrcTypeIdentifier->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 > (&mRestJsonStructureList); > while (TRUE) { > @@ -427,10 +503,12 @@ RestJsonStructureToStruct ( > JsonStructure > ); > if (!EFI_ERROR (Status)) { > + DEBUG ((DEBUG_MANAGEABILITY, "%a: REST JSON to C structure is > + interpreted successfully.\n", __func__)); > break; > } > > if (IsNodeAtEnd (&mRestJsonStructureList, &Instance- > >NextRestJsonStructureInstance)) { > + DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter > + found.\n", __func__)); > Status =3D EFI_UNSUPPORTED; > break; > } > @@ -483,6 +561,7 @@ RestJsonStructureDestroyStruct ( > } > > if (IsNodeAtEnd (&mRestJsonStructureList, &Instance- > >NextRestJsonStructureInstance)) { > + DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter > + found.\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 resource 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 > (&mRestJsonStructureList); > while (TRUE) { > @@ -537,6 +624,7 @@ RestJsonStructureToJson ( > } > > if (IsNodeAtEnd (&mRestJsonStructureList, &Instance- > >NextRestJsonStructureInstance)) { > + DEBUG ((DEBUG_ERROR, "%a: No REST C structure to JSON interpreter > + found.\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= the > handle database. > Uninstall all the protocols installed in the driver entry point. > -- > 2.37.1.windows.1 -=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 (#115959): https://edk2.groups.io/g/devel/message/115959 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- --_000_MW4PR12MB70310D0A1683C8E3F7D092E6D95A2MW4PR12MB7031namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi @abner.chang@amd.com,

 

RestJsonStructureDxe is a driver in RedfishPkg. M= ay I know why we can not have dependency to RedfishPkg? Do we need to move = it to MdeModulePkg for this goal (removing dependency to RedfishPkg)?<= /o:p>

 

Regards,

Nickle

 

> -----Original Message-----

> From: abner.chang@amd.com <abner.chang@am= d.com>

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang <nicklew@nvidia.com>; = Igor Kulchytskyy <igork@ami.com>

> Subject: [PATCH] RedfishPkg/RestJsonStructur= eDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or= attachments

>

>

> From: Abner Chang <abne= r.chang@amd.com>

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on= Redfish package and

>   the references of "Redfish&= quot; terminology.

>   Remove the references of "R= edfish" from this driver.

> - Fix the missing parameter of DEBUG macros = used in this

>   driver.

>

> Signed-off-by: Abner Chang <abner.chang@amd.com>

> Cc: Nickle Wang <nicklew= @nvidia.com>

> Cc: Igor Kulchytskyy <igork@a= mi.com>

> ---

>  .../RestJsonStructureDxe.inf &nbs= p;            &= nbsp;   |  3 +-

>  .../RestJsonStructureInternal.h &= nbsp;           &nbs= p; |  3 +-

>  .../RestJsonStructureDxe.c  =             &nb= sp;     | 96 ++++++++++++++++++-

>  3 files changed, 96 insertions(+), 6 d= eletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe= /RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonSt= ructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Stru= cture Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Pac= kard Enterprise Development LP<BR>

> +#  Copyright (C) 2024 Advanced Micro D= evices, Inc. All rights

> +reserved.<BR>

>  #  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/RestJsonSt= ructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureInternal.h

> @@ -3,6 +3,7 @@

>    Protocol.

>

>    (C) Copyright 2020 Hewlett= Packard Enterprise Development LP<BR>

> +  Copyright (C) 2024 Advanced Micro De= vices, Inc. All rights

> + reserved.<BR>

>

>    SPDX-License-Identifier: B= SD-2-Clause-Patent

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_IN= STANCE {

>    LIST_ENTRY  &nbs= p;            &= nbsp;           &nbs= p;       NextRestJsonStructureInstance; ///&l= t; Next

> convertor instance

>    UINTN   &nb= sp;            =             &nb= sp;           NumberOfNam= eSpaceToConvert;    ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFI= ER       *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFI= ER       *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>    EFI_REST_JSON_STRUCTURE_TO= _STRUCTURE         JsonToStructure;=

> ///< JSON to C structure function

>    EFI_REST_JSON_STRUCTURE_TO= _JSON           &nbs= p;  StructureToJson;        &n= bsp;      ///< C

> structure to JSON function

>    EFI_REST_JSON_STRUCTURE_DE= STORY_STRUCTURE    DestroyStructure;

> ///< Destory C struture function.

> diff --git a/RedfishPkg/RestJsonStructureDxe= /RestJsonStructureDxe.c

> b/RedfishPkg/RestJsonStructureDxe/RestJsonSt= ructureDxe.c

> index 404866fb319..0da5132e5ae 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureDxe.c

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJs= onStructureDxe.c

> @@ -4,12 +4,14 @@

>    Protocol.

>

>    (C) Copyright 2020 Hewlett= Packard Enterprise Development LP<BR>

> +  Copyright (C) 2024 Advanced Micro De= vices, Inc. All rights

> + reserved.<BR>

>

>    SPDX-License-Identifier: B= SD-2-Clause-Patent

>

>  **/

>

>  #include <Uefi.h>

> +#include <Library/DebugLib.h>

>  #include <Protocol/RestJsonStructur= e.h>  #include "RestJsonStructureInternal.h"

>

> @@ -72,6 +74,8 @@ RestJsonStructureRegister = (

>      }

>    }

>

> +  DEBUG ((DEBUG_MANAGEABILITY, "%= a: %d REST JSON-C interpreter(s) to

> + register for the name spaces.\n", __f= unc__, NumberOfNS));

> +

>    Instance =3D

>      (REST_JSON_STR= UCTURE_INSTANCE *)AllocateZeroPool (sizeof

> (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS = * sizeof

> (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER));

>    if (Instance =3D=3D NULL) = {

> @@ -88,6 +92,10 @@ RestJsonStructureRegister= (

>    ThisSupportedInterp &= nbsp;  =3D JsonStructureSupported;

>    for (Index =3D 0; Index &l= t; NumberOfNS; Index++) {

>      CopyMem ((VOID= *)CloneSupportedInterpId, (VOID *)&ThisSupportedInterp-

> >RestResourceInterp, sizeof (EFI_REST_JSO= N_RESOURCE_TYPE_IDENTIFIER));

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "  Resource type : %a\n",

> ThisSupportedInterp->RestResourceInterp.N= ameSpace.ResourceTypeName));

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "  Major version : %a\n",

> ThisSupportedInterp->RestResourceInterp.N= ameSpace.MajorVersion));

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "  Minor version : %a\n",

> ThisSupportedInterp->RestResourceInterp.N= ameSpace.MinorVersion));

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "  Errata version: %a\n\n",

> + ThisSupportedInterp->RestResourceInterp= .NameSpace.ErrataVersion));

>      ThisSupportedI= nterp =3D (EFI_REST_JSON_STRUCTURE_SUPPORTED

> *)ThisSupportedInterp->NextSupportedRsrcI= nterp.ForwardLink;

>      CloneSupported= InterpId++;

>    }

> @@ -125,6 +133,8 @@ InterpreterInstanceToStr= uct (

>    EFI_STATUS  &nbs= p;            &= nbsp;           &nbs= p;  Status;

>    EFI_REST_JSON_RESOURCE_TYP= E_IDENTIFIER  *ThisSupportedRsrcTypeId;

>

> +  DEBUG ((DEBUG_MANAGEABILITY, "%= a: Entry\n", __func__));

> +

>    if ((This =3D=3D NULL) ||<= /p>

>        (I= nterpreterInstance =3D=3D NULL) ||

>        (R= esourceRaw =3D=3D NULL) ||

> @@ -146,9 +156,23 @@ InterpreterInstanceToSt= ruct (

>        &n= bsp;            = ;            &n= bsp;    ResourceRaw,

>        &n= bsp;            = ;            &n= bsp;    RestJSonHeader

>        &n= bsp;            = ;            &n= bsp;    );

> +    if (EFI_ERROR (Status)) = {

> +      if (Status = =3D=3D EFI_UNSUPPORTED) {

> +        = DEBUG ((

> +       &= nbsp;  DEBUG_MANAGEABILITY,

> +       &= nbsp;  "%a %a.%a.%a REST JSON to C structure interpreter has no c= apability to

> interpret the resource.\n",

> +       &= nbsp;  InterpreterInstance->SupportedRsrcIndentifier-

> >NameSpace.ResourceTypeName,

> +       &= nbsp;  InterpreterInstance->SupportedRsrcIndentifier-

> >NameSpace.MajorVersion,

> +       &= nbsp;  InterpreterInstance->SupportedRsrcIndentifier-

> >NameSpace.MinorVersion,

> +       &= nbsp;  InterpreterInstance->SupportedRsrcIndentifier-

> >NameSpace.ErrataVersion

> +       &= nbsp;  ));

> +      } else {

> +        = DEBUG ((DEBUG_MANAGEABILITY, "REST JsonToStructure returns failure -

> %r\n", Status));

> +      }

> +    }

>    } else {

>      //

> -    // Check if the namesapc= e and version is supported by this interpreter.

> +    // Check if the namespac= e and version is supported by this interpreter.

>      //

>      ThisSupportedR= srcTypeId =3D InterpreterInstance->SupportedRsrcIndentifier;

>      for (Index =3D= 0; Index < InterpreterInstance->NumberOfNameSpaceToConvert;

> Index++) { @@ -171,6 +195,11 @@ InterpreterI= nstanceToStruct (

>        &n= bsp;            = ;            &n= bsp;          ResourceRaw= ,

>        &n= bsp;            = ;            &n= bsp;          RestJSonHea= der

>        &n= bsp;            = ;            &n= bsp;          );

> +       &= nbsp;  if (EFI_ERROR (Status)) {

> +       &= nbsp;    DEBUG ((DEBUG_MANAGEABILITY, "Don't check vers= ion of this resource

> type identifier JsonToStructure returns %r\n= ", Status));

> +       &= nbsp;    DEBUG ((DEBUG_MANAGEABILITY, "  Supported= ResourceTypeName =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.ResourceTypeName));

> +       &= nbsp;  }

> +

>        &n= bsp;   break;

>        &n= bsp; } else {

>        &n= bsp;   //

> @@ -195,6 +224,14 @@ InterpreterInstanceToSt= ruct (

>        &n= bsp;            = ;            &n= bsp;            = ;ResourceRaw,

>        &n= bsp;            = ;            &n= bsp;            = ;RestJSonHeader

>        &n= bsp;            = ;            &n= bsp;            = ;);

> +       &= nbsp;    if (EFI_ERROR (Status)) {

> +       &= nbsp;      DEBUG ((DEBUG_MANAGEABILITY, "Chec= k version of this resource type

> identifier JsonToStructure returns %r\n"= ;, Status));

> +       &= nbsp;      DEBUG ((DEBUG_MANAGEABILITY, "&nbs= p; Supported ResourceTypeName =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.ResourceTypeName));

> +       &= nbsp;      DEBUG ((DEBUG_MANAGEABILITY, "&nbs= p; Supported MajorVersion     =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.MajorVersion));

> +       &= nbsp;      DEBUG ((DEBUG_MANAGEABILITY, "&nbs= p; Supported MinorVersion     =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.MinorVersion));

> +       &= nbsp;      DEBUG ((DEBUG_MANAGEABILITY, "&nbs= p; Supported ErrataVersion    =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.ErrataVersion));

> +       &= nbsp;    }

> +

>        &n= bsp;     break;

>        &n= bsp;   }

>        &n= bsp; }

> @@ -232,6 +269,8 @@ InterpreterEfiStructToIn= stance (

>    EFI_REST_JSON_RESOURCE_TYP= E_IDENTIFIER  *ThisSupportedRsrcTypeId;

>    EFI_REST_JSON_RESOURCE_TYP= E_IDENTIFIER  *RsrcTypeIdentifier;

>

> +  DEBUG ((DEBUG_MANAGEABILITY, "%= a: Entry\n", __func__));

> +

>    if ((This =3D=3D NULL) ||<= /p>

>        (I= nterpreterInstance =3D=3D NULL) ||

>        (R= estJSonHeader =3D=3D NULL) ||

> @@ -284,6 +323,14 @@ InterpreterEfiStructToI= nstance (

>        &n= bsp;            = ;            &n= bsp;        RestJSonHeader,

>        &n= bsp;            = ;            &n= bsp;        ResourceRaw

>        &n= bsp;            = ;            &n= bsp;        );

> +        = if (EFI_ERROR (Status)) {

> +       &= nbsp;  DEBUG ((DEBUG_MANAGEABILITY, "StructureToJson returns %r\n= ",

> Status));

> +       &= nbsp;  DEBUG ((DEBUG_MANAGEABILITY, "  Supported ResourceTyp= eName =3D

> %a\n", ThisSupportedRsrcTypeId->Name= Space.ResourceTypeName));

> +       &= nbsp;  DEBUG ((DEBUG_MANAGEABILITY, "  Supported MajorVersio= n     =3D %a\n",

> ThisSupportedRsrcTypeId->NameSpace.MajorV= ersion));

> +       &= nbsp;  DEBUG ((DEBUG_MANAGEABILITY, "  Supported MinorVersio= n     =3D %a\n",

> ThisSupportedRsrcTypeId->NameSpace.MinorV= ersion));

> +       &= nbsp;  DEBUG ((DEBUG_MANAGEABILITY, "  Supported ErrataVersi= on    =3D %a\n",

> ThisSupportedRsrcTypeId->NameSpace.Errata= Version));

> +        = }

> +

>        &n= bsp; break;

>        }<= /p>

>      }

> @@ -416,6 +463,35 @@ RestJsonStructureToStru= ct (

>      return EFI_UNS= UPPORTED;

>    }

>

> +  if (RsrcTypeIdentifier !=3D NULL) {<= /p>

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "%a: Looking for the REST JSON to C

> Structure converter:\n", __func__));

> +    if (RsrcTypeIdentifier-&= gt;NameSpace.ResourceTypeName !=3D NULL) {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  ResourceType: %a\n",

> RsrcTypeIdentifier->NameSpace.ResourceTyp= eName));

> +    } else {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  ResourceType: NULL"));

> +    }

> +

> +    if (RsrcTypeIdentifier-&= gt;NameSpace.MajorVersion !=3D NULL) {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  MajorVersion: %a\n",

> RsrcTypeIdentifier->NameSpace.MajorVersio= n));

> +    } else {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  MajorVersion: NULL"));

> +    }

> +

> +    if (RsrcTypeIdentifier-&= gt;NameSpace.MinorVersion !=3D NULL) {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  MinorVersion: %a\n",

> RsrcTypeIdentifier->NameSpace.MinorVersio= n));

> +    } else {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  MinorVersion: NULL"));

> +    }

> +

> +    if (RsrcTypeIdentifier-&= gt;NameSpace.ErrataVersion !=3D NULL) {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  ErrataVersion: %a\n",

> RsrcTypeIdentifier->NameSpace.ErrataVersi= on));

> +    } else {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "  ErrataVersion: NULL"));

> +    }

> +  } else {

> +    DEBUG ((DEBUG_MANAGEABIL= ITY, "%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_ST= RUCTURE_INSTANCE *)GetFirstNode

> (&mRestJsonStructureList);

>    while (TRUE) {

> @@ -427,10 +503,12 @@ RestJsonStructureToStr= uct (

>        &n= bsp;        JsonStructure

>        &n= bsp;        );

>      if (!EFI_ERROR= (Status)) {

> +      DEBUG ((DEBU= G_MANAGEABILITY, "%a: REST JSON to C structure is

> + interpreted successfully.\n", __func_= _));

>        br= eak;

>      }

>

>      if (IsNodeAtEn= d (&mRestJsonStructureList, &Instance-

> >NextRestJsonStructureInstance)) {

> +      DEBUG ((DEBU= G_ERROR, "%a: No REST JSON to C structure interpreter

> + found.\n", __func__));

>        St= atus =3D EFI_UNSUPPORTED;

>        br= eak;

>      }

> @@ -483,6 +561,7 @@ RestJsonStructureDestroy= Struct (

>      }

>

>      if (IsNodeAtEn= d (&mRestJsonStructureList, &Instance-

> >NextRestJsonStructureInstance)) {

> +      DEBUG ((DEBU= G_ERROR, "%a: No REST JSON to C structure interpreter

> + found.\n", __func__));

>        St= atus =3D EFI_UNSUPPORTED;

>        br= eak;

>      }

> @@ -512,8 +591,9 @@ RestJsonStructureToJson = (

>    OUT CHAR8   = ;            &n= bsp;            **Re= sourceRaw

>    )

>  {

> -  EFI_STATUS    &n= bsp;            = ;   Status;

> -  REST_JSON_STRUCTURE_INSTANCE  *= Instance;

> +  EFI_STATUS    &n= bsp;            = ;             S= tatus;

> +  REST_JSON_STRUCTURE_INSTANCE &n= bsp;          *Instance;

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFI= ER  *RsrcTypeIdentifier;

>

>    if ((This =3D=3D NULL) || = (RestJSonHeader =3D=3D NULL) || (ResourceRaw =3D=3D NULL)) {

>      return EFI_INV= ALID_PARAMETER;

> @@ -523,6 +603,13 @@ RestJsonStructureToJson= (

>      return EFI_UNS= UPPORTED;

>    }

>

> +  RsrcTypeIdentifier =3D &RestJSon= Header->JsonRsrcIdentifier;

> +  DEBUG ((DEBUG_MANAGEABILITY, "L= ooking for the REST C Structure to

> + JSON resource converter:\n"));  = DEBUG ((DEBUG_MANAGEABILITY, "

> + ResourceType : %a\n",

> + RsrcTypeIdentifier->NameSpace.ResourceT= ypeName));

> +  DEBUG ((DEBUG_MANAGEABILITY, "&= nbsp; MajorVersion : %a\n",

> + RsrcTypeIdentifier->NameSpace.MajorVers= ion));

> +  DEBUG ((DEBUG_MANAGEABILITY, "&= nbsp; MinorVersion : %a\n",

> + RsrcTypeIdentifier->NameSpace.MinorVers= ion));

> +  DEBUG ((DEBUG_MANAGEABILITY, "&= nbsp; ErrataVersion: %a\n",

> + RsrcTypeIdentifier->NameSpace.ErrataVer= sion));

> +

>    Status   =3D EFI= _SUCCESS;

>    Instance =3D (REST_JSON_ST= RUCTURE_INSTANCE *)GetFirstNode

> (&mRestJsonStructureList);

>    while (TRUE) {

> @@ -537,6 +624,7 @@ RestJsonStructureToJson = (

>      }

>

>      if (IsNodeAtEn= d (&mRestJsonStructureList, &Instance-

> >NextRestJsonStructureInstance)) {

> +      DEBUG ((DEBU= G_ERROR, "%a: No REST C structure to JSON interpreter

> + found.\n", __func__));

>        St= atus =3D EFI_UNSUPPORTED;

>        br= eak;

>      }

> @@ -587,7 +675,7 @@ RestJsonStructureEntryPo= int (  }

>

>  /**

> -  This is the unload handle for Redfis= h discover module.

> +  This is the unload handle for REST J= SON to C structure module.

>

>    Disconnect the driver spec= ified by ImageHandle from all the devices in the

> handle database.

>    Uninstall all the protocol= s installed in the driver entry point.

> --

> 2.37.1.windows.1

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#115959) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MW4PR12MB70310D0A1683C8E3F7D092E6D95A2MW4PR12MB7031namp_--