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 3EC8DAC09C0 for ; Tue, 27 Feb 2024 00:55:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tbKFr9GbpmS+mq5jnsXMoVhSYUN5/1YpMDmsnBL+TTs=; 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:msip_labels: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=1708995330; v=1; b=nVazw+4QdaV8sFQ/ZXntXtwfVM72aSHj+g7iydeDlGsVOL9wuGD8Fly/8zwgNECDs3u1fnQ5 +zZftGWLMrfUNvmCcP9PNZIn4o9VmpnWxLzdEi1H+FsMwfwhYP9YZLw/qXNQyDCqjQLSoGB//n4 7cN6VPLmVHmEtg6nE1PtZItg= X-Received: by 127.0.0.2 with SMTP id 1FmxYY7687511xhgt2ix8Fc6; Mon, 26 Feb 2024 16:55:30 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.2027.1708995329799454713 for ; Mon, 26 Feb 2024 16:55:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TNDZk3Csa9UKPK9YQ/+z2na1WKYII+ebBEOIDiVUgYgCNu1yHHu6VGDvJ99ikfPDaPc72jmCqPh32xRsW4purThTuwcxFK+dy8NDUvZLe1ZGQ4GnRoQkghjEUNUmW8jt5g8n4QrLvK7mDb7md+9pEIPLSsT4JG/odxGfhRVB6BpoWJnzxXHwzsGEGywwaTDYWHeEpHJSzDRGiTB817lBej0sBW/aoQGWAajNY6HP7Sin0bJRNi/28z5AWSGDUSzRCG+hosg7Ryi3cH1g4yqUFfGPPRXVL31Z1JCWPHesBimV1wJUy3RpV8AQGLFjbqf/OyMN3rRFD0VX7iCGL/bzqw== 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=lQFRxmrYtkmORG/xs2ZHfsKPUV1LzjVv2dAaQJ/pkTM=; b=LXvLLo0wMzRdLv5vCcVHJrXSbBhLW69PAUCS1NiAZKiqDOhZXh6Hi17eEgRXVSKwrRHObTj8IgZOrdyknLSANWjmjI+jzVeDCcVwtP3yLFxHX0jMl1ihYUnDfOfWlii7I4eZZi8Vu3BLzsf8rJAM69Zb/WU7F0+nniWRJeDH3RiH4FnAWiL5rD2ZgPHsPdBl/ViBVx6sDCGLCNRLULuVWpasHRcC0qT0ufHMW3WRIG7oyKUOBXF39bHSExus3goACut9cam/FpNqYuvVz2x5fTZCJZYZIiFU/lvtawHYKfjllaMzkrjInT8J+i+02HYLIQd3EFyMax8c14yTL0jR2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by DS7PR12MB6095.namprd12.prod.outlook.com (2603:10b6:8:9c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.33; Tue, 27 Feb 2024 00:55:25 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::7654:cffb:1938:3995]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::7654:cffb:1938:3995%4]) with mapi id 15.20.7316.032; Tue, 27 Feb 2024 00:55:25 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "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+PIAkCXI27Eco60AgACzaLCAAATYAIAAAlQA Date: Tue, 27 Feb 2024 00:55:25 +0000 Message-ID: References: <20240226024338.157-1-abner.chang@amd.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=3715e41b-8b7e-45fe-9dd3-f4e0bf6241a2;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-02-27T00:28:38Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|DS7PR12MB6095:EE_ x-ms-office365-filtering-correlation-id: dffb0ceb-f34b-4d04-4c17-08dc372ec8c6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: ge6kso2pNH0dLAjRoTfcq8FZZPqKeJodLq8D3p9t/ElUxnHkL1Kpp+SY3scOyrk1HhHm9lkeA6ovNtgPTFEFWkDo/k6irfK2LS4p/I7fo8isBkuv/XhLYsGRfFeLnZ01Kg0TLfbJw9QU566K0PhUw6RkadrTcNG/9+Q4Hvb/Ve6l2qAH1SlZV3PngWoEVLNto0oyJKGE3mLF+Ny/+7MCuwhJwuLb9C7D+hCxkhW41x4ZgNWLjgwikZZKhgPvFBf6KbD1DR1KP8Odp9oiIIa33KFAPPcyrFm8/lWikdWLs6jCCH0GQIor1bG/uD7axGSU2+qmTd8JqiWpgQqjoTa+5LCFlnJ9qdZWj11fFtsaocKVxIOxOBPPTAdMpBZNUnDkKSoRGZtgcpZywY+67/Z9s2mChQw3Jsh4Pduj2OSwlUtBX5871HsGRnbPoF/NPO7r+qhqVUHJB6Xp0QJtGA80oqvRnyu+iuNMWCeXZvPjsWeg8e3D6VhskWUqepgHSNO3LeD7tsaoWUQ/hhqSMOpy1PcDtFWg9UKBJCGLbMAlOTziSvzQQEWxO1YbeG+lCJk21hvi6OYRgoWXf65EUMp1or/HpxlBPJiZXLVCYqnnkRNFra3UM5aD3V7MSGFHLGXJQucMh7yngur5S3ckbSN83CiFMXFvCjuGrZt/B8B+QT9DgTOsglv+u3jiiAp/sqF9PUI82oMPfcojZ5IqxQ7ToA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DMuN9VCg/m5IsT7kjchMOB6n8Ub0SAAsOTHb72eekKp0/Lbz2Fwxf5eLiytE?= =?us-ascii?Q?jWOMKAsPUD1H9sfp8ij+hoPh4oEcGXs+aF4mqFWfnj6UbH3aqUXUfJQKOO3b?= =?us-ascii?Q?Z/EbSK19j/H0W/yKL8Ky2u75ExHnOfgJhuKRj3bHnHELuaa3eU1jhtvaxDJN?= =?us-ascii?Q?oHAofPEG+zM0ipe8rFXPx2j/bsJvnHABDukQ4S0b68I2eXX7sFBNDb1hPh0c?= =?us-ascii?Q?z9heGsru0Q4K/QC2nhANmX2O6JTh2b0mpfDZ97Z0O/K65weGHOghNiCD7KOl?= =?us-ascii?Q?g2Q8X0N3GXjLTa5P52/ZohIBbyv/FyUEBOp5UjPM7lwm5WNsZ0SPtXMPZnPk?= =?us-ascii?Q?dRW7uPt7Hlh1yxXOOye84pu+uCT5gZtTAfNYzjAAChcpmzgNl8/aIa2CFLm0?= =?us-ascii?Q?lXAV8soUMwQONAQ/eRbuSVWaIrGQrsH91N2rVWmDeK+w9GwaF/BVyOTK4C6B?= =?us-ascii?Q?ZmL/YiuANNVCNdQtk5Y4Y5TZ5JjK2WQdnctQmwrFo88j3ehTtIanuGa9rsCw?= =?us-ascii?Q?QvyFZaaD7DbOI3BAT8Tkdo7EnpkZhnyWqh8cQ9qVmY9Z+VQwqbzVWTSrOP5H?= =?us-ascii?Q?WQcDt21nchQo9UMOzWrqDCJ4uXFhybwN6onM+/tJTpDv2di5d6BgQwCjfv1V?= =?us-ascii?Q?2tdIFeaOyoo7CnF8J94HstpI4ToBHnrW2nwiNLKuVE4uFfDoZvuSBkP4rIx+?= =?us-ascii?Q?S6CdFSgjHAkai9tpnIgNfmrv8Ope6CxY1BvJ424uTUhfR9R1LHlInE5dl8kC?= =?us-ascii?Q?2BMHmk0NW14+AlnioP8QnTk8YraMbTe0EX/EBOBL5Qju+KCjtE0zlp1lVoCP?= =?us-ascii?Q?hAeR004uQYT+tDtBDx3SQq8j42AfN6vSqR6P8K6XAePLAqq7rJvmFm57bUVQ?= =?us-ascii?Q?hYtXFQKO2AOdx93cDJHRGz7aZXuGNwRK/ItV5vAd4mHF5IovSGIbiGzOy7J6?= =?us-ascii?Q?lnPXueG2NPLfnFkoKLUj4pVhlZ0L8Pq0TaAVKUK58A01eTUuJuYhGVB/AwRc?= =?us-ascii?Q?RvEOfa+W9kWKWpBaEUO4FECKVmvcR3TZoXuc+r29ou3lU3cFU6wP1e2Fx2Zy?= =?us-ascii?Q?xwInlSx/2qmBjQ4fyukxN2VVVm7qdHvX+MpCPRjBo9To7DDTlufO4+n6pNEw?= =?us-ascii?Q?mdNt0BOliNT7hW+Ehk31HcvbfYqKWLlDUM8Eq1rv+JL339Ls5BUBdifyxvFu?= =?us-ascii?Q?CQjoov0Sfx95m0kNt3aelNrFvV8Yuu1GSIKFWQivorNpAnEo1ohui3k+DC5y?= =?us-ascii?Q?bjk3Ilo/E/OY+JCQNvBhGQ9LNqYhMSr9MBhoDnQTRmF3eQxpzxhHn+b910nD?= =?us-ascii?Q?UDsqYNliKG+QFLMY+XIQLaQUwcXJbjMGC4rqqK+b3XXJK7RZt71Sd3Nzopdv?= =?us-ascii?Q?2oQiSPbg+pNrZ9PScdEbgvb6A2s9x2DrnItamhAYVB4vEqJ4I0KVMxybp2fO?= =?us-ascii?Q?GNW+gf+N4yanmw2qViEgcGP3x1QdmL1xcHG9/dUgXg4EPoANELg00PTmzdqO?= =?us-ascii?Q?mpU5f8ya1PtIbg+By7TisJOk8r1LMWFLwxjfGfYs9RR0NEluMUKJuU/ni1Vx?= =?us-ascii?Q?1qOva0GncQ2EpXwwhpA=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dffb0ceb-f34b-4d04-4c17-08dc372ec8c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2024 00:55:25.5782 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Er4donWw0EXXWD7Lh8k1vUGHqylAwnPB7d78h2fANaq7jMzTbQtxbBJOAwzE1EYLyzFdP/GbqQ8/UO7YPvs6jQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6095 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 6t4WjJqSmWDeWENCqrRyhb2px7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_LV8PR12MB9452394AF6CD2E6EA478FDD8EA592LV8PR12MB9452namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nVazw+4Q; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 --_000_LV8PR12MB9452394AF6CD2E6EA478FDD8EA592LV8PR12MB9452namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] But thanks for this question. I update commit message and more some more ex= planations as below, Remove the references of "Redfish" from this driver. As REST JSON C Structure was not designed for Redfish only. Any RESTful applications can register the converter and provide JSON-C structure conversions through EFI_REST_JSON_STRUCTURE_PROTOCOL. Therefore this driver shouldn't have a dependency on Redfish package and the references of "Redfish" terminology. Thanks Abner From: Nickle Wang Sent: Tuesday, February 27, 2024 8:48 AM To: Chang, Abner ; devel@edk2.groups.io Cc: Igor Kulchytskyy Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C St= ructure DXE driver [AMD Official Use Only - General] Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Thanks for your explanation, Abner. Reviewed-by: Nickle Wang > Regards, Nickle From: Chang, Abner > Sent: Tuesday, February 27, 2024 8:40 AM To: Nickle Wang >; devel@edk2= .groups.io Cc: Igor Kulchytskyy > Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C St= ructure DXE driver External email: Use caution opening links or attachments [AMD Official Use Only - General] Hi Nickle, As from spec viewpoint, REST JSON C Structure was not designed for Redfish = only. Which was designed for any RESTful application that uses JSON as the = representation of data model. I was proposed having this driver under MdeModulePkg long time ago when thi= s driver was introduced, but as I can remember they considered this driver = is only used by Redfish back to the moment. That's true, however this drive= r doesn't require any reference of Redfish actually. Thanks Abner From: Nickle Wang > Sent: Monday, February 26, 2024 9:50 PM To: Chang, Abner >; devel@e= dk2.groups.io Cc: Igor Kulchytskyy > Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C St= ructure DXE driver Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. 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 Kul= chytskyy > > 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 (#115993): https://edk2.groups.io/g/devel/message/115993 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_LV8PR12MB9452394AF6CD2E6EA478FDD8EA592LV8PR12MB9452namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - General]


