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.73]) by mx.groups.io with SMTP id smtpd.web10.38361.1670834264922605099 for ; Mon, 12 Dec 2022 00:37:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=ltdQGtGC; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.243.73, mailfrom: simowang@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYqvs2DYjkJv3RPWcu8r7+PH6u7lo8e2IkxrhFRpeYu020kbWI4d5k8NZg26OKGR/EzULtdR9s+id7WB2VfE96L/ErBw3ZyweGuzv5EtUGvWSUY9fePcCH841wRr2ZN2ZEqbeTNmSshH3+U4abAtAVSvjoDqJZQcp3iT8qre4MEB1mJeTZfNwv3YpbWk3PcPU4C0jKBbrd7hsbtLCFZ6WsWftf3svL73OXybmIio2ScIy003sZYv5UGZMBx9acNflK6iIkhvMhOo7Ryf5aulAPizhYdBo0N2EebhOtpGGScmuH+Wdm6GoxtaRYIPAM6Guo1VZ0Kh58MTScBUH5+1ag== 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=/a6/Hts2zr2Wu62GSgT7a+KkAy2jm50BWGP3bfKk4uo=; b=YsomldSHQEuhk1S8hY/QLdFwCd5zivKCe+xorgBT5BdIq1D494CrPVBIoEBAkbjrLMmBF72C5B3jFVtiIBaPlG4DRqCsoMR8KMHPLBCCQBxI5hiAAIKb4cG6A2O/q4d/vxgP229/JlXbjLEoLwga8TlN1pfYgGXS9j3NCYmU58SX8YZz0dOWYMGBwRwwBVnGKjKTBxKbpiybRLCXJU5HeOUk3AgDuFdWMMSuAgFArEC04q/omFOv8kzs3Qvmap33eItDNTXSewtWOqyI8EpbKTKXHZgb0FK3aqREKxzYg93b+SQir2Qvc5QSOIk/Swlm1IN6YfMDu1YweWE6j2fDvA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/a6/Hts2zr2Wu62GSgT7a+KkAy2jm50BWGP3bfKk4uo=; b=ltdQGtGCqrooUPpY0g/YLTnfBeBb6gKeWnsJxDhRsXyNn8fEQwanegAIDfsRI7pcDb2Nf8l4ZWD6DqJyF1kxbDua5NUTw78w/HDOO2mCDnw3D6HgewUJDxgcXgJya9j2Y9ZIuaAtDz71m6NtUxntj0QUJXVTOxXAqc8Cdagn0mLH4nzCYOWcaglg9DfWVFUj1fVz0dcqwv2J8KFn325mPJV613MO0oIay1PH17cBXQTZF8UgWBQuuPJLvHnVH7AfMxMTUYHsbFWbu/Yw3TRWR7H8kJLPg7LXl5v72f0Ri/pU6GQvG9mIqYlXQe/TN5ETRrl5t3rBYtu+DcHKK4butw== Received: from DS0PR12MB6583.namprd12.prod.outlook.com (2603:10b6:8:d1::12) by BN9PR12MB5164.namprd12.prod.outlook.com (2603:10b6:408:11d::8) 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:37:42 +0000 Received: from DS0PR12MB6583.namprd12.prod.outlook.com ([fe80::6aee:c2b3:2eb1:7c7b]) by DS0PR12MB6583.namprd12.prod.outlook.com ([fe80::6aee:c2b3:2eb1:7c7b%6]) with mapi id 15.20.5880.019; Mon, 12 Dec 2022 08:37:42 +0000 From: "Simon Wang (SW-GPU)" To: "devel@edk2.groups.io" CC: "Simon Wang (SW-GPU)" , Nickle Wang , Abner Chang , Igor Kulchytskyy , Nick Ramirez Subject: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Topic: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Index: AQHZDgTHumKhfX8p102yNE4suhJolq5p7amg Date: Mon, 12 Dec 2022 08:37:41 +0000 Message-ID: References: <20221212083553.6407-1-simowang@nvidia.com> In-Reply-To: <20221212083553.6407-1-simowang@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS0PR12MB6583:EE_|BN9PR12MB5164:EE_ x-ms-office365-filtering-correlation-id: 10c8785c-cff6-4b5d-29ae-08dadc1c225e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ArkzgK0XVBVAmCeARIBzA1bw87eKZJqQCSXLsKKJ2inCfepd/CF2D4inKStiXZyutia4sYPxA3HUoI5wZ5KQLjXJCuKV1K+iZpqOPW+Ki2V1qv8L+GYXEhffSvE/4nJ3WGQpciAqWRguQW+l6L55JdXdIt1L0+EyvP4fqFhw/b4zk+XG+ZZk8b5I/LrTBdQfCxKd1rDaLEI8y9UQy899IXrihcNFrRDu6N53Zm8PYXTUgIP3kfFKPt6U6cTG7u/Kcec0ZxQ1swhul+YuDXLuqybopA6ocSalWqy8lYhmF168sNteCmHtTNNaLO3uCdt8wFXY7mka8GqzvlZ7hxsOGVGp2kB0e6nxYKxkFKWVs4bcWV4UrcWQQlRa5RCNgF82xyPaaulmztGKIgVog9n9NAEuoyknAmAXdHSbAzBvyScZWwTslk6WWK//R7DbBlMYg6teDGxnS0OwaKYqJmLFtx2J43h92VfqpZrsGRo29eoKx3PVg9D0fwp5tkxzMcLpck90yRPjDWVfE3M1hZsUN9Jr1y3Q3Fd4zjZbeCZoN2aK5MQWu3e9U9y36tAP3MktMjEdwGBnSbDTeUFPH25dulPqFpEMiAl9Oj+y74ywKZ6+aqdFJcY2gYsZE8Rov7mImF0DOCmxMOwvNVxXmiuTtEIHqYm8rCcOJKcg39x+Kgj2UMy0NtLnB+fbf6gCBttdWkR6HdG5aOoRNhjF995fyg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB6583.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(346002)(39860400002)(366004)(396003)(451199015)(71200400001)(478600001)(55236004)(107886003)(33656002)(2906002)(6506007)(86362001)(7696005)(52536014)(8936002)(26005)(9686003)(186003)(38070700005)(55016003)(38100700002)(5660300002)(83380400001)(4326008)(41300700001)(30864003)(122000001)(54906003)(66446008)(66946007)(64756008)(8676002)(66476007)(66556008)(6916009)(76116006)(316002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nhQK1fJ2argQfmrfs5LA20jAPgaHufmHFJ9XXeCOMvdIRoBDIv8UOq/vXN1w?= =?us-ascii?Q?En/N5dJkC/6KT4nM/KJ1BMvSUjQb3nvLku501zdwPg4+40DqbZksWGqqNXdH?= =?us-ascii?Q?FzOzFSbOpQ3pZ6lNHJUmDa7kbysPZLoSjClPfX1TeNN1cSW+aP99fsaQxMlY?= =?us-ascii?Q?d/51bnxqn9QB4FGXEh6OF0PC1zzSwWXQiuP/WtKT6DfTJ0rXjFrzjw7WA/ci?= =?us-ascii?Q?aWpcSt1FDihr1Hb6RfhTjnOlGu5icj9e78pY4sWoQ1m643vJ4mUzb+zthADu?= =?us-ascii?Q?9RSBNFFUsvKH8F0r+5hylud2Vft4wRVdmymC2fZr/UV9rTPcRN1oGIKVirXh?= =?us-ascii?Q?oOcE3O4lmCfEC2fRbZu83SWwSW4DfIg0Y64oMTJWOmunzk2ArDuXkECfQg6K?= =?us-ascii?Q?GeDRWAmj8uthDv1lXzPqK1BsNtbdg4Ui/VcSqF1euZ3MhbYV5tAc4XyHrkHv?= =?us-ascii?Q?8NcaFrtWmM5ba5Y/+ih4YN76w9A2dcRmsKVdt80AP89p5WruOJU5GDpOrXh7?= =?us-ascii?Q?ZMlHqycOLbua5KFMdwlndx4r5eZ4H90j84tXNbtf6VETqyrr5JU+Q0QXYxFX?= =?us-ascii?Q?QTaiDlLWhhee9V+EwctdsMuM5bQM2o6G5TpfY3qCjR9UGzLaf6q/0xfdaROW?= =?us-ascii?Q?BqMIXEsAEThGU1olLDVGDxogPY/vQEKYaOHx8Kd52359Epi9nneFqtFJ8K8U?= =?us-ascii?Q?SkVi3ZpY/2sEunhf2rI5uI3j1mmpz4xMhkFcQWxRxoCJ9iOk7oVMAg++SIgp?= =?us-ascii?Q?553MWjnt2Q8G/Kxm+KYeLn5sNqCGKyNegPxrHfosNmWGrhYOMHFlZRtS5K6k?= =?us-ascii?Q?qhe7xOt3/smxHe2Fc/ywa47jasEkmT79G+D0cHFOEj1uxkccAqF4Nu79PE92?= =?us-ascii?Q?Xu8SmEhJf9xis2YBNBpphgVPV1QUihn3FXjwrFmD56lgFsKXS53SvEyhS/Uf?= =?us-ascii?Q?mex7bS8ymzgiOQrLHjjs1HdhqjUPo84a+QvHob64x4XxChRlO/Jr+akfkq8A?= =?us-ascii?Q?z4DRFQMrQfgTBgg2m/BbA4cI6jEgqZta741TroXZpOfZQKxnPtC6kEZPsDeY?= =?us-ascii?Q?K9LzoOxNNFKyRsVvmDue3MITG9P7kof/6ExRLieGk4L5VYJ72vKaLcTXBQsY?= =?us-ascii?Q?vVBMra69dn+qCdKl+w7JACqetrdk5FHwjj5erKC32JEq2Rog1COiDzRRlGjc?= =?us-ascii?Q?9TGgQsKOWN8L6cVE55+FOgRAdxZrBXl6ujuDXHqIHHI6CTdvGIdqg8noNk5y?= =?us-ascii?Q?I1gWcB5kmYWLuJRSFa/T7ZW0JAzue9MgjSIw0sQUeJaNf2mP7SV3swgeoASE?= =?us-ascii?Q?wcpa6AURtDyM4DYynphwOLltZz/AZbk99+N+hPJ6m1ytwK8BS/ODPXqhrtiN?= =?us-ascii?Q?x3RtbHg79H2Eycb8ZwcNM9Zx7XzJ/bdGTVMrb2V79/wdy4NZfZEgVaNQg26a?= =?us-ascii?Q?VPtMnoG+nXZCQW+fPcmynohBVLqRbGHOTkviGSp6DVva1BacbNe7FCW0izgL?= =?us-ascii?Q?7XDhbeQaWpdHOT7IhUrpu4it9mse51sbTkMWLhUIbX5EeLskV/a03C2+VzIr?= =?us-ascii?Q?Eja8QvF1FJ2vNrFUeZH5ZqRMebJI2RJq77TXdD+3?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB6583.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10c8785c-cff6-4b5d-29ae-08dadc1c225e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2022 08:37:41.9825 (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: mkO9AWJM0Far67a2g9cXRwj6KiaqfK7IcuwmkXe0HVRlHWJ6n3G8d4/TyTcKLPPc1Y5EULTSUF6XjWxSf21SJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5164 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: "Simon Wang" BIOS feature driver cannot recognize "@Redfish.Settings", decode it and get= pending setting URI. So BIOS feature driver can consume pending setting fr= om correct place. 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 ++++++++++++-------- RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c | = 3 +- RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c | = 3 +- 4 files changed, 136 insertions(+), 89 deletions(-) diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h b/RedfishClie= ntPkg/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_PROTOCOL(This) \ BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, ConfigHandler) =20 diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishC= lientPkg/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 { "@Redfi= sh.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),=20 + RedfishSettingsUriKeys[Index]); } + + if (JsonValue !=3D NULL) { + // + // Verify RedfishSettings URI link is valid to retrieve resource or no= t. + // + RedfishSettingsUri =3D JsonValueGetUnicodeString (JsonValue); + + Status =3D GetResourceByUri (Private->RedfishService, RedfishSettingsU= ri, &RedfishSettingsResponse); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, @Redfish.Settings exists, get resource fro= m: %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->Payload= ), 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", __FU= NCTION__)); } @@ -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 Re= dfishResourceGetInfo ( - 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 RedfishRes= ourceUpdate ( - 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 RedfishReso= urceCheck ( - 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_PROTOCOL (T= his); =20 @@ -468,10 +515,10 @@ RedfishResourceInit ( EFI_STATUS EFIAPI RedfishRes= ourceStop ( - 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_PROTOCOL (T= his); =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 mRedfishConfigHa= ndler =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 gEfiRestJsonStructureProtoc= olGuid: %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 RedfishE= xternalResourceResourceFeatureCallback ( - 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(CH= AR16)); + ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * sizeof=20 + (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->SendInformati= on.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 gEdkIIRedfishFeatureProtoco= lGuid: %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/ComputerSy= stemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSys= temDxe.c index c2a638d7c05c..5f8308b2bdeb 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem +++ 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/Redf= ishClientPkg/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