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 67C7AD8002E for ; Tue, 27 Feb 2024 00:47:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7q7F1cMg08vlZNOJf/vpXhtG507p3IO55KEwvoTeTZI=; 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=1708994858; v=1; b=NjMghEUHmPmhXDSh5jmqcs98zC4RF/Jwp6zjrJPPowKPYV9tkzG/Pe4Vkz07pDKB2Q2UROvE ca7aj/k+CYPLEAjHf1NLpYJsbOTZP+bWkIYen6YjTMmWV9vVfGZfr9EZU+wGCYLZzA2+X7MsDEo SJPhlW3lwrsmdKsQDJdjDcoI= X-Received: by 127.0.0.2 with SMTP id FOhcYY7687511xjAAwtZfcJp; Mon, 26 Feb 2024 16:47:38 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.78]) by mx.groups.io with SMTP id smtpd.web10.1929.1708994857309612581 for ; Mon, 26 Feb 2024 16:47:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AH07B+Gx5v+yLTvhDLohMUjKYEjkNOhfDzWTvByVw5fsbWhGm/xcge/afGNZ6rddezDoVOenNMdU5csJfTiMfLsRfKojidCEnTw5xaaPyrMMJcqWskC4q1ebGyRt3MhrvobPaIFhtOnl7r6dgm3o8R0JcMXHuLQAJ4aA8JrMW6pjgavHCtVbHQ0Pi6+50TZIrDLtYvBnntkKrbQIV5tg4be+ltneQlWPGnHQdeVUSzGPAkmqiP4ot1aO/RnU4c3hlGzT8Vw2ZeD8knQRGNbs39RFzeFkH/J/+fs6Kh1mK74H6MWMtMb9a8h+XjU1ZKpMM6nIlCClQ4UkEf1uWMZr2w== 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=rq3vPoSbN1EjjISn0GXuDjiDRla0BlaQp/pUBowtW9g=; b=LzKO8alau4cZV7WsU5WEeAfCEbsS1xRHtIIa5abwPseZZd7tAjx7q/2mD4Loc/zScHDF8KG/6wyjMT8PPJHD7F2hLTW4y7kEsynwzN1SBwULfYBgHS/a6Zsyd90IIyf9IEOcjKAajWhcgziJCQV6D30qHcnNSAvylt+0SbwB6NNF/5QxhglLBHzNMa1Ex7qtvjK1J8P+HZyATQmzshnTVdNpUABAKmmIK8sl+Of3n2bkzDQ26y48nUw0Ooit3A+2NkquQ5axoBbxEybnKVQBWsHPSxSy3uNVbOq0yTRdjkrT2H+VU7r6YkgsHA+hNDBZ5LOCyzMKtVK6I0huoJSRHg== 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 PH8PR12MB7025.namprd12.prod.outlook.com (2603:10b6:510:1bc::22) by SA3PR12MB9091.namprd12.prod.outlook.com (2603:10b6:806:395::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Tue, 27 Feb 2024 00:47:32 +0000 X-Received: from PH8PR12MB7025.namprd12.prod.outlook.com ([fe80::c817:975f:13b:6679]) by PH8PR12MB7025.namprd12.prod.outlook.com ([fe80::c817:975f:13b:6679%6]) with mapi id 15.20.7316.034; Tue, 27 Feb 2024 00:47:32 +0000 From: "Nickle Wang via groups.io" To: "Chang, Abner" , "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+PIAkCXI27Eco60AgACzaLCAAATYAA== Date: Tue, 27 Feb 2024 00:47:32 +0000 Message-ID: References: <20240226024338.157-1-abner.chang@amd.com> In-Reply-To: Accept-Language: en-US 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: PH8PR12MB7025:EE_|SA3PR12MB9091:EE_ x-ms-office365-filtering-correlation-id: 8ed414e1-d51d-4beb-7821-08dc372daeed x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: ++U/SyEIrK5AY2Dj/mgk94FKY5WgQtCEMtIxCkSy9iB/xpV3ZTXuOeV137B5yZbWSK226Yf/4vkXTMtElQ0fm+4VrietqOrCx9oL5X3Z/AvT6SL/sr9UA9c1LQWKHi6sXFiu5P1qxQ0ppdnbY+Me7prwN7/mjphNL3uMQMDb74x3CIl+XYLbmyRa2FChYZQ9EaAcXvzDpvGqOFO2jrgpe73Rj6UGEaj+D1oaNAAvSYKMjOFBD6MlPhDl7+AKIPsCVSnQhF7TB3UdkXH+cHFTlGHUIzjuNy8455sziMwPUIjDstAp3wy82AEs1iQOmH2dE08WOmaHWur/LLz7nGAiN7r55WIBA3ojL8nmRS1GocbSDcSiX7nkfKbNzV23jVnqlm/Gl+6DlXYv6CjpeRpYMLzfNMcbIzHCnlDXUzIITHsbfq2Eol2WcIAtOkgtiZCA2BpS5+nMWUpSmuohZoiiyJJg9zepE67lmYGrGlV5Px0P8Gbpycc06AnW0tbtfGtSWxYAqtqspU7bzK7TfptNJBA3IZ5mXxrDvleskzD0eUZbyd5guob/aBGIxZZqUS07r6cnN1VBJjv85mJtjlRZ/qbIaut3f8kVaE1nGWvn+YBoZPyMgO7hyDC5zZs40xzbM7dC5W//ROhKfPIdb1wLeAX0KI//C7h8pZeCQYstYkDHftx2m9j3O3m5WsVibNuMM6muXQP+FPuABQLPmd6LEQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fvxZo64jPgIn6e4HDhyQNYp3kQrq/NXA84pvBmtJgaTACC/2PludYSoP9g5A?= =?us-ascii?Q?DrlCA2dXC/QV3MJG8DTAo9fAIR74Mht0c7JdOaSrnjDeZ9Ugr+b5brKSK0Qi?= =?us-ascii?Q?ITfigE/oHJ8mOtX0ZKHzBu2b85RibBI0cK7kY7Sn6xw6g9mkJotINysB2ecq?= =?us-ascii?Q?qpQ0+T1qYd49GtU72da9uw3Rtqy50o+rZb0FJvfsTXL/OCo+4DVuj9KK68t+?= =?us-ascii?Q?qZqK2LWhVzFQteib5zV9SnA4erBQGM31h8rK2djZb8GBp4RNuj3N/7ER2ga2?= =?us-ascii?Q?LrSg5jY8FUHR1L/dBsph3pt1ctTvFCYg08hGgKELn2ELvkjRzdS6GGzRqsHj?= =?us-ascii?Q?5FnyXhqlWe1fHHYnjRXPydYF6c1C2u7Mdilqti8wmNfU9FGcKu+X2s/vAMIW?= =?us-ascii?Q?NVbz2KqQsRIdHhy4BjdaOi/lwKE1MO3ztH9Lx+InvShB9v3y92BgiELMusDs?= =?us-ascii?Q?6B9NEVVHZ4m+dOrK73otKWVxdPjq6UdVqw+RmmAHhXuvJWj6Ip2kuOD3KxNk?= =?us-ascii?Q?0daDbOCE9GAY20bCsFSVlOQCIOTSXRg4OuZYUgiiv+wl7NR9//wd7/XaIlFZ?= =?us-ascii?Q?TIIBLKQmE/xiWzQIEo5ahV5or+JJ9ewxFc4ChAl5759d/no1x2ZMGyJ1ESQl?= =?us-ascii?Q?9kVeDdoQLlO9Fdoi+COiPNvpSQCydqX3DFxPwEgjaKxvh5mwrRe1wwTHL+m6?= =?us-ascii?Q?JduYIKC9XWuSb3lMGmr8dVSb4xnlfm1rSImJNWom+B9s/eanX530EqurHDMy?= =?us-ascii?Q?P19Ltd1D0/F+2jqPdWfn0UFIOEWU0XsmKENimdVuNozLG4XycU76dX3n89oI?= =?us-ascii?Q?TG01CDlxhfCtKQn5o6C5xgCjEHqBTI2tUdPg9cHi6KVAICu/y2c4mkxvZmnz?= =?us-ascii?Q?nMIDPITZXWEQQgvE6+84wpkNB7TmEsXTzXmj0GmZ2D3SbAS22V6CzOElr3MZ?= =?us-ascii?Q?1Z6Gqpm+zHjVY5nwL+htXSHb3tIjwE5NKHWdomqOXw5fHxHydbdJe4+rAkCm?= =?us-ascii?Q?ryRvtp5WMeAMuXznUm7TYzWqamdsHkZ1xgrhtCCz5EvIFlR2H0kNrDkChAz1?= =?us-ascii?Q?jhjYzKYaKnue+MIkeLumOYOWbL/Tf9CJRpQhJ4D+Dj2kOpLiw0pCBG2zC9Jr?= =?us-ascii?Q?obZ0IHY5Chg/wDK7/dqMyACPiuVOjBa2PLa/CZ7zdwLPiX3rzspNLhBwyBfk?= =?us-ascii?Q?moqtMZqb9CPtTYIUVuZ95q27+uhhWgF/PhaGxJ9WgRzimRgMbeVWzyLGf4kt?= =?us-ascii?Q?ny3qfzQnEz5cjFJvJxv4LuLdXaoRMdM0qyHChlczjbuUhVAV9H7Q46Prax+z?= =?us-ascii?Q?LNAUSEYWVEuhx58fh4j8B0+3lwC13XgzaaJkC/9Gm2sQZK5tytTpLpX1/G3s?= =?us-ascii?Q?OXgzk6e43w7/6MWIcSZiXbQQGvaiP1Z8DusvuOG+OKi309AOOTfIGl1+wrQO?= =?us-ascii?Q?aaeeE1iZiL1qhijHtNrqEdbMaV0mT0q3wLo1VO2Zi2qg5jcmszYMenqH8Aoz?= =?us-ascii?Q?C+k8LwyPXu4/KfaRenHVUCqjbuKMD9hF42u4Syrb2R03IMjeO+jrBPQeGFFq?= =?us-ascii?Q?NtNAmYLxjNOF7rd+Kho=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7025.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ed414e1-d51d-4beb-7821-08dc372daeed X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2024 00:47:32.7309 (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: WwK0/ZH0+CCPaMlcLw7yUaeboDmm5i0pWjheUXYLAF75T61iBswaEuUaUf1wAT9NTcfYfwU6A488/z5UgB9ISA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9091 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: 7WufNQAX3MR8BAo7ldEPJQr4x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_PH8PR12MB7025F63795E7C0395A2FA289D9592PH8PR12MB7025namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=NjMghEUH; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_PH8PR12MB7025F63795E7C0395A2FA289D9592PH8PR12MB7025namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 (#115990): https://edk2.groups.io/g/devel/message/115990 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_PH8PR12MB7025F63795E7C0395A2FA289D9592PH8PR12MB7025namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thanks for your explanation, Abner.

 

 

Reviewed-by: Nickle Wang <nicklew@nvidia.com&= gt;

 

Regards,

Nickle

 

From: Chang, Abner <Abner.Chang@amd.com>= ;
Sent: Tuesday, February 27, 2024 8:40 AM
To: Nickle Wang <nicklew@nvidia.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 (#115990) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_PH8PR12MB7025F63795E7C0395A2FA289D9592PH8PR12MB7025namp_--