But thanks for this question. I update commit messag= e and more some more explanations as below,

 

  Remove the ref= erences of "Redfish" fr= om this driver.

  As REST JSON C Structure was not designed= for Redfish only.

  Any RESTful applications can register= the converter and

  provide JSON-C structure conversions thro= ugh

  EFI_REST_JSON_STRUCTURE_PROTOCOL. Therefore this driver=

  shouldn't have a de= pendency on Redfish package and the

  references of "Redfish" terminology.

 

Thanks

Abner

From: Nickle Wang <nicklew@nvidia.com> =
Sent: Tuesday, February 27, 2024 8:48 AM
To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io Cc: Igor Kulchytskyy <igork@ami.com>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JS= ON C Structure DXE driver

 

[AMD Official Use Only - General]<= /o:p>

 

Caution: This message originated from an External Source. Use proper caution= when opening attachments, clicking links, or responding.

 

Thanks for your explanation, Abner.

 

 

Reviewed-by: Nickle Wang <nicklew@nvidia.com>

 

Regards,

Nickle

 

From: Chang, Abner <Abner.Chang@amd.com>
Sent: Tuesday, February 27, 2024 8:40 AM
To: Nickle Wang <nicklew@nv= idia.com>; devel@edk2.groups.io
Cc: Igor Kulchytskyy <igork@ami.= com>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JS= ON C Structure DXE driver

 

