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 09A76940698 for ; Tue, 27 Feb 2024 00:39:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=u3SA9htWdvUTVahgGMHjsHsdG8AYr6vUVntBg/Mws4o=; 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=1708994380; v=1; b=bWnqzgknNQy6A1Y9oQcXEadBJ7rePMVzOFaU2/BmzQZ7EjWai7lZp4OP2QUZ2oV6uIQbRxuh 7aauxZRdsyZQHd+mDMwBpmvyBtus91fG2vfXA8if9ouk4cbyMxrkNdtKuwdkrdGo6k8CBAzBRw6 49tCRsq2gBjb2hLAz7H4L/Qg= X-Received: by 127.0.0.2 with SMTP id ymPUYY7687511xXfn8bloaiV; Mon, 26 Feb 2024 16:39:40 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.73]) by mx.groups.io with SMTP id smtpd.web11.1675.1708994379690890810 for ; Mon, 26 Feb 2024 16:39:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UyzJVL0T5UNKQVLRRAQGO91SXQtYpoeZcoimto/iSFoLlFyb/q3lJMnkZiSZfqtFDH1sozKcze2wdKfdhAg95+BmMUA1d+WrZhe0xCiVLJoJN+zqqow+v07TcFYsDRO2d6bc4VE127LyGvWjLqsgNsoxCtiyFFQ68a947g+DojctiCy5Keqc8J9VYMNBpgXazqW/XZziL2l9Tps/X2drdu7NGda47CjiRaOoZf0oLkZu4OnaCUZOHfOZbiMkW++J3fHNh2UmWPiwjklI+Cib6WCcsYPsN9h0tbRJ5r+3904/tUIiQcQgoq0Zc54/JQgLGj14DT/BTHstQopHhO7meA== 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=p084IvveoN2knqiVbKu27xJXYvmAp8Zlg3FPiS0wIr0=; b=mBgvYvZvlqu/oIYfIv4xRj/gcgpKddeSkTR8PxLAZhlHmWSYIfk+H7piwtfjajrOO+JRm+3gjCLl2OXib1RSjTvf0Sn5FXryAwJWss50r/ombu7bjlbMRkQ+jCPt4o2FOgKXGpLIijsCZW/b5Gc4IqJe/fGoQhvC/T+9AAyeeKrFU2XmR4T+T+JAsOEt6jbsOxugwuQXvUQhX+tBakqyenDYWqMcYL0dfYeCA+LDVtAKoXKOSxh74cL9Hj13SUUShobvomAPW1JMqX0TY8FW28r/T0aru5PZrGrSzA50qI2xs3LJTVoROJA4WcTjLIT6cFa9jnRu9fh6VtskrBWXpw== 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 DM6PR12MB4122.namprd12.prod.outlook.com (2603:10b6:5:214::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Tue, 27 Feb 2024 00:39:37 +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:39:37 +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+PIAkCXI27Eco60AgACzaLA= Date: Tue, 27 Feb 2024 00:39:37 +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_|DM6PR12MB4122:EE_ x-ms-office365-filtering-correlation-id: 6faf8176-480f-498b-0933-08dc372c9385 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: JAKpn9EbuNeeyMps9DxzU3MjdYCUq9jrMtVgf19h7eXDILtiALb6XiphGpGW2OKVQC9FfuhYrBqZhUMcgjOqusgm3R+lOy9PKPq7rycSg+6B9G2jBC8tIsyBpqcSKaH3HRbevDRaw6n46ipNfLseBWI1dDIsEcmTahCte3b7LSQlSQ3D1WadE2RxpcbrEAsh/OfRO956DBzQ+3b9BC9aiA2U7cywkQhU+caUo5STMghQuSJsKaT7JvCF7BZih2rAfSjMhsniK6u+jxcDA+Xrf9qsMiEXbmKVjgF4VmZUOvliudqVPpGOa67kSx8xv8nCL7emCVguMp5+DxXX5eqJK6q3NcZazeaUNGXpPaV1CFILvE9Hmnj8uDBZzryaojd0vxbNZcdWwFR2eMYX0/rBKzRoDZ4bcQecz+Ans1c6Ia8eH6nxPAvha9uYGNifuRL0/LwrsYq2RBaCHdMe7ZJmL/cfGekJefsmDogXL9Ct5AdSm7e9x5uCnEIi2XH2/GCgn0/StxF10PBgsWpzTC9oy7w8qo5bjyfgN0+GFnjy49sTrKG81kefn6InLTgFZPSk5w8iRnQBJAlo/yspqaPN+XV1RxKZ+Zd8F4iO6azxvI7o6fK5Pdmw/rCa0KsCr455jriTq7L/zMPW9x5V5h7CDu1LHRZ2yra/zlWuQw3pJU3nWXbu558VgORSuXJsoZ1MpBWtnbCHcQKcyjtLrugcPA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tOM8egqEg7Nk2fXg79qTHB4Z6kQeNXUSVD2/5WDlOe16+TQEF0xkdvB5AQNv?= =?us-ascii?Q?YlvxT0ZSwHONTr/gCUmqOPT/Qu1Iup5kWcISz8hf4jdOLWovBLdUB28b4o8Z?= =?us-ascii?Q?7vP/CM/Kpwd2/v81t1S2KVO7xkjIJIyk8h0KFuxdqZ9tYXzqofn9s2oyO3A+?= =?us-ascii?Q?MwI/dTWV+QVkwAdJKS3XDVaCZlvWdLOF7OqbyOXvc1HT5b9b0nhYw7A0eXrg?= =?us-ascii?Q?JAOTakkj1BhlyySmDE1sN/w0NSn2UpZih4Joaq7DYiQaG27j2YZuqjOnD/zx?= =?us-ascii?Q?bKryfdtJkYVrjMq3Omks8UiDsmUH2+AQDkFtA4W2b8lJWNAuCICaCI/lDnCo?= =?us-ascii?Q?iPHgi26VADWMhHzRGenZYCiSDUnpcG+t9/le+WT0G31m5WgV9oGfKyKeSzTt?= =?us-ascii?Q?/uIW/wAWOor25gawaRX3KHh2B/P56GeKPH9Y2HZRbBHUKWKRldtQ0LRN+yJv?= =?us-ascii?Q?nZli3nbTOewVRQpOcvnmgPrix0VqVGfQBbFH4hagV2vWorOaKyogwJt+FpFy?= =?us-ascii?Q?phKjLT3nvTAjC8B22XFNwlo829u7Sropd5ZiDD3ckVscfEO3NZl0W0WKEl52?= =?us-ascii?Q?Lvk2kga8DTaHW23Zo4GVbvZROaUzxUi9UPu9dtfNf7+e8prIIshXFyOYdmT1?= =?us-ascii?Q?aTqSioEJshyXcHMK0dccHUHcKMx3XTUl9SGd81AG5tnuGSU3NMSPQnQDABR/?= =?us-ascii?Q?VBYKE/tUqgk+YbzPAPj0GMrPtxbE5yKjG6A5oF6a89aDwFpcQeSEtw0rETfN?= =?us-ascii?Q?Ck5b0x3sv55p4XNZ8KkBzfutze5HuDZw6msMZzEqStZ5Or5gwBvj+IQhbL1u?= =?us-ascii?Q?neCsNr2Kuof8phVSNMVbLxi13hTdh4jDemIeCtOiDqaNJXB44XlpNynPOXuI?= =?us-ascii?Q?Nz/Lp/CYWI6bNXyhSDPjeEaF7g0jflVkz0Q0RJsPh0th86dqLU43zQTrryi5?= =?us-ascii?Q?JYaiU45obk6bH9izUWvVj4UoarnQrTWFIFOWT7ysb/4Z/YBhN3gBrP+IVjN7?= =?us-ascii?Q?Vu7ZbSdVoXO1RySSRTGka/HV/+zZxm7Lye2qPAlGm4JA3CaMdbJMWuZvxCtf?= =?us-ascii?Q?bTcG18iif2XiAWN0wV0+TPk9rLgiEPGM5OODX8aJNG92xgR+P3nrpr/HodhR?= =?us-ascii?Q?fiL5e0S3byD8QelVFIqZlYqU+9I3FANjunq4ovpj0loIwzHkL5AgBX55FHtN?= =?us-ascii?Q?sAF6nW3JfoqErmxa1kMV8edYDL6QC1K3ZEV7RihKvMXG3YKzjWAjVnM6jMMj?= =?us-ascii?Q?A0dMEfOVJ2f2Jwwg9bYZOlW9q5g08e0WMZ4fEAnGrTizGvbdTWbhAtgwb0AI?= =?us-ascii?Q?lrDb92rGuhre7ikf1rgebOU8HOlEMADdq3he7v87z+CXsXIign/gSthbfzqO?= =?us-ascii?Q?p9bfwkY4b/WxSynQfsmhLh0lEWpppgAlXZ30zlHsSgMK8RyZlDJhcvGQJS9Q?= =?us-ascii?Q?2zkQzIHi0TqfRAqj37uRrU3cxEBKo8fGuMEvkMX96i7ImaCk/GL2mKpUk0hX?= =?us-ascii?Q?G4xnyxEGSCYi9gu09NPjgwESI4gdv9lROPhXwmFfeKg+csKEDUYML/sstl5f?= =?us-ascii?Q?1wGkpxCDnyc6bPMbnbQ=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: 6faf8176-480f-498b-0933-08dc372c9385 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2024 00:39:37.2554 (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: 4nOreXB9JUfqtP43cEoSLj5CIshkV5w8QjQpjucJG45HTCqRmepEZDZZc/ZpToaKZQiVTKsSHuX7edFb+5i+DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4122 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: Xr4dTWYhPcybLBty7nbpXKOHx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_LV8PR12MB945267C2823260211FEA55EFEA592LV8PR12MB9452namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=bWnqzgkn; 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_LV8PR12MB945267C2823260211FEA55EFEA592LV8PR12MB9452namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [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@edk2.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 (#115982): https://edk2.groups.io/g/devel/message/115982 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_LV8PR12MB945267C2823260211FEA55EFEA592LV8PR12MB9452namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - General]


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.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

 

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

_._,_._,_
--_000_LV8PR12MB945267C2823260211FEA55EFEA592LV8PR12MB9452namp_--