From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.40]) by mx.groups.io with SMTP id smtpd.web11.38360.1670834470803369410 for ; Mon, 12 Dec 2022 00:41:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=EVenL1K0; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.40, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WO/kaL/bNmQPnVQsimkGLEKE8jBokp4zRUpyvxKriiKKQgi1bx/wNuziblDOhvYO5YXbirI7GXrxBV09XyQLBaw5qeVN3JJsb5gnDDx3YYTfiIt8x6JZz4uiQDyJoHaanPi1L7lmiUzAX5fUrKLUaESb2Sesre5/6EeDMNdhUFxbJtL/tOVSq7Fbm74uoJNt6cWQcZ3lg7YbjjYqVV3R69MOsNh+XnLqYM7b1H+FwjfvH5vuGK5J18IHsi7bI1kZu4gHgKhxOGrtYI0cDIYYm7DyPLqbpYiPfJtYSIbESFhT4nNuUGNzCNxi3K/H3hrR3U0wyqhiyl7p7WVXg1emfQ== 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=dVwuQchlKmf+o6jRNGIh/gFYqWw39+o8QTL1EQmKHw0=; b=kNnCXXUPkqRirrWxuRe+T8mTaozmqbNn1lxR/DQD/1vOWq7sywoDLBxUi5oF4Rof3UrrdHhnPKBIQsAbB3jIB1qA6DujqgiHqosf/nT3AcbSK3IxTCSHH1gS6lSCjni2KCGZ5oR6xFjR+YR04kQHBJfzJqiE1AlXpzNEt/AkVaX54gge4QhHT3wby9BTffVlX0CNVEX2API+OwNehs8ZcM5I8dwh6FJVm/TX/5CyQXZwdzFqik5H6cq+PnrlvNRxhAr5fKZqBnXsyx4cH1Si+3uv6I4oaBni7zAEa/6EBOIyshWFcF52jJEs/wqX6YpUtoYOBvAkrrZfsDpyYHfB9Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dVwuQchlKmf+o6jRNGIh/gFYqWw39+o8QTL1EQmKHw0=; b=EVenL1K0/hnlM0jhUeTFBmG+JtF39iSGWcNFf0Yz0fS97siLarhsYdOtvmA9LM4e8tE+GI60W6SJNqSFK5OkaCbgaSzVO2lOe1S/BF+Jnhf5OpIbz1QJuB5LR8yvCHNcdzrlGUMa+44bqJgdnpH+JWqsW8dWQsCe8l4R2C4Ugtw= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DM6PR12MB4281.namprd12.prod.outlook.com (2603:10b6:5:21e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 08:41:08 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd%3]) with mapi id 15.20.5880.019; Mon, 12 Dec 2022 08:41:07 +0000 From: "Chang, Abner" To: "Simon Wang (SW-GPU)" , "devel@edk2.groups.io" CC: Nickle Wang , Igor Kulchytskyy , Nick Ramirez Subject: Re: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Topic: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Index: AQHZDgTHumKhfX8p102yNE4suhJolq5p7amggAAA61A= Date: Mon, 12 Dec 2022 08:41:07 +0000 Message-ID: References: <20221212083553.6407-1-simowang@nvidia.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-12-12T08:41:06Z; 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_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=4fbc30ea-a025-474a-9702-ff68c2a64011; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|DM6PR12MB4281:EE_ x-ms-office365-filtering-correlation-id: 3ad289da-d541-417e-ab22-08dadc1c9d0a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AMHEQkfxoTc9uUgK6M9BEoisnSrZFIj7m/2UUCeGBTChzsZJCnzAyXtVUIeGERAnBqG1qDh+z3GfK5mFzOnDPGHmHMNZGAE0jCncfvVoV8aGtHRCTVw47tclVAfSikNYwo4yw9AW5nzKDThLRB5lL1swqH8FOBnk3YI2WzD/Z2kENoEuPtz3V3/HXQxdG1U873b4hSRsdooEkzB1KYSI+YSxLDiawqHBg1ZHdzRfogTGBHNMu9HIHXVHSSxl59DbTLhMwf18ddU8nIRw1ckCAoDtdxc1P+T7HVmyzR6R98oqQsCy9JgD4uChnDI0g5gcZtj1wCyZ1WwP6BMQD/z890De/6ZagKJVps6Xyu77z94Jp8YE4QYy9J07GCzhb3PpVF9pUVsTWH5zxbhutaLa1WdNWkXq5tijdi/NKS4JtsqUuRAdkP9GS+6q3u+wZf25HVjTACuH2Unw57UGPm8ArSZnzyXX6k5bSWn1S5uXzZ8RiKJ5TQanHBeMvpDelX2iJH8rKM1yZP2MU6KdMzj0TuuwrSspRbcjypIPyrP5yrFM3Ax9RCtGGuflvZYqq8pAiDjBAv/Oa5XKVErM9WpLdI6VFUUaOZSnXtRJ14HskkD5lOLJUGQLWwrpKUhW89DEVRjEZk+4RSBI8hyHb5oUsFkFLc0sPF6b22AIsooeEjln3iS6Nuv0Km2hEXI860UnupzAWlZYywEh8dp9AQc8QA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(136003)(376002)(366004)(396003)(451199015)(122000001)(2906002)(41300700001)(83380400001)(33656002)(186003)(26005)(478600001)(71200400001)(6506007)(7696005)(9686003)(53546011)(86362001)(30864003)(52536014)(5660300002)(55016003)(66556008)(66476007)(66946007)(8676002)(66446008)(64756008)(76116006)(316002)(4326008)(54906003)(38100700002)(110136005)(38070700005)(8936002)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S2XMEJPvVvZR6Sdw183R2ToTZAzSNqcXWtpDi9zk+uho2lqntUTh9d0mJ49n?= =?us-ascii?Q?EUe0g5zI7y5YA/Er/WLVzb+jm+fsz8d8bfTkPb037XRtHePjxeGYoc+9NR/T?= =?us-ascii?Q?O4qSgNk9iztrJHXMCmxGjG0iSJQTkx5Co1lWiaHAwc65TObvH6DKBk2ECNrM?= =?us-ascii?Q?Zb0slYmFMUy++33Gpvs8HHcSGd6BVGBr/xzl02fR1cst76s0OqSYryMpbhEc?= =?us-ascii?Q?JvyS60m7UiXP39CSWcvwkEPM00WtCyEKYz2BZ1bL0I10CzT6oSo7PqZOLAcR?= =?us-ascii?Q?sC6xlXaV1Ocb3y2rLzEXFxbb7U5YmvbEI9My5zSV6jkKnG5RhqTbqcvihao7?= =?us-ascii?Q?ugX5EbqufWaU++4qYBOQBbaE6Kma1doAXTKikrbaMzQHUbNSPUsfGZjfMfo0?= =?us-ascii?Q?SQsdbmSKbw9ZDRtKO8EFpGvHQWVFpFWMA+4F3Y95C054YjhYp6+nAx4BsxBX?= =?us-ascii?Q?2qi1hGyYgO8iPIjw+3Rk0jewc9e2Cb/I/HcWj9oNmqdylT9yElnrURVW1XHE?= =?us-ascii?Q?G2/Yi5gunXsi91+g5zp+8vLPBi6o0EV23QFQuRhq5c5o9DUHYqvcnt1FUftM?= =?us-ascii?Q?P4jSdrskQvRrJQfccM8mlCkQLEriD1+KsdfoEXSE2PkRNt+0a5wvhHCS5Zle?= =?us-ascii?Q?nHrfR3KWSPDOxc6QAHaQmMDuQwYQzpTGNdwhiBHWGaMM/ysJyGgPj4V0hAJI?= =?us-ascii?Q?4nF3sp5AFId+7NN+zCzdBNo1lsVsnoD18Qbah76cflkIXPEOBP71z9saxlte?= =?us-ascii?Q?WViTnkcJI5ckvSkC4s77YiPvNuLvhf4C95WTPGgKTx4nzvRO5fr0b0GyKolj?= =?us-ascii?Q?dju13MZU8EXLbXC/RasaM5tIC2KqkqMbPoQ2hQe3/dUcemRqTEhAZ9qRugBI?= =?us-ascii?Q?/TboxUYOXat/wEbwFX3XoC6Y/aOSBwjeeOIw6+DgLR1/yNrwi8u7206yZMnk?= =?us-ascii?Q?I5J2Dln8VWiGYBUm+6LX9V/glovLv/jNweaehvedwljPItmMs6uDquPJFJn1?= =?us-ascii?Q?q17VmzOxGOBm8Ybsjw2uFTu9pLPTKHzBXrVjAATQRYGAV3aReDgi3I7vOlGP?= =?us-ascii?Q?O5L5hBHIHsgDdy1StDd4G5b7euqZBSOB3FRvOTjNjgwrliC10Q0TnuGMUp8G?= =?us-ascii?Q?GQNFEDtfrIWlsf0QDByb51juSDaPzPzHKOtAIsyrhxwXVSsF/ZGzb/ch/rFp?= =?us-ascii?Q?f+QHNCnVbeDmW0lfeJN9uWBpODc+cAfW88eXPFJq94Fcy9YElDL3hH5x90+f?= =?us-ascii?Q?zXYkRWDe1k0WbuuMnYM2rQmirWRhwILhJcq1vpCxjw2vfTKZY28tZhgIQ6JD?= =?us-ascii?Q?+Q0gSe/WbtNWggQQt8m8FRXijmkJowYlGEFXCJP6ywBBGDreIaVqux85Efom?= =?us-ascii?Q?KjrshWcnMXJ3CvsIL046D8CkYMSfsJMWw4WgMmTlJtQH5gmef5yndvZos+n/?= =?us-ascii?Q?SPoACudOb666T5r0VJn2xQBCh9EBQrdW7WoW6vhElwD17NlUukvqigoe3M15?= =?us-ascii?Q?rbNbOVIvqecTkdZwty4I/cYXHVwD0/ndlPDJPSF2KKlQJYd3jUNmhFrJRyh4?= =?us-ascii?Q?OVSzW+PH8tCL2+1yW4PWNjAPWLUi5NTmCZrjF8Nc?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ad289da-d541-417e-ab22-08dadc1c9d0a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2022 08:41:07.8263 (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: oDE04vpJFgFTYMLXYrq1y1CKrDmKd9r3ShTZkOSdmCrLvldmhF2gUqbyAUCrdrxvUk8scbKWs9z69iv4ciOotg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4281 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Simon Wang (SW-GPU) > Sent: Monday, December 12, 2022 4:38 PM > To: devel@edk2.groups.io > Cc: Simon Wang (SW-GPU) ; Nickle Wang > ; Chang, Abner ; Igor > Kulchytskyy ; Nick Ramirez > Subject: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add > Redfish.Settings support >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > From: "Simon Wang" >=20 > BIOS feature driver cannot recognize "@Redfish.Settings", decode it and g= et > pending setting URI. So BIOS feature driver can consume pending setting > from correct place. >=20 > Signed-off-by: Simon Wang > Cc: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > RedfishClientPkg/Include/RedfishResourceCommon.h = | 3 + > RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c = | 216 > ++++++++++++-------- >=20 > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > Dxe.c | 3 +- > RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c = | > 3 +- > 4 files changed, 136 insertions(+), 89 deletions(-) >=20 > diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h > b/RedfishClientPkg/Include/RedfishResourceCommon.h > index af4b8091215f..9c001206cbf0 100644 > --- a/RedfishClientPkg/Include/RedfishResourceCommon.h > +++ b/RedfishClientPkg/Include/RedfishResourceCommon.h > @@ -2,6 +2,7 @@ > Redfish feature driver common header file. >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -58,6 +59,8 @@ typedef struct > _REDFISH_RESOURCE_COMMON_PRIVATE { > EFI_STRING RedfishVersion; > } REDFISH_RESOURCE_COMMON_PRIVATE; >=20 > +extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > + > #define > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L(This) \ > BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, > ConfigHandler) >=20 > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > index a478061cdeb6..909c7c0c09bb 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > @@ -2,6 +2,7 @@ > Redfish feature driver implementation - Bios >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -9,15 +10,13 @@ >=20 > #include "../Common/BiosCommon.h" >=20 > -extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > - > EFI_STATUS > HandleResource ( > - IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN EFI_STRING Uri > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN EFI_STRING Uri > ); >=20 > -EFI_HANDLE medfishResourceConfigProtocolHandle; > +EFI_HANDLE medfishResourceConfigProtocolHandle; >=20 > /** > Provising redfish resource by given URI. > @@ -33,16 +32,16 @@ EFI_HANDLE medfishResourceConfigProtocolHandle; > **/ > EFI_STATUS > RedfishResourceProvisioningResource ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri, > - IN BOOLEAN PostMode > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri, > + IN BOOLEAN PostMode > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -60,7 +59,7 @@ RedfishResourceProvisioningResource ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -94,16 +93,22 @@ RedfishResourceProvisioningResource ( **/ > EFI_STATUS RedfishResourceConsumeResource ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > - CHAR8 *Etag; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + REDFISH_RESPONSE *ExpectedResponse; > + REDFISH_RESPONSE RedfishSettingsResponse; > + CHAR8 *Etag; > + UINTN Index; > + EDKII_JSON_VALUE JsonValue; > + EFI_STRING RedfishSettingsUri; > + CONST CHAR8 *RedfishSettingsUriKeys[] =3D > { "@Redfish.Settings", "SettingsObject", "@odata.id" }; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -119,8 +124,38 @@ RedfishResourceConsumeResource ( > return Status; > } >=20 > - Private->Uri =3D Uri; > - Private->Payload =3D Response.Payload; > + ExpectedResponse =3D &Response; > + RedfishSettingsUri =3D NULL; > + JsonValue =3D RedfishJsonInPayload (Response.Payload); > + > + // > + // Seeking RedfishSettings URI link. > + // > + for (Index =3D 0; Index < ARRAY_SIZE (RedfishSettingsUriKeys); Index++= ) { > + if (JsonValue =3D=3D NULL) { > + break; > + } > + > + JsonValue =3D JsonObjectGetValue (JsonValueGetObject (JsonValue), > + RedfishSettingsUriKeys[Index]); } > + > + if (JsonValue !=3D NULL) { > + // > + // Verify RedfishSettings URI link is valid to retrieve resource or = not. > + // > + RedfishSettingsUri =3D JsonValueGetUnicodeString (JsonValue); > + > + Status =3D GetResourceByUri (Private->RedfishService, RedfishSetting= sUri, > &RedfishSettingsResponse); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, @Redfish.Settings exists, get resource > from: %s failed\n", __FUNCTION__, RedfishSettingsUri)); > + } else { > + Uri =3D RedfishSettingsUri; > + ExpectedResponse =3D &RedfishSettingsResponse; > + } > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D ExpectedResponse->Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); @@ -129,8 +164,8 @@ > RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > + Etag =3D NULL; > + Status =3D GetEtagAndLocation (ExpectedResponse, &Etag, NULL); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", > __FUNCTION__)); > } > @@ -153,12 +188,24 @@ RedfishResourceConsumeResource ( > // Release resource > // > if (Private->Payload !=3D NULL) { > - RedfishFreeResponse ( > - Response.StatusCode, > - Response.HeaderCount, > - Response.Headers, > - Response.Payload > - ); > + if (Response.Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + } > + > + if (RedfishSettingsResponse.Payload !=3D NULL) { > + RedfishFreeResponse ( > + RedfishSettingsResponse.StatusCode, > + RedfishSettingsResponse.HeaderCount, > + RedfishSettingsResponse.Headers, > + RedfishSettingsResponse.Payload > + ); > + } > + > Private->Payload =3D NULL; > } >=20 > @@ -185,13 +232,13 @@ RedfishResourceConsumeResource ( **/ > EFI_STATUS RedfishResourceGetInfo ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > OUT REDFISH_SCHEMA_INFO *Info > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > - if (This =3D=3D NULL || Info =3D=3D NULL) { > + if ((This =3D=3D NULL) || (Info =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -217,15 +264,15 @@ RedfishResourceGetInfo ( **/ EFI_STATUS > RedfishResourceUpdate ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -241,7 +288,7 @@ RedfishResourceUpdate ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -286,15 +333,15 @@ RedfishResourceUpdate ( **/ EFI_STATUS > RedfishResourceCheck ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -310,7 +357,7 @@ RedfishResourceCheck ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -354,18 +401,17 @@ RedfishResourceCheck ( > @retval Others Some error happened. >=20 > **/ > - > EFI_STATUS > RedfishResourceIdentify ( > IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -381,7 +427,7 @@ RedfishResourceIdentify ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -392,6 +438,7 @@ RedfishResourceIdentify ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __FUNCTION__, > Uri, Status)); > } > + > // > // Release resource > // > @@ -413,7 +460,7 @@ RedfishResourceIdentify ( > return Status; > } >=20 > -EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig =3D > { > +EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig > =3D { > RedfishResourceProvisioningResource, > RedfishResourceConsumeResource, > RedfishResourceUpdate, > @@ -441,10 +488,10 @@ EFI_STATUS > EFIAPI > RedfishResourceInit ( > IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This, > - IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo > + IN REDFISH_CONFIG_SERVICE_INFORMATION > *RedfishConfigServiceInfo > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); >=20 > @@ -468,10 +515,10 @@ RedfishResourceInit ( EFI_STATUS EFIAPI > RedfishResourceStop ( > - IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This > + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); >=20 > @@ -493,7 +540,7 @@ RedfishResourceStop ( > return EFI_SUCCESS; > } >=20 > -EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D { > +EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D { > RedfishResourceInit, > RedfishResourceStop > }; > @@ -506,10 +553,9 @@ EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL > mRedfishConfigHandler =3D { **/ VOID EFIAPI - > EfiRestJasonStructureProtocolIsReady > - ( > - IN EFI_EVENT Event, > - IN VOID *Context > +EfiRestJasonStructureProtocolIsReady ( > + IN EFI_EVENT Event, > + IN VOID *Context > ) > { > EFI_STATUS Status; > @@ -523,10 +569,10 @@ EfiRestJasonStructureProtocolIsReady > } >=20 > Status =3D gBS->LocateProtocol ( > - &gEfiRestJsonStructureProtocolGuid, > - NULL, > - (VOID **)&mRedfishResourcePrivate->JsonStructProtocol > - ); > + &gEfiRestJsonStructureProtocolGuid, > + NULL, > + (VOID **)&mRedfishResourcePrivate->JsonStructProtocol > + ); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to locate > gEfiRestJsonStructureProtocolGuid: %r\n", __FUNCTION__, Status)); > } > @@ -550,7 +596,7 @@ RedfishResourceUnload ( > ) > { > EFI_STATUS Status; > - EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler; > + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler; >=20 > if (mRedfishResourcePrivate =3D=3D NULL) { > return EFI_NOT_READY; > @@ -564,12 +610,12 @@ RedfishResourceUnload ( > Status =3D gBS->OpenProtocol ( > ImageHandle, > &gEdkIIRedfishConfigHandlerProtocolGuid, > - (VOID **) &ConfigHandler, > + (VOID **)&ConfigHandler, > NULL, > NULL, > EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL > ); > - if (EFI_ERROR (Status) || ConfigHandler =3D=3D NULL) { > + if (EFI_ERROR (Status) || (ConfigHandler =3D=3D NULL)) { > return Status; > } >=20 > @@ -612,10 +658,10 @@ RedfishResourceUnload ( EFI_STATUS EFIAPI > RedfishExternalResourceResourceFeatureCallback ( > - IN EDKII_REDFISH_FEATURE_PROTOCOL *This, > - IN FEATURE_CALLBACK_ACTION FeatureAction, > - IN VOID *Context, > - IN OUT RESOURCE_INFORMATION_EXCHANGE *InformationExchange > + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, > + IN FEATURE_CALLBACK_ACTION FeatureAction, > + IN VOID *Context, > + IN OUT RESOURCE_INFORMATION_EXCHANGE *InformationExchange > ) > { > EFI_STATUS Status; > @@ -647,11 +693,12 @@ RedfishExternalResourceResourceFeatureCallback ( > // > // Create the full URI from Redfish service root. > // > - ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * > sizeof(CHAR16)); > + ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * sizeof > + (CHAR16)); > if (ResourceUri =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for full URI.\n", > __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } > + > StrCatS (ResourceUri, MAX_URI_LENGTH, Private->RedfishVersion); > StrCatS (ResourceUri, MAX_URI_LENGTH, InformationExchange- > >SendInformation.FullUri); >=20 > @@ -681,10 +728,9 @@ RedfishExternalResourceResourceFeatureCallback > ( **/ VOID EFIAPI -EdkIIRedfishFeatureProtocolIsReady > - ( > - IN EFI_EVENT Event, > - IN VOID *Context > +EdkIIRedfishFeatureProtocolIsReady ( > + IN EFI_EVENT Event, > + IN VOID *Context > ) > { > EFI_STATUS Status; > @@ -699,10 +745,10 @@ EdkIIRedfishFeatureProtocolIsReady > } >=20 > Status =3D gBS->LocateProtocol ( > - &gEdkIIRedfishFeatureProtocolGuid, > - NULL, > - (VOID **)&FeatureProtocol > - ); > + &gEdkIIRedfishFeatureProtocolGuid, > + NULL, > + (VOID **)&FeatureProtocol > + ); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to locate > gEdkIIRedfishFeatureProtocolGuid: %r\n", __FUNCTION__, Status)); > gBS->CloseEvent (Event); > @@ -744,8 +790,8 @@ RedfishResourceEntryPoint ( > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > - EFI_STATUS Status; > - VOID *Registration; > + EFI_STATUS Status; > + VOID *Registration; >=20 > if (mRedfishResourcePrivate !=3D NULL) { > return EFI_ALREADY_STARTED; > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > emDxe.c > index c2a638d7c05c..5f8308b2bdeb 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > em > +++ Dxe.c > @@ -2,6 +2,7 @@ > Redfish feature driver implementation - ComputerSystem >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -9,8 +10,6 @@ >=20 > #include "../Common/ComputerSystemCommon.h" >=20 > -extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > - > EFI_HANDLE medfishResourceConfigProtocolHandle; >=20 > /** > diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > index 0a9d344d6fe7..e43828f628fa 100644 > --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > @@ -2,6 +2,7 @@ > Redfish feature driver implementation - Memory >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -9,8 +10,6 @@ >=20 > #include "../Common/MemoryCommon.h" >=20 > -extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > - > EFI_HANDLE medfishResourceConfigProtocolHandle; >=20 > /** > -- > 2.17.1