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.71]) by mx.groups.io with SMTP id smtpd.web11.16877.1670424087787215422 for ; Wed, 07 Dec 2022 06:41:28 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=N5QWIesP; 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.71, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ga/zaAckZ24ErBg4Mbz4L9mbv/u9KF7aeQg5b+kgMece9A7fqNXAEuLYVdAorB7ca2ULeOptEy7mMw1MbSe44ec71f6AWk80B8UinjMvjlQpzSUr+kpOfovBvHkxSA8q+W0rg6Z2Ol8laWPHJqh+4Lpt/kaIDXLAJ0IxBczySk92U6ebcLW4AuSVTXku83hGpG1vP+UM1+i2oSa4QPcNIJX0Ft4zni4LmO2yd3P0SmYFlLQIRG3cBRiDehVD8EQfgfryFIyYP7iUwSKhhrR208cFIgTsTLsb7HkBCM0gFIEmrio4OOIR+Cz9gff466DB09KJe5XNXFWafY0YeAJNGg== 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=1kj06p0xiM14FJ+iUs+JHgovNGbsCwqYNDO9RBFON+c=; b=WwjkiThopRo30OVNIZjNiRq6fB5NBirGpfQ1mTk5kDhnT+Xb+qUWW1LqcEy+LTx/z1Wv8qxWhi1KjeNlEIW1Kfo4vl7aSMYvlaRI3US3B4mIifKryBhALhz6PIP1QuK0c9Y0UIYecy+01YxLw63Jei1PbmSXZoY3ZHh5qW+X6VDhNB1N2inAvYUIg1L4S0tkLQ2hcFf2Hm8d7bTILiysIpTma6b1qi4eXVYBDSjrNNLVsDhQtCVs0uzC60e7ELUugRIktBJewNP+M0CXfZomin92m61EH1FX4XSs1nnKSyTdl5p/JgPFm4o+R8FfhIvyxnDaMpPRnnngMd+g9sCixw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=1kj06p0xiM14FJ+iUs+JHgovNGbsCwqYNDO9RBFON+c=; b=N5QWIesPO+0AEPSWJu7xoLAqZGyw8xlvM40FEWIXVSE3VDWO/55hBVtVofc3H/kwhGECW2MV8iSc87JUNmzJ332tcgHTF++I92Dm/97JPOEQW+No6X8+OIZnvN9BA26N5mi7KxGIsaLkbX5q4FUDApgSdqNqzCkD4didhL9hk6VBNmeq2hkaVvHAIMZgcJiDmVg25RcXqUKhmaDhs4QHnA5RFz4N31DGNJY2MMuziQ67SfhZyKlNeWUqw1fnX2MeO2SUrdiOmYqaXr9v55160V5rJkAuGMKKkSXK/qXqFrIh+zQz6GAU0I6Q/BixQ66ptf1WxXXAR83KJfzfUzfefw== Received: from DS7PR03CA0212.namprd03.prod.outlook.com (2603:10b6:5:3ba::7) by BY5PR12MB4132.namprd12.prod.outlook.com (2603:10b6:a03:209::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 14:41:25 +0000 Received: from DS1PEPF0000E630.namprd02.prod.outlook.com (2603:10b6:5:3ba:cafe::f9) by DS7PR03CA0212.outlook.office365.com (2603:10b6:5:3ba::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 14:41:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF0000E630.mail.protection.outlook.com (10.167.17.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Wed, 7 Dec 2022 14:41:24 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 7 Dec 2022 06:41:16 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Wed, 7 Dec 2022 06:41:16 -0800 Received: from NV-CL38DL3.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Wed, 7 Dec 2022 06:41:15 -0800 From: "Nickle Wang" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-staging][PATCH 3/3] edk2-staging/RedfishClientPkg: Utilize RedfishAddendumLib Date: Wed, 7 Dec 2022 22:41:15 +0800 Message-ID: <20221207144115.398-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E630:EE_|BY5PR12MB4132:EE_ X-MS-Office365-Filtering-Correlation-Id: e8c53814-1304-4aad-b155-08dad8611dcb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AZhrFWqeDp0uTgrOmltoa0sisU7D4bdgic8s25btEzSbl2b1igYNSkqNFQ8xBtyZW3IWI57zZEPCUVi4ddA1UrUNUptkx13if+zWY2TqOdN55joEWGL/eV2Cq4qp+fAHYShbotwxSNFvD8BQiBXCMF3aaSD7FOIevjUeQoReJV3bxjf44LPLrckTB7+qLjg0/bJxm8C+D+iX8NSIl+gGIVYKxd3jyXmyQdtyORTd1i0S5RuH/yu8298zNUHJOeGAu659joGYtg/rqDv6pOnXuTZD+0hNvCrjXAC8gT+nyPSn3YFJJyZ4E+fWO56Hh+QjJ6+TvQ57djVEorGioS+p8cQIcHN6og+iVVIdUfApweOueV9/L+ocp6YoSwx6npLPcyshLYoG8I98hrQZByfZg0VvFT4PkttUPazdI2CdYD+TKGWHmQ1WTvLSJkzUduY66uSOkAIGkXfxXhG++CgT1Gu+Nc4h+YeHeX1XYLFLLgunNRdb+3l58ubRk5SXmNzEyiUOBFWjPQd8k5erpo5nsMH3MIubbRZ7LUjyeSEbqgRWQ+Lku31vvMdFlah911kiibyL2/j3h5sECAunBg4NxDkRMSJb6ubPhe+ha8VbQQnx/aM5/ZF7HQbHk9fUg8NDMaqWonD7exS9yoNUu7HCD7IxPh9CGy3VUakpeYQhqlpp3HTWm676cPMCkTyQkM5GPbw+IV+0lmOdEZb12d5KSg== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199015)(46966006)(36840700001)(40470700004)(36860700001)(2906002)(83380400001)(40480700001)(41300700001)(336012)(2616005)(1076003)(40460700003)(82310400005)(86362001)(36756003)(19627235002)(356005)(26005)(82740400003)(47076005)(8676002)(426003)(8936002)(5660300002)(4326008)(70206006)(186003)(7636003)(70586007)(316002)(7696005)(54906003)(107886003)(478600001)(6916009);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 14:41:24.8256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8c53814-1304-4aad-b155-08dad8611dcb 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.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E630.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4132 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Bios feature driver utilizes RedfishAddendumLib and get additional data before sending BIOS attributes to Redfish service. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../Features/Bios/v1_0_9/Common/BiosCommon.c | 100 ++++++++++++++++++ .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf | 2 + .../Include/RedfishResourceCommon.h | 2 + 3 files changed, 104 insertions(+) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/Re= dfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c index d910d0d8a9..72a5f51c5f 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -2,6 +2,7 @@ Redfish feature driver implementation - common functions =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -265,6 +266,7 @@ ProvisioningBiosResource ( ) { CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STATUS Status; EFI_STRING NewResourceLocation; CHAR8 *EtagStr; @@ -290,6 +292,38 @@ ProvisioningBiosResource ( return Status; } =20 + // + // Check and see if platform has OEM data or not + // + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + Status =3D CreatePayloadToPostResource (Private->RedfishService, Private= ->Payload, Json, &NewResourceLocation, &EtagStr); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", __F= UNCTION__, ConfigureLang, Status)); @@ -369,6 +403,7 @@ ProvisioningBiosExistResource ( EFI_STRING ConfigureLang; CHAR8 *EtagStr; CHAR8 *Json; + CHAR8 *JsonWithAddendum; =20 if (Private =3D=3D NULL) { return EFI_INVALID_PARAMETER; @@ -400,6 +435,38 @@ ProvisioningBiosExistResource ( goto ON_RELEASE; } =20 + // + // Check and see if platform has OEM data or not + // + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\= n", __FUNCTION__, ConfigureLang)); // // PUT back to instance @@ -528,6 +595,7 @@ RedfishUpdateResourceCommon ( { EFI_STATUS Status; CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STRING ConfigureLang; CHAR8 *EtagStr; =20 @@ -561,6 +629,38 @@ RedfishUpdateResourceCommon ( goto ON_RELEASE; } =20 + // + // Check and see if platform has OEM data or not + // + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", __FUNCTION_= _, ConfigureLang)); // // PUT back to instance diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf b/Redfis= hClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf index 8c01a3b877..3c3a4946b9 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf @@ -1,6 +1,7 @@ ## @file # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -37,6 +38,7 @@ RedfishResourceIdentifyLib UefiLib UefiDriverEntryPoint + RedfishAddendumLib =20 [Protocols] gEdkIIRedfishConfigHandlerProtocolGuid ## PRODUCED diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h b/RedfishClie= ntPkg/Include/RedfishResourceCommon.h index af4b809121..ba42bb01c8 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 & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -30,6 +31,7 @@ #include #include #include +#include =20 // // Protocols --=20 2.38.1.windows.1