From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.84]) by mx.groups.io with SMTP id smtpd.web11.38340.1670834410564726040 for ; Mon, 12 Dec 2022 00:40:10 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=mAMy/LXr; 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.100.84, mailfrom: simowang@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=graxnURaGwzyliYT0doUTCKgxQxa3iDS2YjGwWzeYoJG0i359SEJ1VeaJa/uxi6q5RVp/L01HQV8lOoiVy3N8cbli1ZdKbRQCGjuLn0K6jLBA0dpn1RdpjYHG84w72H0T0zCBqSJ85bRWIVa9kd+L0KxGk9/KpsfEpTYnF13YHCOM9K0FQSAKUN7qZFKoxnG9xaEnVfRVUvo1jGIGPkUH4Oy1Vw/Weiccc51MFvIZlnXH1a0Oe4QytPovPpL6tnTCAxiFq3bE8sPnAoJdFyj/TQAOd+AxueSx1xHh0nWSdyHRcU681WNZEpeTj2ugbxsIM3xnsaeV9sNvELj5ul2xg== 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=CfBk21tpOhISjARI8QjT85VyYIwsPEO7Op1lOP51W8o=; b=WBx64NiUCGg5cpWsidyh487etODbiA48z2dXEK9j/PEe0JwaKhzmMSEJjGRKqYdv8nT7Lk4n0XSpCngyCRIuXAdctVpgkjHpWuRvLBg3Vie7ucEyN0hesdVwzluBeOoUWK70Q/1xpJ81mm1kwJr8CjK3IXN/r5myDA2y2BQh0FtjNYv3j8ok56xElUCrQnEmCiVV0CPbMT8i+8syjXv+1LmajiYZLc769elyxaYu7cmCHLHRQBChNIqmA2vS3nl8EiPXxnVFINNbUfsD6vJQG1FzwGk3+aYLn6OVsoh7CDpMOpscQASYqn9xDIA7stbD9FqL8/fV8lxrNlxhbzp1Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=CfBk21tpOhISjARI8QjT85VyYIwsPEO7Op1lOP51W8o=; b=mAMy/LXrGJQBvrLyXRqUT2tvHdQ2NHzoOc6Y31/3Td4Mkhb+pT4p4d9rJPqwgQifg1HS2kWSYFprWGC8pSHGwTZooi/aLrEjZ1QqlRAAaRt8EUJk4HxfHqiGlMfAPOn0eOCwlLWpv9MRMOYT8RIj4YHBnSjr37SjQTY5g/J2yACVxhlOvU2M0ELXM1Aw8IhJHqI5AqX/ExeHhR/w3GucBAZdeeyjaEOWe+a4gtxHTA0jVxowQ8y1RcB0/my5cD1d+rOpEpDlB+JxcahArHzTogNCGldfFSNcxihVh395aIEFWIT4p+a8m/BJYxBHPaaeCsl3gGKHUm7caapgnlRfQQ== Received: from BN9PR03CA0787.namprd03.prod.outlook.com (2603:10b6:408:13f::12) by PH8PR12MB7135.namprd12.prod.outlook.com (2603:10b6:510:22c::11) 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:40:07 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::dd) by BN9PR03CA0787.outlook.office365.com (2603:10b6:408:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 08:40:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 08:40:06 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 12 Dec 2022 00:39:52 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 12 Dec 2022 00:39:47 -0800 Received: from smn-vm2.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Mon, 12 Dec 2022 00:39:47 -0800 From: Simon Wang To: CC: Nickle Wang , Abner Chang , "Igor Kulchytskyy" , Nick Ramirez Subject: [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Date: Mon, 12 Dec 2022 08:39:46 +0000 Message-ID: <20221212083946.6591-1-simowang@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-NVConfidentiality: public Return-Path: simowang@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT052:EE_|PH8PR12MB7135:EE_ X-MS-Office365-Filtering-Correlation-Id: b85ab76b-07bc-4a67-1a53-08dadc1c78e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 20blEpnWKbKhebB6gAunehOjyvelFjDJ1xJtLbHMh5yXJO/fJKwLGMpks6s61oaEnvpOqYBwNXuPUzizlGaFDsNY7ighJDowpTd36br9q9aEWsy2y1PTiv4pE7N36Qr/ZW9q5ubiPCSlAgTwIYxpFCYvRZ8V3WgzxypHRg+8IYBwuCgnA0WCwtgyzv6TGOfB3GbdRJvF+np/pQYXn2nOQ+RR8Dm/UtRhQ7tIsMW1YNmNhI1QXVM+vXP+pvjgfGsZ8TxFNu77NdSYaAu8krkcm+7XI8ZSxagdo3bxK0/dCemhnU/x8M0MGRMb11bZEHwVHbxrhuVRNI5yO8Hde3pGzE8kw7uyJ1uindzlMZUjy4ZoMvSDRDXmpvXpwaVRmSAifjkrbaL26/Iz4ceLYXLw7NbwIU/bQ1IJUO4wDGHt4OFzh9XNX2U8ZWO64hBtyEkPvnthUeOpULSpMSbcfhfRmEIOOt5k42JVJSveDAso8xmgO8yPKfjJ9sk24+cojFlHVgCyX8PJ7rR9JJGFLJJgPhdxbdEaI4JCu+rjEoSOkEzAPhYO/pxMMPYOsSSDAppdIVPsoBgq2zjTXcUh3TPLiKYbFtSeX1uYcfgVCZussR7Ldz/778hzx4FQpO3D3bDfJWheLNm6EqEr+pRGzZSBYTHyuvwb2V0iJF13qJBLsfTvhUrWbz1zcxfM2VQ2BS67Z3cIdWMyoMlXTR3djmZlkQ== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(346002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(478600001)(47076005)(107886003)(2906002)(426003)(82310400005)(86362001)(36756003)(7696005)(82740400003)(8936002)(7636003)(26005)(186003)(356005)(1076003)(40460700003)(2616005)(5660300002)(40480700001)(36860700001)(83380400001)(4326008)(41300700001)(30864003)(336012)(54906003)(8676002)(70206006)(6916009)(70586007)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 08:40:06.9594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b85ab76b-07bc-4a67-1a53-08dadc1c78e2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7135 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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 from 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), Redf= ishSettingsUriKeys[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 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_PROTOCOL (T= his); =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_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 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(CH= AR16)); + ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * sizeof (C= HAR16)); 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/ComputerSystemDxe= .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 /** --=20 2.17.1