External email: Use caution opening l= inks or attachments

 

[AMD Official Use Only - General]<= /o:p>

 

Hi Nickle,

As from spec viewpoint, REST JSON C Structure was no= t designed for Redfish only. Which was designed for any RESTful application= that uses JSON as the representation of data model.

I was proposed having this driver under MdeModulePkg= long time ago when this driver was introduced, but as I can remember they = considered this driver is only used by Redfish back to the moment. ThatR= 17;s true, however this driver doesn’t require any reference of Redfish actually.

 

Thanks

Abner

 

 

From: Nickle Wang <nicklew@nvidia.com>
Sent: Monday, February 26, 2024 9:50 PM
To: Chang, Abner <Abner.Ch= ang@amd.com>; devel@edk2.groups.io
Cc: Igor Kulchytskyy <igork@ami.= com>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JS= ON C Structure DXE driver

 

Caution: This message originated from an External Source. Use proper caution= when opening attachments, clicking links, or responding.

 

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.c= hang@amd.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<= /o:p>

> 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) ||<= o: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",<= /p>

> +       &= 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 {

>      //<= /p>

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

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

>      //<= /p>

>      ThisSupportedR= srcTypeId =3D InterpreterInstance->SupportedRsrcIndentifier;<= /p>

>      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) ||<= o: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<= /p>

>        &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;

>        }<= o:p>

>      }

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

>      return EFI_UNS= UPPORTED;

>    }

>

> +  if (RsrcTypeIdentifier !=3D NULL) {<= o: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) {<= /p>

> @@ -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;<= /o:p>

> +  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) {<= /p>

> @@ -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 (#115993) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_LV8PR12MB9452394AF6CD2E6EA478FDD8EA592LV8PR12MB9452namp_--