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 990D37803DA for ; Thu, 23 Nov 2023 14:34:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wQnzuRnd7tKik3qZfW/ReT+3ib31r3D8TKV0f1cfN6U=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700750078; v=1; b=JaUtK1hIFNc6YBUa1Qm5Fz9Uu8S5262xVVTjlO8TVoqZoNWUo304/FTFXuqYXvXloh01Z5vX NqIqbzEX4ND49DI58vpqMEYLI2Tq00Dp5+78GuyJDil11BxV2HWLc/cIWynIrXgA4is44bFcQ/g yyITPyuex5n6FxtMj171XiWo= X-Received: by 127.0.0.2 with SMTP id N1xbYY7687511xWwxYUhPCZm; Thu, 23 Nov 2023 06:34:38 -0800 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.44]) by mx.groups.io with SMTP id smtpd.web11.92285.1700750077638588140 for ; Thu, 23 Nov 2023 06:34:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EuOpsBl/H9oHlEE2EqztrVyVJugk4PnJ+tAlqEqJy6jMPajUuK+XnznIhsEYyiCDx9lAEIZVjIC/614SUDl+wLKDkypvuqVw1yKlllWsPrTCSeTP+grLF5Yc/Ir0hT3jDgZZlSsOim9TTwAe19TbAjj5jzvvldjWM1vcoTA/850xpJkqEYi5N+EzRvjkrytrtqxKA8RRv7L6zwYmjN3pScMsMrBTWTxE4Oflj6HTrmJfwTOXKxJjcyV2IIvvFYfrTtoe9M3Ub0lMtpurjXX1jqqB2F0Wh1tV2hnK07cNNxbEycA3CxUPbmTwOYDUdfz1qLFMCQinPORsRGdcDweDDw== 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=O57On4vxWYQ5iDjBBWbFpyG0tqPdPrR3uuyN3ahUyhk=; b=cJj+JPwOy1ICgnrTb4seFWQNB2gHfAHSqNwDxdCmAyBz0ROBOtPt1I7uE5jmq6YcdbHcpK29CDM0POs7tFFKvALVX8RIHt0jkDTAPYGHakiDdxhVZldPAz4Lwogv9uD2j3aFyRr0FKQtqQgsC50PnQvFWHQ8tuJ2/bzpJJ/e0SsO05D3tGXPh43FcVaUo5tLuB4ldVRb3DGlzLAIt1/05hVWGxsVodpWXx3gtZgpdJzKMe34PHLjMvwSWvbn+BxcgaWvcYbqvZlGMLV3YPi3ei/6S4vWmcAL29FmfJ8WKPH2H2GerEC3MulwSpujyJra89xqRfhelBNe/eF7wUh78Q== 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 (0) X-Received: from MW4PR03CA0071.namprd03.prod.outlook.com (2603:10b6:303:b6::16) by DM6PR12MB4300.namprd12.prod.outlook.com (2603:10b6:5:21a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 14:34:34 +0000 X-Received: from CO1PEPF000044FD.namprd21.prod.outlook.com (2603:10b6:303:b6:cafe::b4) by MW4PR03CA0071.outlook.office365.com (2603:10b6:303:b6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.27 via Frontend Transport; Thu, 23 Nov 2023 14:34:34 +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 X-Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000044FD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.3 via Frontend Transport; Thu, 23 Nov 2023 14:34:34 +0000 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.41; Thu, 23 Nov 2023 06:34:21 -0800 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Nov 2023 06:34:21 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 23 Nov 2023 06:34:20 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH 5/6] RedfishClientPkg/Features: fix NULL cached handler issue. Date: Thu, 23 Nov 2023 22:34:19 +0800 Message-ID: <20231123143419.3612-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FD:EE_|DM6PR12MB4300:EE_ X-MS-Office365-Filtering-Correlation-Id: e5e5d504-4010-4c44-4ec6-08dbec315018 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: i/Uv+82FK45ouF7L/AiOEZMjXA+Gt1USFNv0aiFibP/b2w2HAExeRzn+ZFjp3rqUjGzqZXH6ylSVSbkrUKZT7lWFkl/E2j/v9ke3kS1Rh7fZWL7VUxsBjRjyo2t4KRgtgeUN03FdVl+y7eODkWvsz2yHIviFVI8O2IVDHmFrguyEaVHS7ykyB3EPCFclSVTI80jnvxn+6SBmXyrCuScU+QZEVXDC/FGe6VITtJli8jOy41MPjsUnatXqTyy25hUELwkFs0Hw94MO6UezSWfCruymXMS2gPX0Xm87TLr+bxjSyib5QND01FUppoPbY8IBbm9/SDr0O8dTEVQ9jXDDcvL4alWe1Z4L6aFkajj90AIzrhDqXgYLsLm2jvShUH6fK2+eWtRW3JW49tGNrSKz/PB4GCrDHiUXytHW3/p9BdN5TZnvr4AXXk2IptVpTbJRK6HMat4UkN2BRrn6NEI6MhTxqcgV4xDD+NJmxCrNb1TUHKmby4WajzMNWslgW/VEBFcbq1Zk24HJ618IdZ15Yf+0fKyLUboA2pER2gHdZvXBTDGSOB6fuCnX96ic2KyP2DpPeokohST6M2ZrXiP7kYtKKdgzPFI7Q6OqP3SfO5BkN1XQ0XmwR9wzbVnzKn5xyZihCkWsy80GFYMjr4baqsosP7UiujuxT3RfToe3kwZ8kpUgwsVETcEoZXHj+/RU/USu8N13MK8LwnKZ2p2tOA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 14:34:34.2973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5e5d504-4010-4c44-4ec6-08dbec315018 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: CO1PEPF000044FD.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4300 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: cpVH0CavuWjZU6xAYDaDwI29x7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=JaUtK1hI; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io EdkIIRedfishResourceSetConfigureLang() uses cached handler to locate protocol. However, if EdkIIRedfishResourceSetConfigureLang() is called at non-collection driver, the cached handler is NULL because cached handler is initialized by collection driver. Since EdkIIRedfishResourceSetConfigureLang() is in library, the cached handler is not shared in different drivers. Fix this issue by getting image handler from caller. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../Library/EdkIIRedfishResourceConfigLib.h | 9 ++++++--- .../Features/Bios/v1_0_9/Common/BiosCommon.c | 9 +++++---- .../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 3 +-- .../v1_5_0/Common/ComputerSystemCommon.c | 8 +++++--- .../v1_5_0/Dxe/ComputerSystemDxe.c | 3 +-- .../ComputerSystemCollectionDxe.c | 5 +++-- .../Memory/V1_7_1/Common/MemoryCommon.c | 8 +++++--- .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 3 +-- .../MemoryCollectionDxe/MemoryCollectionDxe.c | 5 +++-- .../EdkIIRedfishResourceConfigLib.c | 18 ++++++++++++++---- 10 files changed, 44 insertions(+), 27 deletions(-) diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib= .h b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h index a7856033..c8c9cb86 100644 --- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h +++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h @@ -2,6 +2,7 @@ This file defines the EDKII resource config Library interface. =20 (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -18,7 +19,7 @@ #include =20 /** - Provising redfish resource by given URI. + Provisioning redfish resource by given URI. =20 @param[in] Schema Redfish schema information. @param[in] Uri Target URI to create resource. @@ -32,7 +33,7 @@ =20 **/ EFI_STATUS -EdkIIRedfishResourceConfigProvisionging ( +EdkIIRedfishResourceConfigProvisioning ( IN REDFISH_SCHEMA_INFO *Schema, IN EFI_STRING Uri, IN RESOURCE_INFORMATION_EXCHANGE *InformationExchange, @@ -109,6 +110,7 @@ EdkIIRedfishResourceConfigIdentify ( Set Configure language of this resource in the RESOURCE_INFORMATION_EXCHANGE structure. =20 + @param[in] ImageHandle Pointer to image handle. @param[in] ConfigLangList Pointer to REDFISH_FEATURE_ARRAY_TYPE_CONFI= G_LANG_LIST. =20 @retval EFI_SUCCESS Configure language is set. @@ -118,7 +120,8 @@ EdkIIRedfishResourceConfigIdentify ( **/ EFI_STATUS EdkIIRedfishResourceSetConfigureLang ( - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST *ConfigLangList + IN EFI_HANDLE ImageHandle, + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST *ConfigLangList ); =20 /** diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/Re= dfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c index 98288d66..ea274018 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -12,7 +12,8 @@ =20 CHAR8 BiosEmptyJson[] =3D "{\"@odata.id\": \"\", \"@odata.type\": \"#Bios= .v1_0_9.Bios\", \"Id\": \"\", \"Name\": \"\", \"Attributes\":{}}"; =20 -REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D NULL; +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D = NULL; +EFI_HANDLE mRedfishResourceConfigProtocolHandle =3D = NULL; =20 /** Consume resource from given URI. @@ -385,7 +386,7 @@ ProvisioningBiosResources ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE. // This information is sent back to the parent resource (e.g. the collec= tion driver). // - EdkIIRedfishResourceSetConfigureLang (&UnifiedConfigureLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHand= le, &UnifiedConfigureLangList); =20 for (Index =3D 0; Index < UnifiedConfigureLangList.Count; Index++) { DEBUG ((DEBUG_MANAGEABILITY, "[%d] create Bios resource from: %s\n", U= nifiedConfigureLangList.List[Index].Index, UnifiedConfigureLangList.List[In= dex].ConfigureLang)); @@ -750,7 +751,7 @@ RedfishIdentifyResourceCommon ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE= . // This information is sent back to the parent resource (e.g. the coll= ection driver). // - EdkIIRedfishResourceSetConfigureLang (&ConfigLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHa= ndle, &ConfigLangList); DestroyConfiglanguageList (&ConfigLangList); return EFI_SUCCESS; } @@ -817,7 +818,7 @@ HandleResource ( // The target property does not exist, do the provision to create prop= erty. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Uri, = Private->InformationExchange, FALSE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, P= rivate->InformationExchange, FALSE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", = __func__, Status)); } diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishC= lientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index 9b336d3d..8b9bdc31 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -11,6 +11,7 @@ #include "../Common/BiosCommon.h" =20 extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; +extern EFI_HANDLE mRedfishResourceConfigProtocolHand= le; =20 EFI_STATUS HandleResource ( @@ -18,8 +19,6 @@ HandleResource ( IN EFI_STRING Uri ); =20 -EFI_HANDLE mRedfishResourceConfigProtocolHandle; - /** Provisioning redfish resource by given URI. =20 diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Compute= rSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Co= mputerSystemCommon.c index 1ffb7d1d..78beb5cb 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystem= Common.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystem= Common.c @@ -2,6 +2,7 @@ Redfish feature driver implementation - common functions =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -11,7 +12,8 @@ =20 CHAR8 ComputerSystemEmptyJson[] =3D "{\"@odata.id\": \"\", \"@odata.type\= ": \"#ComputerSystem.v1_5_0.ComputerSystem\", \"Id\": \"\", \"Name\": \"\",= \"Boot\":{}}"; =20 -REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D NULL; +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D = NULL; +EFI_HANDLE mRedfishResourceConfigProtocolHandle =3D = NULL; =20 /** Consume resource from given URI. @@ -1321,7 +1323,7 @@ ProvisioningComputerSystemResources ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE. // This information is sent back to the parent resource (e.g. the collec= tion driver). // - EdkIIRedfishResourceSetConfigureLang (&UnifiedConfigureLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHand= le, &UnifiedConfigureLangList); =20 for (Index =3D 0; Index < UnifiedConfigureLangList.Count; Index++) { DEBUG ((DEBUG_MANAGEABILITY, "[%d] create ComputerSystem resource from= : %s\n", UnifiedConfigureLangList.List[Index].Index, UnifiedConfigureLangLi= st.List[Index].ConfigureLang)); @@ -1626,7 +1628,7 @@ RedfishIdentifyResourceCommon ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE= . // This information is sent back to the parent resource (e.g. the coll= ection driver). // - EdkIIRedfishResourceSetConfigureLang (&ConfigLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHa= ndle, &ConfigLangList); DestroyConfiglanguageList (&ConfigLangList); return EFI_SUCCESS; } 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 5c2a4ead..4ee72eeb 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .c @@ -11,8 +11,7 @@ #include "../Common/ComputerSystemCommon.h" =20 extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; - -EFI_HANDLE mRedfishResourceConfigProtocolHandle; +extern EFI_HANDLE mRedfishResourceConfigProtocolHand= le; =20 /** Provisioning redfish resource by given URI. diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/Computer= SystemCollectionDxe.c b/RedfishClientPkg/Features/ComputerSystemCollectionD= xe/ComputerSystemCollectionDxe.c index 1e362d49..5c6850c9 100644 --- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.c +++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.c @@ -3,6 +3,7 @@ Redfish feature driver implementation - ComputerSystemCollection =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -95,7 +96,7 @@ HandleResource ( // The target property does not exist, do the provision to create prop= erty. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Uri, = Private->InformationExchange, FALSE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, P= rivate->InformationExchange, FALSE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", = __func__, Status)); } @@ -226,7 +227,7 @@ CreateCollectionResource ( =20 DEBUG ((REDFISH_DEBUG_TRACE, "%a, supported schema: %a %a.%a.%a\n", __fu= nc__, SchemaInfo.Schema, SchemaInfo.Major, SchemaInfo.Minor, SchemaInfo.Err= ata)); =20 - Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private= ->CollectionUri, Private->InformationExchange, TRUE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Private-= >CollectionUri, Private->InformationExchange, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __= func__, Private->CollectionUri, Status)); } diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c = b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c index 4c41f16b..44325ddb 100644 --- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c @@ -2,6 +2,7 @@ Redfish feature driver implementation - common functions =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -11,7 +12,8 @@ =20 CHAR8 MemoryEmptyJson[] =3D "{\"@odata.id\": \"\", \"@odata.type\": \"#Me= mory.v1_7_1.Memory\", \"Id\": \"\", \"Name\": \"\"}"; =20 -REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D NULL; +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D = NULL; +EFI_HANDLE mRedfishResourceConfigProtocolHandle =3D = NULL; =20 /** Consume resource from given URI. @@ -2237,7 +2239,7 @@ ProvisioningMemoryResources ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE. // This information is sent back to the parent resource (e.g. the collec= tion driver). // - EdkIIRedfishResourceSetConfigureLang (&UnifiedConfigureLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHand= le, &UnifiedConfigureLangList); =20 for (Index =3D 0; Index < UnifiedConfigureLangList.Count; Index++) { DEBUG ((DEBUG_MANAGEABILITY, "[%d] create Memory resource from: %s\n",= UnifiedConfigureLangList.List[Index].Index, UnifiedConfigureLangList.List[= Index].ConfigureLang)); @@ -2542,7 +2544,7 @@ RedfishIdentifyResourceCommon ( // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE= . // This information is sent back to the parent resource (e.g. the coll= ection driver). // - EdkIIRedfishResourceSetConfigureLang (&ConfigLangList); + EdkIIRedfishResourceSetConfigureLang (mRedfishResourceConfigProtocolHa= ndle, &ConfigLangList); DestroyConfiglanguageList (&ConfigLangList); return EFI_SUCCESS; } diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c b/Redf= ishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c index f34f3266..80bfd6d2 100644 --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c @@ -11,8 +11,7 @@ #include "../Common/MemoryCommon.h" =20 extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; - -EFI_HANDLE mRedfishResourceConfigProtocolHandle; +extern EFI_HANDLE mRedfishResourceConfigProtocolHand= le; =20 /** Provisioning redfish resource by given URI. diff --git a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollection= Dxe.c b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c index 1b755cde..dc1ee5ca 100644 --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c @@ -3,6 +3,7 @@ Redfish feature driver implementation - MemoryCollection =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -95,7 +96,7 @@ HandleResource ( // The target property does not exist, do the provision to create prop= erty. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Uri, = Private->InformationExchange, FALSE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, P= rivate->InformationExchange, FALSE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", = __func__, Status)); } @@ -226,7 +227,7 @@ CreateCollectionResource ( =20 DEBUG ((REDFISH_DEBUG_TRACE, "%a, supported schema: %a %a.%a.%a\n", __fu= nc__, SchemaInfo.Schema, SchemaInfo.Major, SchemaInfo.Minor, SchemaInfo.Err= ata)); =20 - Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private= ->CollectionUri, Private->InformationExchange, TRUE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Private-= >CollectionUri, Private->InformationExchange, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __= func__, Private->CollectionUri, Status)); } diff --git a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRe= dfishResourceConfigLib.c b/RedfishClientPkg/Library/EdkIIRedfishResourceCon= figLib/EdkIIRedfishResourceConfigLib.c index ce86ce70..7a7bb4de 100644 --- a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishRe= sourceConfigLib.c +++ b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishRe= sourceConfigLib.c @@ -363,6 +363,7 @@ InstallInterchangeDataProtocol ( Set Configure language of this resource in the RESOURCE_INFORMATION_EXCHANGE structure. =20 + @param[in] ImageHandle Pointer to image handle. @param[in] ConfigLangList Pointer to REDFISH_FEATURE_ARRAY_TYPE_CONFI= G_LANG_LIST. =20 @retval EFI_SUCCESS Configure language is set. @@ -372,20 +373,29 @@ InstallInterchangeDataProtocol ( **/ EFI_STATUS EdkIIRedfishResourceSetConfigureLang ( - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST *ConfigLangList + IN EFI_HANDLE ImageHandle, + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST *ConfigLangList ) { EFI_STATUS Status; UINTN Index; EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL *Interface; =20 + if ((ImageHandle =3D=3D NULL) || (ConfigLangList =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + if ((ConfigLangList->Count =3D=3D 0) || (ConfigLangList->List =3D=3D NUL= L)) { + return EFI_NOT_FOUND; + } + Status =3D gBS->HandleProtocol ( - mCachedHandle, + ImageHandle, &gEdkIIRedfishFeatureInterchangeDataProtocolGuid, (VOID **)&Interface ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTO= COL is not installed %r", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTO= COL is not installed on %p: %r\n", __func__, ImageHandle, Status)); return Status; } =20 @@ -422,7 +432,7 @@ EdkIIRedfishResourceSetConfigureLang ( =20 **/ EFI_STATUS -EdkIIRedfishResourceConfigProvisionging ( +EdkIIRedfishResourceConfigProvisioning ( IN REDFISH_SCHEMA_INFO *Schema, IN EFI_STRING Uri, IN RESOURCE_INFORMATION_EXCHANGE *InformationExchange, --=20 2.17.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 (#111676): https://edk2.groups.io/g/devel/message/111676 Mute This Topic: https://groups.io/mt/102767548/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-