From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.63]) by mx.groups.io with SMTP id smtpd.web10.21611.1677677111749912278 for ; Wed, 01 Mar 2023 05:25:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=V5eY0wNs; 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.93.63, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGm2lHwT7iVVb33YBgIY7jAa9mVx+VDhCxs5Jz3Li7rVOXBDfXtApx3lOgQ5s0y6xVafE3+tAqM1AmPvMqwJ3tiJNfopSsQqthZWphEyDn2BOFWuaTG0KwVXcSvN+iuI5bkm2VU1pTwA4KJyekC5jFbhwY49B4HmWktLqTeWuwLa2OvLg5DyxJKlQX5amFd5Gf+ZqGA0DoepivaSa/MZq1yFLzeqmiPIUuB+iH7Vwb4dgYXHeKWcf5rLJMhPE6ddspAi0nbqX6KaxuMgQdCe+SXKRDCgh7Dainr341l13biIfMJUDVn3IUONhxo03jybUQ3/y5KJteBMlM6yvLAw9Q== 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=HJqQRpOwjMDMnVA10+lDbMu/BGtb6fUXwMODa1Tkg48=; b=CZaD7nEFm9VwV4vdspkapvPOBliEPLQWJ4qgRhTNrKQPpikIKkoFp569e89haOhKv3bLga8GQTiwI7xd76hKDgmtgifVeno/NeuKGY8P6JiU2VnU1EJUjcNI6pDY0S+mXUs6vqeFwhc5Cz/a/2cjISxw9f3Hgcdx1xZHQSmhnayNgsW7drxL80Rw+3+xZIDU87nt2inp+xtygjIA/Ib4cZQHZBjsX1o8XXlITt8M/R8ivoEHgaJcERRBoJcrLjBemCovvk1P9vFk76m6DiJyesrxFYTKwDfBXgS8u43gS0bfnbRGwiEe5/N0x5hMHmg8b7hrrDUyT6t9gqfcnd9d9g== 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=HJqQRpOwjMDMnVA10+lDbMu/BGtb6fUXwMODa1Tkg48=; b=V5eY0wNs56p0vwlcqqwcMIruE23QabZlN+6/px4T5PgcmhSwYtsdrxE3BjvxRDDtJs8YOjzp4ul9cbhW3mPnNf4L6dCj+eYg1OeI28hnpfUs+YCju/bSUr3zq8mktzu0a3alGsGDfLBe3hzmuz65DAL1nMIaWV4K+D4xWZKNoOQ= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DS7PR12MB5839.namprd12.prod.outlook.com (2603:10b6:8:7a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.26; Wed, 1 Mar 2023 13:25:06 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::8136:1f56:53e5:6fe]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::8136:1f56:53e5:6fe%3]) with mapi id 15.20.6156.018; Wed, 1 Mar 2023 13:25:06 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-staging][PATCH v2 1/1] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Topic: [edk2-staging][PATCH v2 1/1] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Index: AQHZTEAE1ERDNikNIESjCy0pSfHtB67l6dyw Date: Wed, 1 Mar 2023 13:25:04 +0000 Message-ID: References: <20230301131554.92-1-nicklew@nvidia.com> In-Reply-To: <20230301131554.92-1-nicklew@nvidia.com> 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=2023-03-01T13:25:01Z; 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=360959a3-b557-416a-b7cb-5d2ea4074967; 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_|DS7PR12MB5839:EE_ x-ms-office365-filtering-correlation-id: 4fc80236-e41a-4a41-1d11-08db1a585e68 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JMuyPvf+b2PSGAzVkWvxTTsabBGzgX5rpqEb29asd0EztL/iB26zug1Qzryszh6v9HUEt/4yervSZDoK4YAf10YnzTJbOHd+wLF8M+KpRyWq5nZNnuUVgzmXK3XMlO7mxOPCoDDxN1nQ4AJ20WZfjPW5cX2c0YAEJpj+8V3+jChB8hMgUMXfu7TnwrQqKJMF+aeFOeNQmfkUqFpKf/ofsRy0JqrnzLCmOiKUya60aDh+1PTfibqUiuH6obmmCosfJ9bZQxUv117I+lKKThQhP26k33Rs+0l6EYAHFlkY9HiCMWCKqdgAB22dW0bmhOZXuOqhdiYq1jtj43YOSXLemlGBVHb3mSGK0jMfY+SgiXsI0L2afdMkM6oDkIkIf4jQ7rxTrIQy5gxX2ybpNmHs29E8osdv+OyYRgCudEq6PBc0wbQtiWLIbczxbLpxjS6TAPIJr5yNCI3dLeuCAUdDJ84pINn7vtDTuCdQB2ITBE4nS0MeO6PHf+SaSlctEXhUqOzintNf61d2xKrDKynq7tk5HWzAVsjnOILmi2wkZans5z3jqHDXQeOsFnhMwXqbg8+F+rLJjKp+lwqLqqMQMuUkAF1LIS9Tzn7ItlGLo4o+DCuurInAvyLV1uKGA9iBW9onj1Pn/tcS00lyEnvV/M3kepZBxu1qvZJZ14h27u8N+wBvD611LobteuHWTIqTO4u/V2qZw1rgMugeTvP12w== 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:(13230025)(4636009)(366004)(396003)(346002)(136003)(376002)(39860400002)(451199018)(55016003)(38070700005)(26005)(7696005)(41300700001)(86362001)(110136005)(478600001)(71200400001)(64756008)(66476007)(33656002)(76116006)(66446008)(8676002)(66556008)(66946007)(4326008)(8936002)(54906003)(5660300002)(316002)(52536014)(2906002)(186003)(19627235002)(83380400001)(9686003)(122000001)(38100700002)(53546011)(30864003)(6506007)(579004)(559001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QFMzVnVmAORq5QMY/jcfecR2xzP78X69h6dKK0qxBKg5oa6Q6kQbhDLlweBS?= =?us-ascii?Q?uPWHOfPESOD2K7BhGCTzs3GuufMg8Csbvk/oUNRSqPwj0mtzhMvvX+QnQ8+i?= =?us-ascii?Q?41aobz2OC2tD9YiFk23RWtz03iQ7srwNgVLyb1LfZ4VJ6B0tqkw2HAysNu/Q?= =?us-ascii?Q?B/UmYbfxOPodNSwxkGrvH7HROGugej8tP0sWh+z3efMAhnDT2iC/gpLqxRsv?= =?us-ascii?Q?v+/5m48hzaLlk9rec74r6hwaLRAHfTZA27Kzwy/lAnP9mHI9efBaNHLw/iFO?= =?us-ascii?Q?EaDVL9MwnriCkdxtgr9FxyrJoPfSe+enQ6FkyeFV1u6JzdLK2BzIDfJP+w72?= =?us-ascii?Q?MQxZN5hHyoF097PjMMZZQDZNsepV7iu07UfTtiSVZeM4tcYuIE3bGkgcg/zD?= =?us-ascii?Q?MQNlG+z4La728J5ZGqC5qVu/ixgz+FM/YWnyDdwvdxmi8AN5M6eShnolderJ?= =?us-ascii?Q?f2iLOdI60MKaxCKozm50mRFAYGpnjRchbfew1eLB3+yl9J43hyb+yRwrPWYh?= =?us-ascii?Q?Rn1JlMsEGHwBBXfMPqF5Xgxg0b2mwJRkyXuRItqyIRKAdbztEAY5bktb7USX?= =?us-ascii?Q?R8a0y1BsfxDAGj7SxH2pXO55gNhmYEh8D3Seh3zTE/xKc9btoi+ha1n2A2ik?= =?us-ascii?Q?SqQGW3mZVAXm6aEHYeBFkzqNS84TuzxuZ8CoO44v+SfAPR+2tyZOdcgmB0GR?= =?us-ascii?Q?k2sb4KsLHZEzKNPmVOl+a8LGgMzwbftpfKFsP6b+ToJ6Wp1n+vDXYcWr5lRb?= =?us-ascii?Q?6NknZCuaxfMuz7RQl5cJlldUFBNez+j3GITGsZJdeyLIxRrk71Irn/iPj5xk?= =?us-ascii?Q?K4ltLBfbTFOxv8+/NIy/OOyphG74+kh8hwdOUurIudg2S7FyR4N5mz4lsUzf?= =?us-ascii?Q?BxtHTmrpYUcgPWYrKIEuPt2nbF1/mfJubebP3bHCFCBhkuzN7ndMxRai3Dwy?= =?us-ascii?Q?k9qnZnlWL1yaHtajZgVwwed/GnqfhzvqQ3op31RYpwnhw4eEDTxa3Z+pnTd4?= =?us-ascii?Q?hXCzj1YUUzUV1KV/RqUJlGMWyHtO5exFl0/D85osMBA578DLyvk6/oBtc7LF?= =?us-ascii?Q?SoAJTbVW22RCkhqgefX7DaAEHuoaq3E3D4vJ4y2OvxMcCMCyGI6e8Qo/2dkb?= =?us-ascii?Q?BvijH50ad6HKCy9Hsin6GJbYhReqi7ApQW05GruAu+NxodEtrUX+EydoQ5eB?= =?us-ascii?Q?2IkMd+b1fVBRe4mQuYQw9R17hF9WanomcyNifqqKsYfZj3i6B5oyEIdLEDCX?= =?us-ascii?Q?9+713A+Lv12Ub+HKWlprLnHZsn36AjYxxiu43sA2/u5xz3CTpmHmyIsXUzBO?= =?us-ascii?Q?zm5VkZ9Woxcrx6cqd9TbXUqX9Jst/r+eQ3mJ2mPINJvdyIq7P3dq4Ge5GmvE?= =?us-ascii?Q?gC51+X7IEJMioofp94kDxMPtQRSVvQXhDZPTyI0dCeTlkCYa6UKI8WEWRyrL?= =?us-ascii?Q?KuB0eIsu7Wy61Yewt/JY1h3chWDNaSuseokpJkZR6fo1VRwfZqRvRk1Q1UHV?= =?us-ascii?Q?eNxWw8j8WKrPzqxZOI/5s2CrV20WanaCEyAismrCk3LLkuoaECdnEKya1lO/?= =?us-ascii?Q?9rySrXlZFUM2Yre7mc3p8sSWXhB/KKIZDzjicu6b?= 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: 4fc80236-e41a-4a41-1d11-08db1a585e68 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2023 13:25:04.6226 (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: 7TVmjksidFxoKUNI4ENmCh9dz64ZcgvJiVPs4EPDlBxoO2VHbyna7GSQqzHAeRNqhR/rkuHKn88LQHzyX0dNQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5839 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: Nickle Wang > Sent: Wednesday, March 1, 2023 9:16 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [edk2-staging][PATCH v2 1/1] RedfishClientPkg: Add mechanism to > reboot system if config is changed >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > When system configuration is updated from RESTful interface, we need a > system reboot so that the changes can be applied. Introduce PCD > "PcdSystemRebootRequired" to RedfishClientPkg. RedfishFeatureUtility > library will enable this flag when system config is updated. > RedfishFeatureCore driver will check this flag and perform cold reboot > after all Redfish operations are finished. PCD "PcdSystemRebootTimeout" > is used to specify how many second BIOS will wait before reboot system. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../Library/RedfishFeatureUtilityLib.h | 240 ++-- > .../RedfishFeatureUtilityLib.c | 1111 +++++++++-------- > .../RedfishFeatureUtilityLib.inf | 3 + > RedfishClientPkg/RedfishClientPkg.dec | 8 +- > .../RedfishFeatureCoreDxe.c | 315 +++-- > .../RedfishFeatureCoreDxe.h | 3 + > .../RedfishFeatureCoreDxe.inf | 5 + > 7 files changed, 935 insertions(+), 750 deletions(-) >=20 > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > index 1325976d8c..1429643272 100644 > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > @@ -2,6 +2,7 @@ > This file defines the Redfish Feature Utility Library interface. >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -14,20 +15,22 @@ > #include > #include >=20 > +#define REDFISH_ENABLE_SYSTEM_REBOOT() > PcdSetBoolS(PcdRedfishSystemRebootRequired, TRUE) > + > // > // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > // > typedef struct { > - UINTN Index; > - EFI_STRING ConfigureLang; > + UINTN Index; > + EFI_STRING ConfigureLang; > } REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG; >=20 > // > // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > // > typedef struct { > - UINTN Count; > - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *List; > + UINTN Count; > + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *List; > } REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST; >=20 > /** > @@ -44,9 +47,9 @@ typedef struct { > **/ > EFI_STATUS > GetResourceByUri ( > - IN REDFISH_SERVICE *Service, > - IN EFI_STRING ResourceUri, > - OUT REDFISH_RESPONSE *Response > + IN REDFISH_SERVICE *Service, > + IN EFI_STRING ResourceUri, > + OUT REDFISH_RESPONSE *Response > ); >=20 > /** > @@ -66,9 +69,9 @@ GetResourceByUri ( > **/ > EFI_STATUS > IsRedpathArray ( > - IN EFI_STRING ConfigureLang, > - OUT EFI_STRING *ArraySignatureOpen, > - OUT EFI_STRING *ArraySignatureClose > + IN EFI_STRING ConfigureLang, > + OUT EFI_STRING *ArraySignatureOpen, > + OUT EFI_STRING *ArraySignatureClose > ); >=20 > /** > @@ -106,8 +109,8 @@ RedfishFeatureGetUnifiedArrayTypeConfigureLang ( > **/ > EFI_STATUS > CopyConfiglanguageList ( > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *SourceConfigureLangList, > - OUT REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *DestConfigureLangList > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *SourceConfigureLangList, > + OUT REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *DestConfigureLangList > ); >=20 > /** > @@ -121,7 +124,7 @@ CopyConfiglanguageList ( > **/ > UINTN > GetNumberOfRedpathNodes ( > - IN EFI_STRING NodeString > + IN EFI_STRING NodeString > ); >=20 > /** > @@ -138,9 +141,9 @@ GetNumberOfRedpathNodes ( > **/ > EFI_STRING > GetRedpathNodeByIndex ( > - IN EFI_STRING NodeString, > - IN UINTN Index, > - OUT EFI_STRING *EndOfNodePtr OPTIONAL > + IN EFI_STRING NodeString, > + IN UINTN Index, > + OUT EFI_STRING *EndOfNodePtr OPTIONAL > ); >=20 > /** > @@ -159,9 +162,9 @@ GetRedpathNodeByIndex ( > **/ > EFI_STATUS > GetArrayIndexFromArrayTypeConfigureLang ( > - IN CHAR16 *ConfigureLang, > - OUT CHAR16 **UnifiedConfigureLang, > - OUT UINTN *Index > + IN CHAR16 *ConfigureLang, > + OUT CHAR16 **UnifiedConfigureLang, > + OUT UINTN *Index > ); >=20 > /** > @@ -175,7 +178,7 @@ GetArrayIndexFromArrayTypeConfigureLang ( > **/ > UINTN > ConfiglanguageGetInstanceIndex ( > - IN EFI_STRING ConfigureLang > + IN EFI_STRING ConfigureLang > ); >=20 > /** > @@ -191,7 +194,7 @@ ConfiglanguageGetInstanceIndex ( > **/ > EFI_STATUS > DestroyConfiglanguageList ( > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *ConfigureLangList > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *ConfigureLangList > ); >=20 > /** > @@ -211,9 +214,9 @@ DestroyConfiglanguageList ( > **/ > EFI_STATUS > SetResourceConfigLangMemberInstance ( > - IN EFI_STRING *DestConfigLang, > - IN UINTN MaxtLengthConfigLang, > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > + IN EFI_STRING *DestConfigLang, > + IN UINTN MaxtLengthConfigLang, > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > ); >=20 > /** > @@ -229,8 +232,8 @@ SetResourceConfigLangMemberInstance ( > **/ > EFI_STATUS > GetArraykeyFromUri ( > - IN CHAR8 *Uri, > - OUT CHAR8 **ArrayKey > + IN CHAR8 *Uri, > + OUT CHAR8 **ArrayKey > ); >=20 > /** > @@ -248,10 +251,10 @@ GetArraykeyFromUri ( > **/ > EFI_STATUS > ApplyFeatureSettingsStringType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN CHAR8 *FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN CHAR8 *FeatureValue > ); >=20 > /** > @@ -269,10 +272,10 @@ ApplyFeatureSettingsStringType ( > **/ > EFI_STATUS > ApplyFeatureSettingsNumericType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN INTN FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN INTN FeatureValue > ); >=20 > /** > @@ -290,10 +293,10 @@ ApplyFeatureSettingsNumericType ( > **/ > EFI_STATUS > ApplyFeatureSettingsBooleanType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN BOOLEAN FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN BOOLEAN FeatureValue > ); >=20 > /** > @@ -312,11 +315,11 @@ ApplyFeatureSettingsBooleanType ( > **/ > EFI_STATUS > ApplyFeatureSettingsVagueType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN RedfishCS_EmptyProp_KeyValue *VagueValuePtr, > - IN UINT32 NumberOfVagueValues > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN RedfishCS_EmptyProp_KeyValue *VagueValuePtr, > + IN UINT32 NumberOfVagueValues > ); >=20 > /** > @@ -355,9 +358,9 @@ ApplyFeatureSettingsStringArrayType ( > **/ > EFI_STATUS > ApplyFeatureSettingsNumericArrayType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > IN RedfishCS_int64_Array *ArrayHead > ); >=20 > @@ -398,11 +401,11 @@ ApplyFeatureSettingsBooleanArrayType ( > **/ > EFI_STATUS > CreatePayloadToPostResource ( > - IN REDFISH_SERVICE *Service, > - IN REDFISH_PAYLOAD *TargetPayload, > - IN CHAR8 *Json, > - OUT EFI_STRING *Location, > - OUT CHAR8 **Etag > + IN REDFISH_SERVICE *Service, > + IN REDFISH_PAYLOAD *TargetPayload, > + IN CHAR8 *Json, > + OUT EFI_STRING *Location, > + OUT CHAR8 **Etag > ); >=20 > /** > @@ -420,10 +423,10 @@ CreatePayloadToPostResource ( > **/ > EFI_STATUS > CreatePayloadToPatchResource ( > - IN REDFISH_SERVICE *Service, > - IN REDFISH_PAYLOAD *TargetPayload, > - IN CHAR8 *Json, > - OUT CHAR8 **Etag > + IN REDFISH_SERVICE *Service, > + IN REDFISH_PAYLOAD *TargetPayload, > + IN CHAR8 *Json, > + OUT CHAR8 **Etag > ); >=20 > /** > @@ -456,8 +459,8 @@ RedfisSetRedfishUri ( > **/ > EFI_STRING > GetPropertyFromConfigureLang ( > - IN EFI_STRING ResourceUri, > - IN EFI_STRING ConfigureLang > + IN EFI_STRING ResourceUri, > + IN EFI_STRING ConfigureLang > ); >=20 > /** > @@ -475,10 +478,10 @@ GetPropertyFromConfigureLang ( > **/ > CHAR8 * > GetPropertyStringValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ); >=20 > /** > @@ -496,10 +499,10 @@ GetPropertyStringValue ( > **/ > INT64 * > GetPropertyNumericValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ); >=20 > /** > @@ -516,10 +519,10 @@ GetPropertyNumericValue ( > **/ > BOOLEAN * > GetPropertyBooleanValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ); >=20 > /** > @@ -535,8 +538,8 @@ GetPropertyBooleanValue ( > **/ > BOOLEAN > PropertyChecker ( > - IN VOID *PropertyBuffer, > - IN BOOLEAN ProvisionMode > + IN VOID *PropertyBuffer, > + IN BOOLEAN ProvisionMode > ); >=20 > /** > @@ -583,7 +586,7 @@ GetEtagWithUri ( > **/ > EFI_STRING > GetOdataId ( > - IN REDFISH_PAYLOAD *Payload > + IN REDFISH_PAYLOAD *Payload > ); >=20 > /** > @@ -599,8 +602,8 @@ GetOdataId ( > **/ > EFI_STRING > GetConfigureLang ( > - IN CHAR8 *Uri, > - IN CHAR8 *PropertyName OPTIONAL > + IN CHAR8 *Uri, > + IN CHAR8 *PropertyName OPTIONAL > ); >=20 > /** > @@ -615,7 +618,7 @@ GetConfigureLang ( > **/ > EFI_STRING > RedfishGetUri ( > - IN EFI_STRING ConfigLang > + IN EFI_STRING ConfigLang > ); >=20 > /** > @@ -630,7 +633,7 @@ RedfishGetUri ( > **/ > EFI_STRING > RedfishGetConfigLanguage ( > - IN EFI_STRING Uri > + IN EFI_STRING Uri > ); >=20 > /** > @@ -645,7 +648,7 @@ RedfishGetConfigLanguage ( > **/ > CHAR8 * > StrUnicodeToAscii ( > - IN EFI_STRING UnicodeStr > + IN EFI_STRING UnicodeStr > ); >=20 > /** > @@ -677,9 +680,9 @@ StrAsciiToUnicode ( > **/ > BOOLEAN > CheckEtag ( > - IN EFI_STRING Uri, > - IN CHAR8 *EtagInHeader, > - IN CHAR8 *EtagInJson > + IN EFI_STRING Uri, > + IN CHAR8 *EtagInHeader, > + IN CHAR8 *EtagInJson > ); >=20 > /** > @@ -697,11 +700,11 @@ CheckEtag ( > **/ > CHAR8 ** > GetPropertyStringArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ); >=20 > /** > @@ -719,11 +722,11 @@ GetPropertyStringArrayValue ( > **/ > INT64 * > GetPropertyNumericArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ); >=20 > /** > @@ -741,11 +744,11 @@ GetPropertyNumericArrayValue ( > **/ > BOOLEAN * > GetPropertyBooleanArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ); >=20 > /** > @@ -764,11 +767,11 @@ GetPropertyBooleanArrayValue ( > **/ > RedfishCS_EmptyProp_KeyValue * > GetPropertyVagueValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINT32 *NumberOfValues > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINT32 *NumberOfValues > ); >=20 > /** > @@ -780,7 +783,7 @@ GetPropertyVagueValue ( > **/ > VOID > FreeEmptyPropKeyValueList ( > - RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueListHead > + RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueListHead > ); >=20 > /** > @@ -798,7 +801,7 @@ BOOLEAN > MatchPropertyWithJsonContext ( > IN EFI_STRING Property, > IN CHAR8 *Json > -); > + ); >=20 > /** >=20 > @@ -814,7 +817,7 @@ MatchPropertyWithJsonContext ( > **/ > EFI_STATUS > AddRedfishCharArray ( > - IN OUT RedfishCS_char_Array **Head, > + IN OUT RedfishCS_char_Array **Head, > IN CHAR8 **StringArray, > IN UINTN ArraySize > ); > @@ -833,9 +836,9 @@ AddRedfishCharArray ( > **/ > EFI_STATUS > AddRedfishNumericArray ( > - IN OUT RedfishCS_int64_Array **Head, > - IN INT64 *NumericArray, > - IN UINTN ArraySize > + IN OUT RedfishCS_int64_Array **Head, > + IN INT64 *NumericArray, > + IN UINTN ArraySize > ); >=20 > /** > @@ -856,6 +859,7 @@ AddRedfishBooleanArray ( > IN BOOLEAN *BooleanArray, > IN UINTN ArraySize > ); > + > /** >=20 > Check and see if value in Redfish string array are all the same as the= one > @@ -872,9 +876,9 @@ AddRedfishBooleanArray ( > **/ > BOOLEAN > CompareRedfishStringArrayValues ( > - IN RedfishCS_char_Array *Head, > - IN CHAR8 **StringArray, > - IN UINTN ArraySize > + IN RedfishCS_char_Array *Head, > + IN CHAR8 **StringArray, > + IN UINTN ArraySize > ); >=20 > /** > @@ -893,9 +897,9 @@ CompareRedfishStringArrayValues ( > **/ > BOOLEAN > CompareRedfishNumericArrayValues ( > - IN RedfishCS_int64_Array *Head, > - IN INT64 *NumericArray, > - IN UINTN ArraySize > + IN RedfishCS_int64_Array *Head, > + IN INT64 *NumericArray, > + IN UINTN ArraySize > ); >=20 > /** > @@ -935,10 +939,10 @@ CompareRedfishBooleanArrayValues ( > **/ > BOOLEAN > CompareRedfishPropertyVagueValues ( > - IN RedfishCS_EmptyProp_KeyValue *RedfishVagueKeyValuePtr, > - IN UINT32 RedfishVagueKeyValueNumber, > - IN RedfishCS_EmptyProp_KeyValue *ConfigVagueKeyValuePtr, > - IN UINT32 ConfigVagueKeyValueNumber > + IN RedfishCS_EmptyProp_KeyValue *RedfishVagueKeyValuePtr, > + IN UINT32 RedfishVagueKeyValueNumber, > + IN RedfishCS_EmptyProp_KeyValue *ConfigVagueKeyValuePtr, > + IN UINT32 ConfigVagueKeyValueNumber > ); >=20 > /** > @@ -955,8 +959,8 @@ CompareRedfishPropertyVagueValues ( > **/ > EFI_STATUS > GetEtagAndLocation ( > - IN REDFISH_RESPONSE *Response, > - OUT CHAR8 **Etag, OPTIONAL > + IN REDFISH_RESPONSE *Response, > + OUT CHAR8 **Etag, OPTIONAL > OUT EFI_STRING *Location OPTIONAL > ); >=20 > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > index bfd6fff2a7..ed8a021cf2 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > @@ -2,7 +2,7 @@ > Redfish feature utility library implementation >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> - Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -10,7 +10,7 @@ >=20 > #include "RedfishFeatureUtilityInternal.h" >=20 > -EDKII_REDFISH_ETAG_PROTOCOL *mEtagProtocol =3D NULL; > +EDKII_REDFISH_ETAG_PROTOCOL *mEtagProtocol =3D NULL= ; > EDKII_REDFISH_CONFIG_LANG_MAP_PROTOCOL > *mConfigLangMapProtocol =3D NULL; >=20 > /** > @@ -33,7 +33,7 @@ RedfishLocateProtocol ( > { > EFI_STATUS Status; >=20 > - if (ProtocolInstance =3D=3D NULL || ProtocolGuid =3D=3D NULL) { > + if ((ProtocolInstance =3D=3D NULL) || (ProtocolGuid =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -62,14 +62,14 @@ RedfishLocateProtocol ( > **/ > EFI_STATUS > GetArraykeyFromUri ( > - IN CHAR8 *Uri, > - OUT CHAR8 **ArrayKey > + IN CHAR8 *Uri, > + OUT CHAR8 **ArrayKey > ) > { > - CHAR8 *LeftBracket; > - UINTN Index; > + CHAR8 *LeftBracket; > + UINTN Index; >=20 > - if (IS_EMPTY_STRING (Uri) || ArrayKey =3D=3D NULL) { > + if (IS_EMPTY_STRING (Uri) || (ArrayKey =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -207,19 +207,19 @@ GetEtagWithUri ( > **/ > CHAR8 * > StrUnicodeToAscii ( > - IN EFI_STRING UnicodeStr > + IN EFI_STRING UnicodeStr > ) > { > - CHAR8 *AsciiStr; > - UINTN AsciiStrSize; > - EFI_STATUS Status; > + CHAR8 *AsciiStr; > + UINTN AsciiStrSize; > + EFI_STATUS Status; >=20 > if (IS_EMPTY_STRING (UnicodeStr)) { > return NULL; > } >=20 > AsciiStrSize =3D StrLen (UnicodeStr) + 1; > - AsciiStr =3D AllocatePool (AsciiStrSize); > + AsciiStr =3D AllocatePool (AsciiStrSize); > if (AsciiStr =3D=3D NULL) { > return NULL; > } > @@ -258,7 +258,7 @@ StrAsciiToUnicode ( > } >=20 > UnicodeStrSize =3D (AsciiStrLen (AsciiStr) + 1) * sizeof (CHAR16); > - UnicodeStr =3D AllocatePool (UnicodeStrSize); > + UnicodeStr =3D AllocatePool (UnicodeStrSize); > if (UnicodeStr =3D=3D NULL) { > return NULL; > } > @@ -288,16 +288,16 @@ StrAsciiToUnicode ( > **/ > EFI_STATUS > ApplyFeatureSettingsStringType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN CHAR8 *FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN CHAR8 *FeatureValue > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || FeatureValue =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || (FeatureValue =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -308,9 +308,8 @@ ApplyFeatureSettingsStringType ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_STRING) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > } >=20 > @@ -324,7 +323,12 @@ ApplyFeatureSettingsStringType ( > RedfishValue.Value.Buffer =3D FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %s failed: %r\n", > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -350,14 +354,14 @@ ApplyFeatureSettingsStringType ( > **/ > EFI_STATUS > ApplyFeatureSettingsNumericType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN INTN FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN INTN FeatureValue > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang)) { > return EFI_INVALID_PARAMETER; > @@ -368,11 +372,10 @@ ApplyFeatureSettingsNumericType ( > // > Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLa= ng, > &RedfishValue); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_INTEGER) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not numeric type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not numeric type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > } >=20 > @@ -385,7 +388,12 @@ ApplyFeatureSettingsNumericType ( > RedfishValue.Value.Integer =3D (INT64)FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -411,14 +419,14 @@ ApplyFeatureSettingsNumericType ( > **/ > EFI_STATUS > ApplyFeatureSettingsBooleanType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN BOOLEAN FeatureValue > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN BOOLEAN FeatureValue > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang)) { > return EFI_INVALID_PARAMETER; > @@ -429,11 +437,10 @@ ApplyFeatureSettingsBooleanType ( > // > Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLa= ng, > &RedfishValue); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_BOOLEAN) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not boolean type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not boolean type\n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > } >=20 > @@ -446,7 +453,12 @@ ApplyFeatureSettingsBooleanType ( > RedfishValue.Value.Boolean =3D FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", > __FUNCTION__, ConfigureLang, (FeatureValue ? "True" : "False"), Status)); > } > } else { > @@ -473,23 +485,23 @@ ApplyFeatureSettingsBooleanType ( > **/ > EFI_STATUS > ApplyFeatureSettingsVagueType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > - IN RedfishCS_EmptyProp_KeyValue *VagueValuePtr, > - IN UINT32 NumberOfVagueValues > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > + IN RedfishCS_EmptyProp_KeyValue *VagueValuePtr, > + IN UINT32 NumberOfVagueValues > ) > { > - EFI_STATUS Status; > - UINTN StrSize; > - CHAR8 *ConfigureLangAscii; > - CHAR8 *ConfigureLangKeyAscii; > - EFI_STRING ConfigureKeyLang; > - EDKII_REDFISH_VALUE RedfishValue; > - EDKII_REDFISH_VALUE_TYPES PropertyDatatype; > - RedfishCS_EmptyProp_KeyValue *CurrentVagueValuePtr; > - > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || VagueValuePtr =3D=3D NULL || > NumberOfVagueValues =3D=3D 0) { > + EFI_STATUS Status; > + UINTN StrSize; > + CHAR8 *ConfigureLangAscii; > + CHAR8 *ConfigureLangKeyAscii; > + EFI_STRING ConfigureKeyLang; > + EDKII_REDFISH_VALUE RedfishValue; > + EDKII_REDFISH_VALUE_TYPES PropertyDatatype; > + RedfishCS_EmptyProp_KeyValue *CurrentVagueValuePtr; > + > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || (VagueValuePtr =3D=3D NULL) || > (NumberOfVagueValues =3D=3D 0)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -499,6 +511,7 @@ ApplyFeatureSettingsVagueType ( > DEBUG ((DEBUG_ERROR, "%a, Allocate memory for generate > ConfigureLang of vague key of %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > return Status; > } > + > Status =3D UnicodeStrToAsciiStrS (ConfigureLang, ConfigureLangAscii, S= trLen > (ConfigureLang) + 1); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, Convert the configureLang of vague key of > %a.%a %s failed: %r\n", __FUNCTION__, Schema, Version, ConfigureLang, > Status)); > @@ -510,18 +523,19 @@ ApplyFeatureSettingsVagueType ( > // > // Generate ConfigureLang with the key name > // > - //ConfigureKeyLang =3D GetConfigureLang (ConfigureLangAscii, > CurrentVagueValuePtr->KeyNamePtr); > - StrSize =3D AsciiStrLen (ConfigureLangAscii) + AsciiStrLen > (CurrentVagueValuePtr->KeyNamePtr) + 2; > + // ConfigureKeyLang =3D GetConfigureLang (ConfigureLangAscii, > CurrentVagueValuePtr->KeyNamePtr); > + StrSize =3D AsciiStrLen (ConfigureLangAscii) + AsciiSt= rLen > (CurrentVagueValuePtr->KeyNamePtr) + 2; > ConfigureLangKeyAscii =3D AllocateZeroPool (StrSize); > - ConfigureKeyLang =3D AllocateZeroPool (StrSize * sizeof (CHAR16)); > - if (ConfigureLangKeyAscii =3D=3D NULL || ConfigureKeyLang =3D=3D NUL= L) { > - DEBUG ((DEBUG_ERROR, "%a, Generate ConfigureLang of vague key of > %a.%a %s %a failed!\n", __FUNCTION__, Schema, Version, ConfigureLang, > CurrentVagueValuePtr->KeyNamePtr)); > - goto ErrorContinue; > + ConfigureKeyLang =3D AllocateZeroPool (StrSize * sizeof (CHAR16= )); > + if ((ConfigureLangKeyAscii =3D=3D NULL) || (ConfigureKeyLang =3D=3D = NULL)) { > + DEBUG ((DEBUG_ERROR, "%a, Generate ConfigureLang of vague key of > %a.%a %s %a failed!\n", __FUNCTION__, Schema, Version, ConfigureLang, > CurrentVagueValuePtr->KeyNamePtr)); > + goto ErrorContinue; > } > - AsciiStrCatS(ConfigureLangKeyAscii, StrSize, ConfigureLangAscii); > - AsciiStrCatS(ConfigureLangKeyAscii, StrSize, "/"); > - AsciiStrCatS(ConfigureLangKeyAscii, StrSize, CurrentVagueValuePtr- > >KeyNamePtr); > - AsciiStrToUnicodeStrS(ConfigureLangKeyAscii, ConfigureKeyLang, StrSi= ze); > + > + AsciiStrCatS (ConfigureLangKeyAscii, StrSize, ConfigureLangAscii); > + AsciiStrCatS (ConfigureLangKeyAscii, StrSize, "/"); > + AsciiStrCatS (ConfigureLangKeyAscii, StrSize, CurrentVagueValuePtr- > >KeyNamePtr); > + AsciiStrToUnicodeStrS (ConfigureLangKeyAscii, ConfigureKeyLang, > StrSize); > FreePool (ConfigureLangKeyAscii); > ConfigureLangKeyAscii =3D NULL; > // > @@ -534,7 +548,7 @@ ApplyFeatureSettingsVagueType ( > } else if (CurrentVagueValuePtr->Value->DataType =3D=3D > RedfishCS_Vague_DataType_Int64) { > PropertyDatatype =3D REDFISH_VALUE_TYPE_INTEGER; > } else { > - DEBUG((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property > data type\n", __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property > data type\n", __FUNCTION__, Schema, Version, ConfigureLang)); > goto ErrorContinue; > } >=20 > @@ -546,9 +560,10 @@ ApplyFeatureSettingsVagueType ( > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureKeyLang, Status)); > } else { > if (RedfishValue.Type !=3D PropertyDatatype) { > - DEBUG((DEBUG_ERROR, "%a, %a.%a %s mismatched data type\n", > __FUNCTION__, Schema, Version, ConfigureKeyLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s mismatched data type\n", > __FUNCTION__, Schema, Version, ConfigureKeyLang)); > goto ErrorContinue; > } > + > if (PropertyDatatype =3D=3D REDFISH_VALUE_TYPE_STRING) { > // > // This is a string property. > @@ -560,8 +575,13 @@ ApplyFeatureSettingsVagueType ( > DEBUG ((DEBUG_INFO, "%a, %a.%a apply %s from %a to %a\n", > __FUNCTION__, Schema, Version, ConfigureKeyLang, > RedfishValue.Value.Buffer, CurrentVagueValuePtr->Value- > >DataValue.CharPtr)); > FreePool (RedfishValue.Value.Buffer); > RedfishValue.Value.Buffer =3D CurrentVagueValuePtr->Value- > >DataValue.CharPtr; > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + Status =3D RedfishPlatformConfigSetValue (S= chema, Version, > ConfigureKeyLang, RedfishValue); > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %a to %a failed: %r\n", > __FUNCTION__, ConfigureKeyLang, CurrentVagueValuePtr->Value- > >DataValue.CharPtr, Status)); > } > } else { > @@ -575,17 +595,25 @@ ApplyFeatureSettingsVagueType ( > // > // Apply settings from redfish > // > - DEBUG ((DEBUG_INFO, "%a, %a.%a apply %s from %a to %a\n", > - __FUNCTION__, > - Schema, > - Version, > - ConfigureKeyLang, > - (RedfishValue.Value.Boolean ? "True" : "False"), > - (*CurrentVagueValuePtr->Value->DataValue.BoolPtr ? "Tr= ue" : > "False"))); > + DEBUG (( > + DEBUG_INFO, > + "%a, %a.%a apply %s from %a to %a\n", > + __FUNCTION__, > + Schema, > + Version, > + ConfigureKeyLang, > + (RedfishValue.Value.Boolean ? "True" : "False"), > + (*CurrentVagueValuePtr->Value->DataValue.BoolPtr ? "True" : > "False") > + )); >=20 > RedfishValue.Value.Boolean =3D (BOOLEAN)*CurrentVagueValuePtr- > >Value->DataValue.BoolPtr; > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + Status =3D RedfishPlatformConfigSetValue (= Schema, Version, > ConfigureKeyLang, RedfishValue); > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", > __FUNCTION__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value- > >DataValue.BoolPtr ? "True" : "False"), Status)); > } > } else { > @@ -602,15 +630,20 @@ ApplyFeatureSettingsVagueType ( > DEBUG ((DEBUG_INFO, "%a, %a.%a apply %s from 0x%x to 0x%x\n", > __FUNCTION__, Schema, Version, ConfigureKeyLang, > RedfishValue.Value.Integer, *CurrentVagueValuePtr->Value- > >DataValue.Int64Ptr)); >=20 > RedfishValue.Value.Integer =3D (INT64)*CurrentVagueValuePtr->V= alue- > >DataValue.Int64Ptr; > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + Status =3D RedfishPlatformConfigSetValue (= Schema, Version, > ConfigureKeyLang, RedfishValue); > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", > __FUNCTION__, ConfigureKeyLang, *CurrentVagueValuePtr->Value- > >DataValue.Int64Ptr, Status)); > } > } else { > DEBUG ((DEBUG_INFO, "%a, %a.%a %s value is: 0x%x\n", > __FUNCTION__, Schema, Version, ConfigureKeyLang, > RedfishValue.Value.Integer, Status)); > } > } else { > - DEBUG((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property > data type\n", __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish > property data type\n", __FUNCTION__, Schema, Version, ConfigureLang)); > goto ErrorContinue; > } > } > @@ -620,22 +653,27 @@ ErrorContinue:; > FreePool (ConfigureLangKeyAscii); > ConfigureLangKeyAscii =3D NULL; > } > + > if (ConfigureKeyLang !=3D NULL) { > FreePool (ConfigureKeyLang); > ConfigureKeyLang =3D NULL; > } > + > CurrentVagueValuePtr =3D CurrentVagueValuePtr->NextKeyValuePtr; > - }; > + } >=20 > if (ConfigureLangAscii !=3D NULL) { > FreePool (ConfigureLangAscii); > } > + > if (ConfigureLangKeyAscii !=3D NULL) { > FreePool (ConfigureLangKeyAscii); > } > + > if (ConfigureKeyLang !=3D NULL) { > FreePool (ConfigureKeyLang); > } > + > return EFI_SUCCESS; > } >=20 > @@ -648,16 +686,16 @@ ErrorContinue:; > **/ > VOID > FreeArrayTypeRedfishValue ( > - EDKII_REDFISH_VALUE *RedfishValue > + EDKII_REDFISH_VALUE *RedfishValue > ) > { > - UINTN Index; > + UINTN Index; >=20 > if (RedfishValue =3D=3D NULL) { > return; > } >=20 > - if (RedfishValue->Type !=3D REDFISH_VALUE_TYPE_INTEGER_ARRAY && > RedfishValue->Type !=3D REDFISH_VALUE_TYPE_STRING_ARRAY) { > + if ((RedfishValue->Type !=3D REDFISH_VALUE_TYPE_INTEGER_ARRAY) && > (RedfishValue->Type !=3D REDFISH_VALUE_TYPE_STRING_ARRAY)) { > return; > } >=20 > @@ -666,6 +704,7 @@ FreeArrayTypeRedfishValue ( > for (Index =3D 0; Index < RedfishValue->ArrayCount; Index++) { > FreePool (RedfishValue->Value.StringArray[Index]); > } > + > FreePool (RedfishValue->Value.StringArray); > RedfishValue->Value.StringArray =3D NULL; > break; > @@ -687,7 +726,6 @@ FreeArrayTypeRedfishValue ( > RedfishValue->ArrayCount =3D 0; > } >=20 > - > /** >=20 > Apply property value to UEFI HII database in string array type. > @@ -714,7 +752,7 @@ ApplyFeatureSettingsStringArrayType ( > UINTN Index; > RedfishCS_char_Array *Buffer; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || ArrayHead =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || (ArrayHead =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -725,9 +763,8 @@ ApplyFeatureSettingsStringArrayType ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_STRING_ARRAY) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type= \n", > __FUNCTION__, Schema, Version, ConfigureLang)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > } >=20 > @@ -745,10 +782,10 @@ ApplyFeatureSettingsStringArrayType ( > // Convert array from RedfishCS_char_Array to EDKII_REDFISH_VALUE > // > RedfishValue.ArrayCount =3D 0; > - Buffer =3D ArrayHead; > + Buffer =3D ArrayHead; > while (Buffer !=3D NULL) { > RedfishValue.ArrayCount +=3D 1; > - Buffer =3D Buffer->Next; > + Buffer =3D Buffer->Next; > } >=20 > // > @@ -761,13 +798,14 @@ ApplyFeatureSettingsStringArrayType ( > } >=20 > Buffer =3D ArrayHead; > - Index =3D 0; > + Index =3D 0; > while (Buffer !=3D NULL) { > RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (Asci= iStrSize > (Buffer->ArrayValue), Buffer->ArrayValue); > if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { > ASSERT (FALSE); > return EFI_OUT_OF_RESOURCES; > } > + > Buffer =3D Buffer->Next; > Index++; > } > @@ -775,7 +813,12 @@ ApplyFeatureSettingsStringArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -801,18 +844,18 @@ ApplyFeatureSettingsStringArrayType ( > **/ > EFI_STATUS > ApplyFeatureSettingsNumericArrayType ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING ConfigureLang, > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING ConfigureLang, > IN RedfishCS_int64_Array *ArrayHead > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - UINTN Index; > - RedfishCS_int64_Array *Buffer; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + UINTN Index; > + RedfishCS_int64_Array *Buffer; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || ArrayHead =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || (ArrayHead =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -823,7 +866,6 @@ ApplyFeatureSettingsNumericArrayType ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_INTEGER_ARRAY) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > @@ -843,10 +885,10 @@ ApplyFeatureSettingsNumericArrayType ( > // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > // > RedfishValue.ArrayCount =3D 0; > - Buffer =3D ArrayHead; > + Buffer =3D ArrayHead; > while (Buffer !=3D NULL) { > RedfishValue.ArrayCount +=3D 1; > - Buffer =3D Buffer->Next; > + Buffer =3D Buffer->Next; > } >=20 > // > @@ -859,17 +901,22 @@ ApplyFeatureSettingsNumericArrayType ( > } >=20 > Buffer =3D ArrayHead; > - Index =3D 0; > + Index =3D 0; > while (Buffer !=3D NULL) { > RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->Array= Value; > - Buffer =3D Buffer->Next; > + Buffer =3D Buffer->Next; > Index++; > } >=20 > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -904,9 +951,9 @@ ApplyFeatureSettingsBooleanArrayType ( > EFI_STATUS Status; > EDKII_REDFISH_VALUE RedfishValue; > UINTN Index; > - RedfishCS_bool_Array *Buffer; > + RedfishCS_bool_Array *Buffer; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || ArrayHead =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || (ArrayHead =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -917,7 +964,6 @@ ApplyFeatureSettingsBooleanArrayType ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __FUNCTION__, > Schema, Version, ConfigureLang, Status)); > } else { > - > if (RedfishValue.Type !=3D REDFISH_VALUE_TYPE_BOOLEAN_ARRAY) { > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __FUNCTION__, Schema, Version, ConfigureLang)); > return EFI_DEVICE_ERROR; > @@ -937,10 +983,10 @@ ApplyFeatureSettingsBooleanArrayType ( > // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > // > RedfishValue.ArrayCount =3D 0; > - Buffer =3D ArrayHead; > + Buffer =3D ArrayHead; > while (Buffer !=3D NULL) { > RedfishValue.ArrayCount +=3D 1; > - Buffer =3D Buffer->Next; > + Buffer =3D Buffer->Next; > } >=20 > // > @@ -953,17 +999,22 @@ ApplyFeatureSettingsBooleanArrayType ( > } >=20 > Buffer =3D ArrayHead; > - Index =3D 0; > + Index =3D 0; > while (Buffer !=3D NULL) { > RedfishValue.Value.BooleanArray[Index] =3D (BOOLEAN)*Buffer- > >ArrayValue; > - Buffer =3D Buffer->Next; > + Buffer =3D Buffer->Next; > Index++; > } >=20 > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT (); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -988,15 +1039,15 @@ ApplyFeatureSettingsBooleanArrayType ( > **/ > EFI_STATUS > GetResourceByUri ( > - IN REDFISH_SERVICE *Service, > - IN EFI_STRING ResourceUri, > - OUT REDFISH_RESPONSE *Response > + IN REDFISH_SERVICE *Service, > + IN EFI_STRING ResourceUri, > + OUT REDFISH_RESPONSE *Response > ) > { > EFI_STATUS Status; > CHAR8 *AsciiResourceUri; >=20 > - if (Service =3D=3D NULL || Response =3D=3D NULL || IS_EMPTY_STRING > (ResourceUri)) { > + if ((Service =3D=3D NULL) || (Response =3D=3D NULL) || IS_EMPTY_STRING > (ResourceUri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -1051,9 +1102,9 @@ GetResourceByUri ( > **/ > EFI_STATUS > IsRedpathArray ( > - IN EFI_STRING ConfigureLang, > - OUT EFI_STRING *ArraySignatureOpen OPTIONAL, > - OUT EFI_STRING *ArraySignatureClose OPTIONAL > + IN EFI_STRING ConfigureLang, > + OUT EFI_STRING *ArraySignatureOpen OPTIONAL, > + OUT EFI_STRING *ArraySignatureClose OPTIONAL > ) > { > CHAR16 *IndexString; > @@ -1061,9 +1112,11 @@ IsRedpathArray ( > if (ConfigureLang =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } > + > if (ArraySignatureOpen !=3D NULL) { > *ArraySignatureOpen =3D NULL; > } > + > if (ArraySignatureClose !=3D NULL) { > *ArraySignatureClose =3D NULL; > } > @@ -1076,6 +1129,7 @@ IsRedpathArray ( > if (ArraySignatureOpen !=3D NULL) { > *ArraySignatureOpen =3D IndexString; > } > + > // > // Skip "{" > // > @@ -1087,11 +1141,14 @@ IsRedpathArray ( > if (IndexString =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } > + > if (ArraySignatureClose !=3D NULL) { > *ArraySignatureClose =3D IndexString; > } > + > return EFI_SUCCESS; > } > + > return EFI_NOT_FOUND; > } >=20 > @@ -1106,23 +1163,25 @@ IsRedpathArray ( > **/ > UINTN > GetNumberOfRedpathNodes ( > - IN EFI_STRING NodeString > + IN EFI_STRING NodeString > ) > { > - UINTN Index; > - UINTN NumberNodes; > - UINTN StringLen; > + UINTN Index; > + UINTN NumberNodes; > + UINTN StringLen; >=20 > NumberNodes =3D 0; > - StringLen =3D StrLen (NodeString); > - Index =3D 1; // ConfigLang always starts with '/'. > + StringLen =3D StrLen (NodeString); > + Index =3D 1; // ConfigLang always starts with '/'. > while (Index < StringLen) { > if (*(NodeString + Index) =3D=3D L'/') { > - NumberNodes ++; > + NumberNodes++; > } > - Index ++; > - }; > - NumberNodes ++; > + > + Index++; > + } > + > + NumberNodes++; >=20 > return (NumberNodes); > } > @@ -1141,24 +1200,25 @@ GetNumberOfRedpathNodes ( > **/ > EFI_STRING > GetRedpathNodeByIndex ( > - IN EFI_STRING NodeString, > - IN UINTN Index, > - OUT EFI_STRING *EndOfNodePtr OPTIONAL > + IN EFI_STRING NodeString, > + IN UINTN Index, > + OUT EFI_STRING *EndOfNodePtr OPTIONAL > ) > { > - UINTN NumberNodes; > - UINTN StringLen; > - UINTN StringIndex; > - EFI_STRING NodeStart; > - EFI_STRING NodeEnd; > + UINTN NumberNodes; > + UINTN StringLen; > + UINTN StringIndex; > + EFI_STRING NodeStart; > + EFI_STRING NodeEnd; >=20 > NumberNodes =3D 0; > - StringLen =3D StrLen (NodeString); > + StringLen =3D StrLen (NodeString); > StringIndex =3D 1; // ConfigLang always starts with '/'. > - NodeStart =3D NodeString; > + NodeStart =3D NodeString; > if (EndOfNodePtr !=3D NULL) { > *EndOfNodePtr =3D NULL; > } > + > while (StringIndex < StringLen) { > if (*(NodeString + StringIndex) =3D=3D L'/') { > NodeEnd =3D NodeString + StringIndex - 1; > @@ -1166,14 +1226,17 @@ GetRedpathNodeByIndex ( > if (EndOfNodePtr !=3D NULL) { > *EndOfNodePtr =3D NodeEnd; > } > + > return NodeStart; > } else { > NodeStart =3D NodeString + StringIndex + 1; > } > } > - StringIndex ++; > - }; > - return (NULL); > + > + StringIndex++; > + } > + > + return (NULL); > } >=20 > /** > @@ -1192,18 +1255,18 @@ GetRedpathNodeByIndex ( > **/ > EFI_STATUS > GetArrayIndexFromArrayTypeConfigureLang ( > - IN CHAR16 *ConfigureLang, > - OUT CHAR16 **UnifiedConfigureLang, > - OUT UINTN *Index > + IN CHAR16 *ConfigureLang, > + OUT CHAR16 **UnifiedConfigureLang, > + OUT UINTN *Index > ) > { > - EFI_STATUS Status; > - CHAR16 *TmpConfigureLang; > - CHAR16 *ArrayOpenStr; > - CHAR16 *ArrayCloseStr; > - INTN StringIndex; > + EFI_STATUS Status; > + CHAR16 *TmpConfigureLang; > + CHAR16 *ArrayOpenStr; > + CHAR16 *ArrayCloseStr; > + INTN StringIndex; >=20 > - if (ConfigureLang =3D=3D NULL || UnifiedConfigureLang =3D=3D NULL || I= ndex =3D=3D > NULL) { > + if ((ConfigureLang =3D=3D NULL) || (UnifiedConfigureLang =3D=3D NULL) = || (Index > =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -1227,28 +1290,30 @@ GetArrayIndexFromArrayTypeConfigureLang ( > // > // Resotre the '}' character and remove rest of string. > // > - ArrayCloseStr[0] =3D L'}'; > - ArrayCloseStr[1] =3D '\0'; > + ArrayCloseStr[0] =3D L'}'; > + ArrayCloseStr[1] =3D '\0'; > *UnifiedConfigureLang =3D TmpConfigureLang; > } else { > if (Status =3D=3D EFI_NOT_FOUND) { > // > // This is not the redpath array. Search "/" for the parent root. > // > - *Index =3D 0; > + *Index =3D 0; > StringIndex =3D StrLen (TmpConfigureLang) - 1; > while (StringIndex >=3D 0 && *(TmpConfigureLang + StringIndex) != =3D '/') { > - StringIndex --; > - }; > + StringIndex--; > + } > + > if (StringIndex >=3D 0 ) { > *(TmpConfigureLang + StringIndex) =3D '\0'; > - *UnifiedConfigureLang =3D TmpConfigureLang; > - Status =3D EFI_SUCCESS; > + *UnifiedConfigureLang =3D TmpConfigureLang; > + Status =3D EFI_SUCCESS; > } else { > Status =3D EFI_INVALID_PARAMETER; > } > } > } > + > return Status; > } >=20 > @@ -1265,27 +1330,30 @@ GetArrayIndexFromArrayTypeConfigureLang ( > **/ > EFI_STATUS > CopyConfiglanguageList ( > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *SourceConfigureLangList, > - OUT REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *DestConfigureLangList > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *SourceConfigureLangList, > + OUT REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *DestConfigureLangList > ) > { > - UINTN Index; > + UINTN Index; >=20 > - if (SourceConfigureLangList =3D=3D NULL || DestConfigureLangList =3D= =3D NULL) { > + if ((SourceConfigureLangList =3D=3D NULL) || (DestConfigureLangList = =3D=3D NULL)) > { > return EFI_INVALID_PARAMETER; > } > + > DestConfigureLangList->Count =3D SourceConfigureLangList->Count; > - DestConfigureLangList->List =3D > - (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *)AllocateZeroPool > (sizeof (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG) * > DestConfigureLangList->Count); > + DestConfigureLangList->List =3D > + (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *)AllocateZeroPool > (sizeof (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG) * > DestConfigureLangList->Count); > if (DestConfigureLangList->List =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for > REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG.\n", __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } > + > for (Index =3D 0; Index < SourceConfigureLangList->Count; Index++) { > - DestConfigureLangList->List [Index].Index =3D SourceConfigureLangLis= t- > >List[Index].Index; > - DestConfigureLangList->List [Index].ConfigureLang =3D > - (EFI_STRING)AllocateCopyPool(StrSize(SourceConfigureLangList- > >List[Index].ConfigureLang), (VOID *)SourceConfigureLangList- > >List[Index].ConfigureLang); > + DestConfigureLangList->List[Index].Index =3D SourceConfigure= LangList- > >List[Index].Index; > + DestConfigureLangList->List[Index].ConfigureLang =3D > + (EFI_STRING)AllocateCopyPool (StrSize (SourceConfigureLangList- > >List[Index].ConfigureLang), (VOID *)SourceConfigureLangList- > >List[Index].ConfigureLang); > } > + > return EFI_SUCCESS; > } >=20 > @@ -1300,39 +1368,45 @@ CopyConfiglanguageList ( > **/ > UINTN > ConfiglanguageGetInstanceIndex ( > - IN EFI_STRING ConfigureLang > + IN EFI_STRING ConfigureLang > ) > { > - INTN LeftBracketIndex; > - INTN RightBracketIndex; > - INTN Index; > - UINT64 Instance; > - EFI_STATUS Status; > + INTN LeftBracketIndex; > + INTN RightBracketIndex; > + INTN Index; > + UINT64 Instance; > + EFI_STATUS Status; >=20 > if (ConfigureLang =3D=3D NULL) { > return 0; > } > - LeftBracketIndex =3D 0; > + > + LeftBracketIndex =3D 0; > RightBracketIndex =3D 0; > - Index =3D StrLen (ConfigureLang) - 1; > + Index =3D StrLen (ConfigureLang) - 1; > while (Index >=3D 0) { > if (*(ConfigureLang + Index) =3D=3D L'{') { > LeftBracketIndex =3D Index; > break; > } > + > if (*(ConfigureLang + Index) =3D=3D L'}') { > RightBracketIndex =3D Index; > } > - Index --; > - }; > + > + Index--; > + } > + > if ((RightBracketIndex - LeftBracketIndex) <=3D 1) { > return 0; > } > + > *(ConfigureLang + RightBracketIndex) =3D 0; > - Status =3D StrDecimalToUint64S (ConfigureLang + LeftBracketIndex + 1, = NULL, > &Instance); > - if (EFI_ERROR(Status)) { > + Status =3D StrDecimalToUint64S (Configur= eLang + > LeftBracketIndex + 1, NULL, &Instance); > + if (EFI_ERROR (Status)) { > Instance =3D 0; > } > + > // > // Restore right curly bracket. > // > @@ -1353,20 +1427,22 @@ ConfiglanguageGetInstanceIndex ( > **/ > EFI_STATUS > DestroyConfiglanguageList ( > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *ConfigureLangList > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *ConfigureLangList > ) > { > - UINTN Index; > + UINTN Index; >=20 > if (ConfigureLangList =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } > + > if (ConfigureLangList->List !=3D NULL) { > for (Index =3D 0; Index < ConfigureLangList->Count; Index++) { > - if (ConfigureLangList->List [Index].ConfigureLang !=3D NULL) { > - FreePool (ConfigureLangList->List [Index].ConfigureLang); > + if (ConfigureLangList->List[Index].ConfigureLang !=3D NULL) { > + FreePool (ConfigureLangList->List[Index].ConfigureLang); > } > } > + > FreePool (ConfigureLangList->List); > ConfigureLangList->List =3D NULL; > } > @@ -1391,56 +1467,60 @@ DestroyConfiglanguageList ( > **/ > EFI_STATUS > SetResourceConfigLangMemberInstance ( > - IN EFI_STRING *DestConfigLang, > - IN UINTN MaxtLengthConfigLang, > - IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > + IN EFI_STRING *DestConfigLang, > + IN UINTN MaxtLengthConfigLang, > + IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > ) > { > - EFI_STRING ThisConfigLang; > - EFI_STRING NewConfigLang; > - CHAR16 InstanceStr [10]; > - INTN Index; > - UINTN Length; > - UINTN MaxStrLength; > - > - if (DestConfigLang =3D=3D NULL || ConfigLangInstance =3D=3D NULL) { > + EFI_STRING ThisConfigLang; > + EFI_STRING NewConfigLang; > + CHAR16 InstanceStr[10]; > + INTN Index; > + UINTN Length; > + UINTN MaxStrLength; > + > + if ((DestConfigLang =3D=3D NULL) || (ConfigLangInstance =3D=3D NULL)) = { > return EFI_INVALID_PARAMETER; > } > + > UnicodeSPrint ((CHAR16 *)&InstanceStr, 10, L"%d", ConfigLangInstance- > >Index); >=20 > ThisConfigLang =3D *DestConfigLang; > - if (ThisConfigLang [0] =3D=3D 0) { > + if (ThisConfigLang[0] =3D=3D 0) { > // > // Return ConfigLangInstance->ConfigureLang > // > if (ConfigLangInstance->ConfigureLang =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } else { > - StrCatS(*DestConfigLang, MaxtLengthConfigLang, ConfigLangInstance- > >ConfigureLang); > + StrCatS (*DestConfigLang, MaxtLengthConfigLang, ConfigLangInstance= - > >ConfigureLang); > return EFI_SUCCESS; > } > } >=20 > - MaxStrLength =3D StrSize (ThisConfigLang) + StrSize > ((EFI_STRING)&InstanceStr); > + MaxStrLength =3D StrSize (ThisConfigLang) + StrSize > ((EFI_STRING)&InstanceStr); > NewConfigLang =3D ThisConfigLang; > if (MaxtLengthConfigLang < MaxStrLength) { > - NewConfigLang =3D (EFI_STRING)AllocateZeroPool(MaxStrLength); > + NewConfigLang =3D (EFI_STRING)AllocateZeroPool (MaxStrLength); > if (NewConfigLang =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for > NewConfigLang.\n", __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } > } > + > // > // Search the last "{" > // > Index =3D StrLen (ThisConfigLang) - 1; > while ((ThisConfigLang[Index] !=3D '{') && (Index >=3D 0)) { > - Index --; > - }; > + Index--; > + } > + > if (Index =3D=3D -1) { > if (NewConfigLang !=3D ThisConfigLang) { > - FreePool(NewConfigLang); > + FreePool (NewConfigLang); > } > + > return EFI_NOT_FOUND; > } >=20 > @@ -1449,15 +1529,17 @@ SetResourceConfigLangMemberInstance ( > // > Length =3D 0; > while (Index >=3D 0) { > - NewConfigLang [Index] =3D ThisConfigLang[Index]; > - Index --; > - Length ++; > - }; > + NewConfigLang[Index] =3D ThisConfigLang[Index]; > + Index--; > + Length++; > + } > + > UnicodeSPrint ((CHAR16 *)(NewConfigLang + Length), MaxStrLength, > L"%d", ConfigLangInstance->Index); > StrCatS (NewConfigLang, MaxStrLength, L"}"); > if (NewConfigLang !=3D ThisConfigLang) { > FreePool (ThisConfigLang); > } > + > *DestConfigLang =3D NewConfigLang; > return EFI_SUCCESS; > } > @@ -1478,28 +1560,28 @@ SetResourceConfigLangMemberInstance ( > **/ > EFI_STATUS > RedfishFeatureGetUnifiedArrayTypeConfigureLang ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING Pattern, OPTIONAL > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING Pattern, OPTIONAL > OUT REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > *UnifiedConfigureLangList > ) > { > - EFI_STATUS Status; > - EFI_STRING *ConfigureLangList; > - UINTN Count; > - UINTN Index; > - UINTN Index2; > - UINTN ArrayIndex; > - EFI_STRING UnifiedConfigureLang; > - BOOLEAN Duplicated; > - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > UnifiedConfigureLangPool[BIOS_CONFIG_TO_REDFISH_REDPATH_POOL_SIZ > E]; > - > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > UnifiedConfigureLangList =3D=3D NULL) { > + EFI_STATUS Status; > + EFI_STRING *ConfigureLangList; > + UINTN Count; > + UINTN Index; > + UINTN Index2; > + UINTN ArrayIndex; > + EFI_STRING UnifiedConfigureLang; > + BOOLEAN Duplicated; > + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > UnifiedConfigureLangPool[BIOS_CONFIG_TO_REDFISH_REDPATH_POOL_SIZ > E]; > + > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > (UnifiedConfigureLangList =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > UnifiedConfigureLangList->Count =3D 0; > - UnifiedConfigureLangList->List =3D NULL; > + UnifiedConfigureLangList->List =3D NULL; > ZeroMem (UnifiedConfigureLangPool, sizeof (UnifiedConfigureLangPool)); >=20 > Status =3D RedfishPlatformConfigGetConfigureLang (Schema, Version, > Pattern, &ConfigureLangList, &Count); > @@ -1514,7 +1596,7 @@ RedfishFeatureGetUnifiedArrayTypeConfigureLang > ( >=20 > for (Index =3D 0; Index < Count; Index++) { > Status =3D GetArrayIndexFromArrayTypeConfigureLang > (ConfigureLangList[Index], &UnifiedConfigureLang, &ArrayIndex); > - if (EFI_ERROR (Status) && Status =3D=3D EFI_INVALID_PARAMETER) { > + if (EFI_ERROR (Status) && (Status =3D=3D EFI_INVALID_PARAMETER)) { > ASSERT (FALSE); > continue; > } > @@ -1550,7 +1632,7 @@ RedfishFeatureGetUnifiedArrayTypeConfigureLang > ( > // >=20 > UnifiedConfigureLangPool[UnifiedConfigureLangList- > >Count].ConfigureLang =3D UnifiedConfigureLang; > - UnifiedConfigureLangPool[UnifiedConfigureLangList->Count].Index =3D > ArrayIndex; > + UnifiedConfigureLangPool[UnifiedConfigureLangList->Count].Index = =3D > ArrayIndex; > ++UnifiedConfigureLangList->Count; > } >=20 > @@ -1578,23 +1660,23 @@ > RedfishFeatureGetUnifiedArrayTypeConfigureLang ( > **/ > EFI_STATUS > GetEtagAndLocation ( > - IN REDFISH_RESPONSE *Response, > - OUT CHAR8 **Etag, OPTIONAL > + IN REDFISH_RESPONSE *Response, > + OUT CHAR8 **Etag, OPTIONAL > OUT EFI_STRING *Location OPTIONAL > ) > { > - EDKII_JSON_VALUE JsonValue; > - EDKII_JSON_VALUE OdataValue; > - CHAR8 *OdataString; > - CHAR8 *AsciiLocation; > - EFI_HTTP_HEADER *Header; > - EFI_STATUS Status; > + EDKII_JSON_VALUE JsonValue; > + EDKII_JSON_VALUE OdataValue; > + CHAR8 *OdataString; > + CHAR8 *AsciiLocation; > + EFI_HTTP_HEADER *Header; > + EFI_STATUS Status; >=20 > if (Response =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > - if (Etag =3D=3D NULL && Location =3D=3D NULL) { > + if ((Etag =3D=3D NULL) && (Location =3D=3D NULL)) { > return EFI_SUCCESS; > } >=20 > @@ -1614,7 +1696,7 @@ GetEtagAndLocation ( > // > // No header is returned. Search payload for location. > // > - if (*Etag =3D=3D NULL && Response->Payload !=3D NULL) { > + if ((*Etag =3D=3D NULL) && (Response->Payload !=3D NULL)) { > JsonValue =3D RedfishJsonInPayload (Response->Payload); > if (JsonValue !=3D NULL) { > OdataValue =3D JsonObjectGetValue (JsonValueGetObject (JsonValue= ), > "@odata.etag"); > @@ -1649,7 +1731,7 @@ GetEtagAndLocation ( > // > // No header is returned. Search payload for location. > // > - if (*Location =3D=3D NULL && Response->Payload !=3D NULL) { > + if ((*Location =3D=3D NULL) && (Response->Payload !=3D NULL)) { > JsonValue =3D RedfishJsonInPayload (Response->Payload); > if (JsonValue !=3D NULL) { > OdataValue =3D JsonObjectGetValue (JsonValueGetObject (JsonValue= ), > "@odata.id"); > @@ -1675,6 +1757,7 @@ GetEtagAndLocation ( >=20 > return Status; > } > + > /** >=20 > Create HTTP payload and send them to redfish service with PATCH method= . > @@ -1690,25 +1773,25 @@ GetEtagAndLocation ( > **/ > EFI_STATUS > CreatePayloadToPatchResource ( > - IN REDFISH_SERVICE *Service, > - IN REDFISH_PAYLOAD *TargetPayload, > - IN CHAR8 *Json, > - OUT CHAR8 **Etag > + IN REDFISH_SERVICE *Service, > + IN REDFISH_PAYLOAD *TargetPayload, > + IN CHAR8 *Json, > + OUT CHAR8 **Etag > ) > { > - REDFISH_PAYLOAD Payload; > - EDKII_JSON_VALUE ResourceJsonValue; > - REDFISH_RESPONSE PostResponse; > - EFI_STATUS Status; > + REDFISH_PAYLOAD Payload; > + EDKII_JSON_VALUE ResourceJsonValue; > + REDFISH_RESPONSE PostResponse; > + EFI_STATUS Status; >=20 > - if (Service =3D=3D NULL || TargetPayload =3D=3D NULL || IS_EMPTY_STRIN= G (Json) > || Etag =3D=3D NULL) { > + if ((Service =3D=3D NULL) || (TargetPayload =3D=3D NULL) || IS_EMPTY_S= TRING > (Json) || (Etag =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > ResourceJsonValue =3D JsonLoadString (Json, 0, NULL); > - Payload =3D RedfishCreatePayload (ResourceJsonValue, Service); > + Payload =3D RedfishCreatePayload (ResourceJsonValue, Service= ); > if (Payload =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "%a:%d Failed to create JSON payload from > JSON value!\n",__FUNCTION__, __LINE__)); > + DEBUG ((DEBUG_ERROR, "%a:%d Failed to create JSON payload from > JSON value!\n", __FUNCTION__, __LINE__)); > Status =3D EFI_DEVICE_ERROR; > goto EXIT_FREE_JSON_VALUE; > } > @@ -1716,7 +1799,7 @@ CreatePayloadToPatchResource ( > ZeroMem (&PostResponse, sizeof (REDFISH_RESPONSE)); > Status =3D RedfishPatchToPayload (TargetPayload, Payload, &PostRespons= e); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a:%d Failed to PATCH payload to Redfish > service.\n",__FUNCTION__, __LINE__)); > + DEBUG ((DEBUG_ERROR, "%a:%d Failed to PATCH payload to Redfish > service.\n", __FUNCTION__, __LINE__)); > goto EXIT_FREE_JSON_VALUE; > } >=20 > @@ -1761,26 +1844,26 @@ EXIT_FREE_JSON_VALUE: > **/ > EFI_STATUS > CreatePayloadToPostResource ( > - IN REDFISH_SERVICE *Service, > - IN REDFISH_PAYLOAD *TargetPayload, > - IN CHAR8 *Json, > - OUT EFI_STRING *Location, > - OUT CHAR8 **Etag > + IN REDFISH_SERVICE *Service, > + IN REDFISH_PAYLOAD *TargetPayload, > + IN CHAR8 *Json, > + OUT EFI_STRING *Location, > + OUT CHAR8 **Etag > ) > { > - REDFISH_PAYLOAD Payload; > - EDKII_JSON_VALUE ResourceJsonValue; > - REDFISH_RESPONSE PostResponse; > - EFI_STATUS Status; > + REDFISH_PAYLOAD Payload; > + EDKII_JSON_VALUE ResourceJsonValue; > + REDFISH_RESPONSE PostResponse; > + EFI_STATUS Status; >=20 > - if (Service =3D=3D NULL || TargetPayload =3D=3D NULL || IS_EMPTY_STRIN= G (Json) > || Location =3D=3D NULL || Etag =3D=3D NULL) { > + if ((Service =3D=3D NULL) || (TargetPayload =3D=3D NULL) || IS_EMPTY_S= TRING > (Json) || (Location =3D=3D NULL) || (Etag =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > ResourceJsonValue =3D JsonLoadString (Json, 0, NULL); > - Payload =3D RedfishCreatePayload (ResourceJsonValue, Service); > + Payload =3D RedfishCreatePayload (ResourceJsonValue, Service= ); > if (Payload =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "%a:%d Failed to create JSON payload from > JSON value!\n",__FUNCTION__, __LINE__)); > + DEBUG ((DEBUG_ERROR, "%a:%d Failed to create JSON payload from > JSON value!\n", __FUNCTION__, __LINE__)); > Status =3D EFI_DEVICE_ERROR; > goto EXIT_FREE_JSON_VALUE; > } > @@ -1788,7 +1871,7 @@ CreatePayloadToPostResource ( > ZeroMem (&PostResponse, sizeof (REDFISH_RESPONSE)); > Status =3D RedfishPostToPayload (TargetPayload, Payload, &PostResponse= ); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a:%d Failed to POST Attribute Registry to > Redfish service.\n",__FUNCTION__, __LINE__)); > + DEBUG ((DEBUG_ERROR, "%a:%d Failed to POST Attribute Registry to > Redfish service.\n", __FUNCTION__, __LINE__)); > goto EXIT_FREE_JSON_VALUE; > } >=20 > @@ -1827,19 +1910,19 @@ EXIT_FREE_JSON_VALUE: > **/ > EFI_STRING > RedfishGetUri ( > - IN EFI_STRING ConfigLang > + IN EFI_STRING ConfigLang > ) > { > - EFI_STATUS Status; > - EFI_STRING Target; > - EFI_STRING Found; > - EFI_STRING TempStr; > - EFI_STRING ResultStr; > - EFI_STRING Head; > - EFI_STRING CloseBracket; > - UINTN TempStrSize; > - UINTN RemainingLen; > - UINTN ConfigLangLen; > + EFI_STATUS Status; > + EFI_STRING Target; > + EFI_STRING Found; > + EFI_STRING TempStr; > + EFI_STRING ResultStr; > + EFI_STRING Head; > + EFI_STRING CloseBracket; > + UINTN TempStrSize; > + UINTN RemainingLen; > + UINTN ConfigLangLen; >=20 > Status =3D RedfishLocateProtocol ((VOID **)&mConfigLangMapProtocol, > &gEdkIIRedfishConfigLangMapProtocolGuid); > if (EFI_ERROR (Status)) { > @@ -1875,7 +1958,7 @@ RedfishGetUri ( > // > do { > ConfigLangLen =3D StrLen (Head); > - Target =3D CloseBracket; > + Target =3D CloseBracket; >=20 > // > // Look for next ConfigLang > @@ -1895,13 +1978,14 @@ RedfishGetUri ( > // > // Copy current ConfigLang to temporary string and do a query > // > - Target +=3D 1; > + Target +=3D 1; > RemainingLen =3D StrLen (Target); > - TempStrSize =3D (ConfigLangLen - RemainingLen + 1) * sizeof (CHAR16)= ; > - TempStr =3D AllocateCopyPool (TempStrSize, Head); > + TempStrSize =3D (ConfigLangLen - RemainingLen + 1) * sizeof (CHAR16= ); > + TempStr =3D AllocateCopyPool (TempStrSize, Head); > if (TempStr =3D=3D NULL) { > return NULL; > } > + > TempStr[ConfigLangLen - RemainingLen] =3D '\0'; >=20 > Status =3D mConfigLangMapProtocol->Get ( > @@ -1926,7 +2010,7 @@ RedfishGetUri ( > // > // Prepare for next ConfigLang > // > - Head =3D Target; > + Head =3D Target; > CloseBracket =3D StrStr (Head, L"{"); > } while (CloseBracket !=3D NULL); >=20 > @@ -1954,7 +2038,7 @@ RedfishGetUri ( > **/ > EFI_STRING > RedfishGetConfigLanguage ( > - IN EFI_STRING Uri > + IN EFI_STRING Uri > ) > { > EFI_STATUS Status; > @@ -1973,13 +2057,12 @@ RedfishGetConfigLanguage ( > } >=20 > ConfigLang =3D NULL; > - Status =3D mConfigLangMapProtocol->Get ( > - mConfigLangMapProtocol, > - RedfishGetTypeUri, > - Uri, > - &ConfigLang > - ); > - > + Status =3D mConfigLangMapProtocol->Get ( > + mConfigLangMapProtocol, > + RedfishGetTypeUri, > + Uri, > + &ConfigLang > + ); >=20 > return ConfigLang; > } > @@ -1997,8 +2080,8 @@ RedfishGetConfigLanguage ( > **/ > EFI_STRING > GetConfigureLang ( > - IN CHAR8 *Uri, > - IN CHAR8 *PropertyName OPTIONAL > + IN CHAR8 *Uri, > + IN CHAR8 *PropertyName OPTIONAL > ) > { > EFI_STRING ConfigLang; > @@ -2032,7 +2115,7 @@ GetConfigureLang ( > } >=20 > StringSize =3D StrSize (ConfigLang) + ((AsciiStrLen (PropertyName) + 1= ) * > sizeof (CHAR16)); > - ResultStr =3D AllocatePool (StringSize); > + ResultStr =3D AllocatePool (StringSize); > if (ResultStr =3D=3D NULL) { > return NULL; > } > @@ -2059,7 +2142,7 @@ RedfisSetRedfishUri ( > IN EFI_STRING Uri > ) > { > - EFI_STATUS Status; > + EFI_STATUS Status; >=20 > if (IS_EMPTY_STRING (ConfigLang) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > @@ -2088,12 +2171,12 @@ RedfisSetRedfishUri ( > **/ > EFI_STRING > GetOdataId ( > - IN REDFISH_PAYLOAD *Payload > + IN REDFISH_PAYLOAD *Payload > ) > { > - EDKII_JSON_VALUE *JsonValue; > - EDKII_JSON_VALUE *OdataId; > - EFI_STRING OdataIdString; > + EDKII_JSON_VALUE *JsonValue; > + EDKII_JSON_VALUE *OdataId; > + EFI_STRING OdataIdString; >=20 > if (Payload =3D=3D NULL) { > return NULL; > @@ -2117,7 +2200,6 @@ GetOdataId ( > return AllocateCopyPool (StrSize (OdataIdString), OdataIdString); > } >=20 > - > /** >=20 > Get the property name by given Configure Langauge. > @@ -2131,25 +2213,27 @@ GetOdataId ( > **/ > EFI_STRING > GetPropertyFromConfigureLang ( > - IN EFI_STRING ResourceUri, > - IN EFI_STRING ConfigureLang > + IN EFI_STRING ResourceUri, > + IN EFI_STRING ConfigureLang > ) > { > EFI_STATUS Status; > EFI_STRING TempString; >=20 > - if (ConfigureLang =3D=3D NULL || ResourceUri =3D=3D NULL) { > + if ((ConfigureLang =3D=3D NULL) || (ResourceUri =3D=3D NULL)) { > return NULL; > } >=20 > Status =3D IsRedpathArray (ConfigureLang, NULL, &TempString); > - if (!EFI_ERROR(Status)) { > + if (!EFI_ERROR (Status)) { > TempString +=3D 2; // Advance two characters for '}' and '/' > return TempString; > } > + > if (Status !=3D EFI_NOT_FOUND) { > return NULL; > } > + > // > // The ConigLang has no '{}' > // > @@ -2160,6 +2244,7 @@ GetPropertyFromConfigureLang ( > if (GetRedpathNodeByIndex (ConfigureLang, 0, &TempString) =3D=3D NULL)= { > return NULL; > } > + > // > // Advance two characters to the starting > // pointer of next node. > @@ -2182,17 +2267,17 @@ GetPropertyFromConfigureLang ( > **/ > CHAR8 * > GetPropertyStringValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - CHAR8 *AsciiStringValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + CHAR8 *AsciiStringValue; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName)) { > return NULL; > @@ -2201,7 +2286,7 @@ GetPropertyStringValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > return NULL; > @@ -2240,17 +2325,17 @@ GetPropertyStringValue ( > **/ > INT64 * > GetPropertyNumericValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - INT64 *ResultValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + INT64 *ResultValue; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName)) { > return NULL; > @@ -2259,7 +2344,7 @@ GetPropertyNumericValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > return NULL; > @@ -2302,17 +2387,17 @@ GetPropertyNumericValue ( > **/ > BOOLEAN * > GetPropertyBooleanValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - BOOLEAN *ResultValue; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + BOOLEAN *ResultValue; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName)) { > return NULL; > @@ -2321,7 +2406,7 @@ GetPropertyBooleanValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > return NULL; > @@ -2366,8 +2451,8 @@ GetAttributeNameFromConfigLanguage ( > IN EFI_STRING ConfigureLanguage > ) > { > - UINTN StringLen; > - UINTN Index; > + UINTN StringLen; > + UINTN Index; >=20 > if (IS_EMPTY_STRING (ConfigureLanguage)) { > return NULL; > @@ -2398,21 +2483,21 @@ GetAttributeNameFromConfigLanguage ( > **/ > CHAR8 ** > GetPropertyStringArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - CHAR8 **StringArray; > - UINTN Index; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + CHAR8 **StringArray; > + UINTN Index; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || ArraySize =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || (ArraySize =3D=3D NULL)) { > return NULL; > } >=20 > @@ -2421,7 +2506,7 @@ GetPropertyStringArrayValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __FUNCTION__)); > @@ -2469,21 +2554,21 @@ GetPropertyStringArrayValue ( > **/ > INT64 * > GetPropertyNumericArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - INT64 *IntegerArray; > - UINTN Index; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + INT64 *IntegerArray; > + UINTN Index; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || ArraySize =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || (ArraySize =3D=3D NULL)) { > return NULL; > } >=20 > @@ -2492,7 +2577,7 @@ GetPropertyNumericArrayValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __FUNCTION__)); > @@ -2540,21 +2625,21 @@ GetPropertyNumericArrayValue ( > **/ > BOOLEAN * > GetPropertyBooleanArrayValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINTN *ArraySize > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINTN *ArraySize > ) > { > - EFI_STATUS Status; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - UINTN BufferSize; > - BOOLEAN *BooleanArray; > - UINTN Index; > + EFI_STATUS Status; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + UINTN BufferSize; > + BOOLEAN *BooleanArray; > + UINTN Index; >=20 > - if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || ArraySize =3D=3D NULL) { > + if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName) > || (ArraySize =3D=3D NULL)) { > return NULL; > } >=20 > @@ -2563,7 +2648,7 @@ GetPropertyBooleanArrayValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __FUNCTION__)); > @@ -2605,25 +2690,28 @@ GetPropertyBooleanArrayValue ( > **/ > VOID > FreeEmptyPropKeyValueList ( > - RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueListHead > + RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueListHead > ) > { > - RedfishCS_EmptyProp_KeyValue *NextEmptyPropKeyValueList; > + RedfishCS_EmptyProp_KeyValue *NextEmptyPropKeyValueList; >=20 > while (EmptyPropKeyValueListHead !=3D NULL) { > NextEmptyPropKeyValueList =3D EmptyPropKeyValueListHead- > >NextKeyValuePtr; > if (EmptyPropKeyValueListHead->Value->DataValue.CharPtr !=3D NULL) { > - FreePool(EmptyPropKeyValueListHead->Value->DataValue.CharPtr); > + FreePool (EmptyPropKeyValueListHead->Value->DataValue.CharPtr); > } > + > if (EmptyPropKeyValueListHead->Value !=3D NULL) { > - FreePool(EmptyPropKeyValueListHead->Value); > + FreePool (EmptyPropKeyValueListHead->Value); > } > + > if (EmptyPropKeyValueListHead->KeyNamePtr !=3D NULL) { > - FreePool(EmptyPropKeyValueListHead->KeyNamePtr); > + FreePool (EmptyPropKeyValueListHead->KeyNamePtr); > } > + > FreePool (EmptyPropKeyValueListHead); > EmptyPropKeyValueListHead =3D NextEmptyPropKeyValueList; > - }; > + } > } >=20 > /** > @@ -2640,26 +2728,28 @@ FreeEmptyPropKeyValueList ( > RedfishCS_EmptyProp_KeyValue * > NewEmptyPropKeyValueFromRedfishValue ( > IN EFI_STRING KeyName, > - IN EDKII_REDFISH_VALUE *RedfishValue > + IN EDKII_REDFISH_VALUE *RedfishValue > ) > { > - RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValue; > - RedfishCS_Vague *VagueValue; > - RedfishCS_char *KeyNameChar; > - VOID *Data; > - UINTN DataSize; > - INT32 Bool32; > - > - KeyNameChar =3D StrUnicodeToAscii(KeyName); > + RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValue; > + RedfishCS_Vague *VagueValue; > + RedfishCS_char *KeyNameChar; > + VOID *Data; > + UINTN DataSize; > + INT32 Bool32; > + > + KeyNameChar =3D StrUnicodeToAscii (KeyName); > if (KeyNameChar =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to convert unicode to ASCII.\n", > __FUNCTION__)); > return NULL; > } > + > EmptyPropKeyValue =3D (RedfishCS_EmptyProp_KeyValue > *)AllocateZeroPool (sizeof (RedfishCS_EmptyProp_KeyValue)); > if (EmptyPropKeyValue =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for > EmptyPropKeyValue\n", __FUNCTION__)); > return NULL; > } > + > VagueValue =3D (RedfishCS_Vague *)AllocateZeroPool (sizeof > (RedfishCS_Vague)); > if (VagueValue =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for > VagueValue\n", __FUNCTION__)); > @@ -2669,29 +2759,30 @@ NewEmptyPropKeyValueFromRedfishValue ( >=20 > if (RedfishValue->Type =3D=3D REDFISH_VALUE_TYPE_BOOLEAN) { > VagueValue->DataType =3D RedfishCS_Vague_DataType_Bool; > - DataSize =3D sizeof (BOOLEAN); > + DataSize =3D sizeof (BOOLEAN); > // > // Redfish JSON to C strcuture converter uses > // "int" for the BOOLEAN. > // > Bool32 =3D (INT32)RedfishValue->Value.Boolean; > - Data =3D (VOID *)&Bool32; > + Data =3D (VOID *)&Bool32; > } else if (RedfishValue->Type =3D=3D REDFISH_VALUE_TYPE_INTEGER) { > VagueValue->DataType =3D RedfishCS_Vague_DataType_Int64; > - DataSize =3D sizeof (INT64); > - Data =3D (VOID *)&RedfishValue->Value.Integer; > + DataSize =3D sizeof (INT64); > + Data =3D (VOID *)&RedfishValue->Value.Integer; > } else if (RedfishValue->Type =3D=3D REDFISH_VALUE_TYPE_STRING) { > VagueValue->DataType =3D RedfishCS_Vague_DataType_String; > - DataSize =3D AsciiStrSize(RedfishValue->Value.Buffer); > - Data =3D (VOID *)RedfishValue->Value.Buffer; > + DataSize =3D AsciiStrSize (RedfishValue->Value.Buffer); > + Data =3D (VOID *)RedfishValue->Value.Buffer; > } else { > DEBUG ((DEBUG_ERROR, "%a, wrong type of RedfishValue: %x\n", > __FUNCTION__, RedfishValue->Type)); > FreePool (VagueValue); > FreePool (EmptyPropKeyValue); > return NULL; > } > - VagueValue->DataValue.CharPtr =3D (RedfishCS_char > *)AllocateCopyPool(DataSize, Data); > - EmptyPropKeyValue->Value =3D VagueValue; > + > + VagueValue->DataValue.CharPtr =3D (RedfishCS_char *)AllocateCopyPool > (DataSize, Data); > + EmptyPropKeyValue->Value =3D VagueValue; > EmptyPropKeyValue->KeyNamePtr =3D KeyNameChar; > return EmptyPropKeyValue; > } > @@ -2712,25 +2803,25 @@ NewEmptyPropKeyValueFromRedfishValue ( > **/ > RedfishCS_EmptyProp_KeyValue * > GetPropertyVagueValue ( > - IN CHAR8 *Schema, > - IN CHAR8 *Version, > - IN EFI_STRING PropertyName, > - IN EFI_STRING ConfigureLang, > - OUT UINT32 *NumberOfValues > + IN CHAR8 *Schema, > + IN CHAR8 *Version, > + IN EFI_STRING PropertyName, > + IN EFI_STRING ConfigureLang, > + OUT UINT32 *NumberOfValues > ) > { > - EFI_STATUS Status; > - RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueList; > - RedfishCS_EmptyProp_KeyValue *PreEmptyPropKeyValueList; > - RedfishCS_EmptyProp_KeyValue *FirstEmptyPropKeyValueList; > - EDKII_REDFISH_VALUE RedfishValue; > - EFI_STRING ConfigureLangBuffer; > - EFI_STRING KeyName; > - EFI_STRING *ConfigureLangList; > - EFI_STRING SearchPattern; > - UINTN BufferSize; > - UINTN ConfigListCount; > - UINTN ConfigListCountIndex; > + EFI_STATUS Status; > + RedfishCS_EmptyProp_KeyValue *EmptyPropKeyValueList; > + RedfishCS_EmptyProp_KeyValue *PreEmptyPropKeyValueList; > + RedfishCS_EmptyProp_KeyValue *FirstEmptyPropKeyValueList; > + EDKII_REDFISH_VALUE RedfishValue; > + EFI_STRING ConfigureLangBuffer; > + EFI_STRING KeyName; > + EFI_STRING *ConfigureLangList; > + EFI_STRING SearchPattern; > + UINTN BufferSize; > + UINTN ConfigListCount; > + UINTN ConfigListCountIndex; >=20 > if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || > IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName)) { > return NULL; > @@ -2739,24 +2830,26 @@ GetPropertyVagueValue ( > // > // Configure Language buffer. > // > - BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > + BufferSize =3D sizeof (CHAR16) * MAX_CONF_LANG_LEN; > ConfigureLangBuffer =3D AllocatePool (BufferSize); > if (ConfigureLangBuffer =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for > ConfigureLangBuffer\n", __FUNCTION__)); > return NULL; > } > + > UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLan= g, > PropertyName); >=20 > // > // Initial search pattern > // > - BufferSize =3D (StrLen (ConfigureLangBuffer) + StrLen (L"/.*") + 1) * = sizeof > (CHAR16); // Increase one for the NULL terminator. > + BufferSize =3D (StrLen (ConfigureLangBuffer) + StrLen (L"/.*") + 1)= * sizeof > (CHAR16); // Increase one for the NULL terminator. > SearchPattern =3D AllocatePool (BufferSize); > if (SearchPattern =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for > SearchPattern\n", __FUNCTION__)); > FreePool (ConfigureLangBuffer); > return NULL; > } > + > BufferSize =3D BufferSize / sizeof (CHAR16); > StrCpyS (SearchPattern, BufferSize, ConfigureLangBuffer); > StrCatS (SearchPattern, BufferSize, L"/.*"); > @@ -2769,28 +2862,30 @@ GetPropertyVagueValue ( > // > // Build up the list of RedfishCS_EmptyProp_KeyValue. > // > - ConfigListCountIndex =3D 0; > - PreEmptyPropKeyValueList =3D NULL; > + ConfigListCountIndex =3D 0; > + PreEmptyPropKeyValueList =3D NULL; > FirstEmptyPropKeyValueList =3D NULL; > while (ConfigListCountIndex < ConfigListCount) { > - Status =3D RedfishPlatformConfigGetValue(Schema, Version, > ConfigureLangList [ConfigListCountIndex], &RedfishValue); > + Status =3D RedfishPlatformConfigGetValue (Schema, Version, > ConfigureLangList[ConfigListCountIndex], &RedfishValue); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s faile= d: > %r\n", __FUNCTION__, Schema, Version, ConfigureLangList > [ConfigListCountIndex], Status)); > + DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s faile= d: > %r\n", __FUNCTION__, Schema, Version, > ConfigureLangList[ConfigListCountIndex], Status)); > goto ErrorLeave; > } > + > // > // Get the key name. > // > - KeyName =3D GetAttributeNameFromConfigLanguage (ConfigureLangList > [ConfigListCountIndex]); > + KeyName =3D GetAttributeNameFromConfigLanguage > (ConfigureLangList[ConfigListCountIndex]); > // > // Create an entry of RedfishCS_EmptyProp_KeyValue. > // > EmptyPropKeyValueList =3D NewEmptyPropKeyValueFromRedfishValue > (KeyName, &RedfishValue); > if (EmptyPropKeyValueList =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Failed to create an entry of > EmptyPropKeyValueList\n", __FUNCTION__)); > - ConfigListCountIndex ++; > + ConfigListCountIndex++; > continue; > } > + > // > // Link the RedfishCS_EmptyProp_KeyValue list. > // > @@ -2799,24 +2894,29 @@ GetPropertyVagueValue ( > } else { > FirstEmptyPropKeyValueList =3D EmptyPropKeyValueList; > } > + > PreEmptyPropKeyValueList =3D EmptyPropKeyValueList; > - ConfigListCountIndex ++; > - }; > + ConfigListCountIndex++; > + } > + > goto LeaveFunction; >=20 > ErrorLeave:; > if (FirstEmptyPropKeyValueList !=3D NULL) { > FreeEmptyPropKeyValueList (FirstEmptyPropKeyValueList); > } > + > FirstEmptyPropKeyValueList =3D NULL; >=20 > LeaveFunction: > if (SearchPattern !=3D NULL) { > FreePool (SearchPattern); > } > + > if (ConfigureLangBuffer !=3D NULL) { > FreePool (ConfigureLangBuffer); > } > + > FreePool (ConfigureLangList); >=20 > *NumberOfValues =3D (UINT32)ConfigListCount; > @@ -2836,15 +2936,15 @@ LeaveFunction: > **/ > BOOLEAN > PropertyChecker ( > - IN VOID *PropertyBuffer, > - IN BOOLEAN ProvisionMode > + IN VOID *PropertyBuffer, > + IN BOOLEAN ProvisionMode > ) > { > if (ProvisionMode) { > return TRUE; > } >=20 > - if (!ProvisionMode && PropertyBuffer !=3D NULL) { > + if (!ProvisionMode && (PropertyBuffer !=3D NULL)) { > return TRUE; > } >=20 > @@ -2865,12 +2965,12 @@ PropertyChecker ( > **/ > BOOLEAN > CheckEtag ( > - IN EFI_STRING Uri, > - IN CHAR8 *EtagInHeader, > - IN CHAR8 *EtagInJson > + IN EFI_STRING Uri, > + IN CHAR8 *EtagInHeader, > + IN CHAR8 *EtagInJson > ) > { > - CHAR8 *EtagInDb; > + CHAR8 *EtagInDb; >=20 > if (IS_EMPTY_STRING (Uri)) { > return FALSE; > @@ -2920,15 +3020,15 @@ CheckEtag ( > **/ > EDKII_JSON_VALUE * > MatchJsonObject ( > - IN EDKII_JSON_VALUE *JsonObj, > - IN CHAR8 *ObjectName > + IN EDKII_JSON_VALUE *JsonObj, > + IN CHAR8 *ObjectName > ) > { > EDKII_JSON_VALUE N; > CHAR8 *Key; > EDKII_JSON_VALUE Value; >=20 > - if (JsonObj =3D=3D NULL || IS_EMPTY_STRING (ObjectName)) { > + if ((JsonObj =3D=3D NULL) || IS_EMPTY_STRING (ObjectName)) { > return NULL; > } >=20 > @@ -2962,11 +3062,11 @@ MatchPropertyWithJsonContext ( > IN CHAR8 *Json > ) > { > - CHAR8 *AsciiProperty; > - CHAR8 *PropertyNode; > - UINTN Index; > - EDKII_JSON_VALUE *JsonObj; > - EDKII_JSON_VALUE *MatchObj; > + CHAR8 *AsciiProperty; > + CHAR8 *PropertyNode; > + UINTN Index; > + EDKII_JSON_VALUE *JsonObj; > + EDKII_JSON_VALUE *MatchObj; > EDKII_JSON_TYPE JsonType; >=20 > if (IS_EMPTY_STRING (Property) || IS_EMPTY_STRING (Json)) { > @@ -2974,7 +3074,7 @@ MatchPropertyWithJsonContext ( > } >=20 > JsonObj =3D JsonLoadString (Json, 0, NULL); > - if (JsonObj =3D=3D NULL || !JsonValueIsObject (JsonObj)) { > + if ((JsonObj =3D=3D NULL) || !JsonValueIsObject (JsonObj)) { > return FALSE; > } >=20 > @@ -2983,18 +3083,17 @@ MatchPropertyWithJsonContext ( > return FALSE; > } >=20 > - Index =3D 0; > + Index =3D 0; > PropertyNode =3D AsciiProperty; > - MatchObj =3D JsonObj; > + MatchObj =3D JsonObj; >=20 > // > // Walk through property and find corresponding object in JSON input > // > while (AsciiProperty[Index] !=3D '\0') { > - > if (AsciiProperty[Index] =3D=3D '/') { > AsciiProperty[Index] =3D '\0'; > - MatchObj =3D MatchJsonObject (MatchObj, PropertyNode); > + MatchObj =3D MatchJsonObject (MatchObj, PropertyNode); > if (MatchObj =3D=3D NULL) { > PropertyNode =3D NULL; > break; > @@ -3023,16 +3122,19 @@ MatchPropertyWithJsonContext ( > if (JsonValueIsNull (MatchObj)) { > MatchObj =3D NULL; > } > + > break; > case EdkiiJsonTypeArray: > if (JsonArrayCount (MatchObj) =3D=3D 0) { > MatchObj =3D NULL; > } > + > break; > case EdkiiJsonTypeString: > if (IS_EMPTY_STRING (JsonValueGetString (MatchObj))) { > MatchObj =3D NULL; > } > + > break; > case EdkiiJsonTypeNull: > MatchObj =3D NULL; > @@ -3061,16 +3163,16 @@ MatchPropertyWithJsonContext ( > **/ > EFI_STATUS > AddRedfishCharArray ( > - IN OUT RedfishCS_char_Array **Head, > + IN OUT RedfishCS_char_Array **Head, > IN CHAR8 **StringArray, > IN UINTN ArraySize > ) > { > - UINTN Index; > - RedfishCS_char_Array *CharArrayBuffer; > - RedfishCS_char_Array *PreArrayBuffer; > + UINTN Index; > + RedfishCS_char_Array *CharArrayBuffer; > + RedfishCS_char_Array *PreArrayBuffer; >=20 > - if (Head =3D=3D NULL || StringArray =3D=3D NULL || ArraySize =3D=3D 0)= { > + if ((Head =3D=3D NULL) || (StringArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -3083,14 +3185,15 @@ AddRedfishCharArray ( > } >=20 > if (Index =3D=3D 0) { > - *Head =3D CharArrayBuffer; > + *Head =3D CharArrayBuffer; > } >=20 > CharArrayBuffer->ArrayValue =3D StringArray[Index]; > - CharArrayBuffer->Next =3D NULL; > + CharArrayBuffer->Next =3D NULL; > if (PreArrayBuffer !=3D NULL) { > PreArrayBuffer->Next =3D CharArrayBuffer; > } > + > PreArrayBuffer =3D CharArrayBuffer; > } >=20 > @@ -3111,16 +3214,16 @@ AddRedfishCharArray ( > **/ > EFI_STATUS > AddRedfishNumericArray ( > - IN OUT RedfishCS_int64_Array **Head, > - IN INT64 *NumericArray, > - IN UINTN ArraySize > + IN OUT RedfishCS_int64_Array **Head, > + IN INT64 *NumericArray, > + IN UINTN ArraySize > ) > { > - UINTN Index; > - RedfishCS_int64_Array *NumericArrayBuffer; > - RedfishCS_int64_Array *PreArrayBuffer; > + UINTN Index; > + RedfishCS_int64_Array *NumericArrayBuffer; > + RedfishCS_int64_Array *PreArrayBuffer; >=20 > - if (Head =3D=3D NULL || NumericArray =3D=3D NULL || ArraySize =3D=3D 0= ) { > + if ((Head =3D=3D NULL) || (NumericArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -3133,18 +3236,21 @@ AddRedfishNumericArray ( > } >=20 > if (Index =3D=3D 0) { > - *Head =3D NumericArrayBuffer; > + *Head =3D NumericArrayBuffer; > } > + > NumericArrayBuffer->ArrayValue =3D AllocatePool (sizeof > (RedfishCS_int64)); > if (NumericArrayBuffer->ArrayValue =3D=3D NULL) { > ASSERT (NumericArrayBuffer->ArrayValue !=3D NULL); > continue; > } > + > *NumericArrayBuffer->ArrayValue =3D NumericArray[Index]; > - NumericArrayBuffer->Next =3D NULL; > + NumericArrayBuffer->Next =3D NULL; > if (PreArrayBuffer !=3D NULL) { > PreArrayBuffer->Next =3D NumericArrayBuffer; > } > + > PreArrayBuffer =3D NumericArrayBuffer; > } >=20 > @@ -3170,11 +3276,11 @@ AddRedfishBooleanArray ( > IN UINTN ArraySize > ) > { > - UINTN Index; > - RedfishCS_bool_Array *BooleanArrayBuffer; > - RedfishCS_bool_Array *PreArrayBuffer; > + UINTN Index; > + RedfishCS_bool_Array *BooleanArrayBuffer; > + RedfishCS_bool_Array *PreArrayBuffer; >=20 > - if (Head =3D=3D NULL || BooleanArray =3D=3D NULL || ArraySize =3D=3D 0= ) { > + if ((Head =3D=3D NULL) || (BooleanArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -3187,7 +3293,7 @@ AddRedfishBooleanArray ( > } >=20 > if (Index =3D=3D 0) { > - *Head =3D BooleanArrayBuffer; > + *Head =3D BooleanArrayBuffer; > } >=20 > BooleanArrayBuffer->ArrayValue =3D AllocatePool (sizeof (RedfishCS_= bool)); > @@ -3195,11 +3301,13 @@ AddRedfishBooleanArray ( > ASSERT (BooleanArrayBuffer->ArrayValue !=3D NULL); > continue; > } > + > *BooleanArrayBuffer->ArrayValue =3D BooleanArray[Index]; > - BooleanArrayBuffer->Next =3D NULL; > + BooleanArrayBuffer->Next =3D NULL; > if (PreArrayBuffer !=3D NULL) { > PreArrayBuffer->Next =3D BooleanArrayBuffer; > } > + > PreArrayBuffer =3D BooleanArrayBuffer; > } >=20 > @@ -3222,22 +3330,21 @@ AddRedfishBooleanArray ( > **/ > BOOLEAN > CompareRedfishStringArrayValues ( > - IN RedfishCS_char_Array *Head, > - IN CHAR8 **StringArray, > - IN UINTN ArraySize > + IN RedfishCS_char_Array *Head, > + IN CHAR8 **StringArray, > + IN UINTN ArraySize > ) > { > UINTN Index; > RedfishCS_char_Array *CharArrayBuffer; >=20 > - if (Head =3D=3D NULL || StringArray =3D=3D NULL || ArraySize =3D=3D 0)= { > + if ((Head =3D=3D NULL) || (StringArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return FALSE; > } >=20 > CharArrayBuffer =3D Head; > - Index =3D 0; > + Index =3D 0; > while (CharArrayBuffer !=3D NULL && Index < ArraySize) { > - > if (AsciiStrCmp (StringArray[Index], CharArrayBuffer->ArrayValue) != =3D 0) { > break; > } > @@ -3246,7 +3353,7 @@ CompareRedfishStringArrayValues ( > CharArrayBuffer =3D CharArrayBuffer->Next; > } >=20 > - if (CharArrayBuffer !=3D NULL || Index < ArraySize) { > + if ((CharArrayBuffer !=3D NULL) || (Index < ArraySize)) { > return FALSE; > } >=20 > @@ -3269,20 +3376,20 @@ CompareRedfishStringArrayValues ( > **/ > BOOLEAN > CompareRedfishNumericArrayValues ( > - IN RedfishCS_int64_Array *Head, > - IN INT64 *NumericArray, > - IN UINTN ArraySize > + IN RedfishCS_int64_Array *Head, > + IN INT64 *NumericArray, > + IN UINTN ArraySize > ) > { > UINTN Index; > RedfishCS_int64_Array *NumericArrayBuffer; >=20 > - if (Head =3D=3D NULL || NumericArray =3D=3D NULL || ArraySize =3D=3D 0= ) { > + if ((Head =3D=3D NULL) || (NumericArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return FALSE; > } >=20 > NumericArrayBuffer =3D Head; > - Index =3D 0; > + Index =3D 0; > while (NumericArrayBuffer !=3D NULL && Index < ArraySize) { > if (NumericArray[Index] !=3D *NumericArrayBuffer->ArrayValue) { > break; > @@ -3292,7 +3399,7 @@ CompareRedfishNumericArrayValues ( > NumericArrayBuffer =3D NumericArrayBuffer->Next; > } >=20 > - if (NumericArrayBuffer !=3D NULL || Index < ArraySize) { > + if ((NumericArrayBuffer !=3D NULL) || (Index < ArraySize)) { > return FALSE; > } >=20 > @@ -3320,15 +3427,15 @@ CompareRedfishBooleanArrayValues ( > IN UINTN ArraySize > ) > { > - UINTN Index; > + UINTN Index; > RedfishCS_bool_Array *BooleanArrayBuffer; >=20 > - if (Head =3D=3D NULL || BooleanArray =3D=3D NULL || ArraySize =3D=3D 0= ) { > + if ((Head =3D=3D NULL) || (BooleanArray =3D=3D NULL) || (ArraySize =3D= =3D 0)) { > return FALSE; > } >=20 > BooleanArrayBuffer =3D Head; > - Index =3D 0; > + Index =3D 0; > while (BooleanArrayBuffer !=3D NULL && Index < ArraySize) { > if (BooleanArray[Index] !=3D *BooleanArrayBuffer->ArrayValue) { > break; > @@ -3338,7 +3445,7 @@ CompareRedfishBooleanArrayValues ( > BooleanArrayBuffer =3D BooleanArrayBuffer->Next; > } >=20 > - if (BooleanArrayBuffer !=3D NULL || Index < ArraySize) { > + if ((BooleanArrayBuffer !=3D NULL) || (Index < ArraySize)) { > return FALSE; > } >=20 > @@ -3361,12 +3468,12 @@ CompareRedfishBooleanArrayValues ( > **/ > BOOLEAN > CompareRedfishPropertyVagueValues ( > - IN RedfishCS_EmptyProp_KeyValue *RedfishVagueKeyValuePtr, > - IN UINT32 RedfishVagueKeyValueNumber, > - IN RedfishCS_EmptyProp_KeyValue *ConfigVagueKeyValuePtr, > - IN UINT32 ConfigVagueKeyValueNumber > + IN RedfishCS_EmptyProp_KeyValue *RedfishVagueKeyValuePtr, > + IN UINT32 RedfishVagueKeyValueNumber, > + IN RedfishCS_EmptyProp_KeyValue *ConfigVagueKeyValuePtr, > + IN UINT32 ConfigVagueKeyValueNumber > ) > - { > +{ > RedfishCS_EmptyProp_KeyValue *ThisConfigVagueKeyValuePtr; > RedfishCS_EmptyProp_KeyValue *ThisRedfishVagueKeyValuePtr; >=20 > @@ -3384,13 +3491,14 @@ CompareRedfishPropertyVagueValues ( > // Loop through all key/value on Redfish service.. > // > while (ThisRedfishVagueKeyValuePtr !=3D NULL) { > - if (AsciiStrCmp(ThisConfigVagueKeyValuePtr->KeyNamePtr, > ThisRedfishVagueKeyValuePtr->KeyNamePtr) =3D=3D 0) { > + if (AsciiStrCmp (ThisConfigVagueKeyValuePtr->KeyNamePtr, > ThisRedfishVagueKeyValuePtr->KeyNamePtr) =3D=3D 0) { > // > // Check the type of value. > // > if (ThisConfigVagueKeyValuePtr->Value->DataType !=3D > ThisRedfishVagueKeyValuePtr->Value->DataType) { > return FALSE; > } > + > // > // Check the value. > // > @@ -3398,11 +3506,13 @@ CompareRedfishPropertyVagueValues ( > // > // Is the string identical? > // > - if (AsciiStrCmp (ThisConfigVagueKeyValuePtr->Value- > >DataValue.CharPtr, > - ThisRedfishVagueKeyValuePtr->Value->DataValue= .CharPtr > - ) =3D=3D 0) { > + if (AsciiStrCmp ( > + ThisConfigVagueKeyValuePtr->Value->DataValue.CharPtr, > + ThisRedfishVagueKeyValuePtr->Value->DataValue.CharPtr > + ) =3D=3D 0) > + { > break; > - } else{ > + } else { > return FALSE; > } > } else if (ThisConfigVagueKeyValuePtr->Value->DataType =3D=3D > RedfishCS_Vague_DataType_Int64) { > @@ -3421,16 +3531,20 @@ CompareRedfishPropertyVagueValues ( > return FALSE; > } > } > + > ThisRedfishVagueKeyValuePtr =3D ThisRedfishVagueKeyValuePtr- > >NextKeyValuePtr; > - }; > + } > + > if (ThisRedfishVagueKeyValuePtr =3D=3D NULL) { > // > // No matched key name. Threat these two vague value set is differ= ent. > // > return FALSE; > } > + > ThisConfigVagueKeyValuePtr =3D ThisConfigVagueKeyValuePtr- > >NextKeyValuePtr; > - }; > + } > + > return TRUE; > } >=20 > @@ -3448,11 +3562,10 @@ CompareRedfishPropertyVagueValues ( > EFI_STATUS > EFIAPI > RedfishFeatureUtilityLibConstructor ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > ) > { > - > return EFI_SUCCESS; > } >=20 > @@ -3468,8 +3581,8 @@ RedfishFeatureUtilityLibConstructor ( > EFI_STATUS > EFIAPI > RedfishFeatureUtilityLibDestructor ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > ) > { > return EFI_SUCCESS; > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > index 84f338e680..66d5dce6c2 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > @@ -1,6 +1,8 @@ > ## @file > +# INF for Redfish feature utility library. > # > # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -49,6 +51,7 @@ > gEdkIIRedfishConfigLangMapProtocolGuid ## CONSUMED ## >=20 > [Pcd] > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired >=20 > [Guids] >=20 > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index d3c97ecf68..c0ab30ab8b 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -2,7 +2,7 @@ > # Redfish Client Package > # > # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > ## > @@ -65,3 +65,9 @@ >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupE > ventGuid|{0xB3, 0x8F, 0xE8, 0x7C, 0xD7, 0x4B, 0x79, 0x46, 0x87, 0xA8, 0xA= 8, > 0xD8, 0xDE, 0xE5, 0x0D, 0x2B}|VOID*|0x10000003 > ## Default Redfish version string >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdDefaultRedfishVersion|L"v1"|VOID > *|0x10000004 > + ## The number of seconds that the firmware will wait before system > reboot > + > gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootTimeout|5| > UINT16|0x20000002 > + > +[PcdsDynamicEx] > + ## The flag used to indicate that system reboot is required due to sys= tem > configuration change > + > gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired|FA > LSE|BOOLEAN|0x20000001 > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > index 3414f0c942..5a3a9e4c5a 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > @@ -3,6 +3,7 @@ > for EDK2 Redfish Feature driver registration. >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -10,10 +11,10 @@ >=20 > #include >=20 > -EFI_EVENT mEdkIIRedfishFeatureDriverStartupEvent; > -REDFISH_FEATURE_STARTUP_CONTEXT mFeatureDriverStartupContext; > -REDFISH_FEATURE_INTERNAL_DATA *ResourceUriNodeList; > -RESOURCE_INFORMATION_EXCHANGE *mInformationExchange; > +EFI_EVENT mEdkIIRedfishFeatureDriverStartupEvent; > +REDFISH_FEATURE_STARTUP_CONTEXT mFeatureDriverStartupContext; > +REDFISH_FEATURE_INTERNAL_DATA *ResourceUriNodeList; > +RESOURCE_INFORMATION_EXCHANGE *mInformationExchange; >=20 > /** > Setup the information to deliver to child feature/collection driver. > @@ -24,19 +25,21 @@ RESOURCE_INFORMATION_EXCHANGE > *mInformationExchange; > **/ > EFI_STATUS > SetupExchangeInformationInfo ( > - IN REDFISH_FEATURE_INTERNAL_DATA *ThisList, > - IN EFI_STRING ParentConfgLanguageUri > + IN REDFISH_FEATURE_INTERNAL_DATA *ThisList, > + IN EFI_STRING ParentConfgLanguageUri > ) > { > ThisList->InformationExchange->SendInformation.ParentUri =3D > (EFI_STRING)AllocateZeroPool (MaxParentUriLength * sizeof (CHAR16)); > if (ThisList->InformationExchange->SendInformation.ParentUri =3D=3D NU= LL) { > return EFI_OUT_OF_RESOURCES; > } > - ThisList->InformationExchange->SendInformation.PropertyName =3D > (EFI_STRING)AllocateZeroPool(MaxNodeNameLength * sizeof (CHAR16)); > + > + ThisList->InformationExchange->SendInformation.PropertyName =3D > (EFI_STRING)AllocateZeroPool (MaxNodeNameLength * sizeof (CHAR16)); > if (ThisList->InformationExchange->SendInformation.PropertyName =3D=3D > NULL) { > return EFI_OUT_OF_RESOURCES; > } > - ThisList->InformationExchange->SendInformation.FullUri =3D > (EFI_STRING)AllocateZeroPool(MaxParentUriLength * sizeof (CHAR16)); > + > + ThisList->InformationExchange->SendInformation.FullUri =3D > (EFI_STRING)AllocateZeroPool (MaxParentUriLength * sizeof (CHAR16)); > if (ThisList->InformationExchange->SendInformation.FullUri =3D=3D NULL= ) { > return EFI_OUT_OF_RESOURCES; > } > @@ -54,13 +57,15 @@ SetupExchangeInformationInfo ( > // > // Full config language URI > // > - StrCpyS (ThisList->InformationExchange->SendInformation.FullUri, > - MaxParentUriLength, > - ThisList->InformationExchange->SendInformation.ParentUri > - ); > + StrCpyS ( > + ThisList->InformationExchange->SendInformation.FullUri, > + MaxParentUriLength, > + ThisList->InformationExchange->SendInformation.ParentUri > + ); > if (StrLen (ThisList->InformationExchange->SendInformation.FullUri) != =3D 0) { > StrCatS (ThisList->InformationExchange->SendInformation.FullUri, > MaxParentUriLength, L"/"); > } > + > StrCatS (ThisList->InformationExchange->SendInformation.FullUri, > MaxParentUriLength, ThisList->InformationExchange- > >SendInformation.PropertyName); > return EFI_SUCCESS; > } > @@ -73,20 +78,21 @@ SetupExchangeInformationInfo ( > **/ > EFI_STATUS > DestroryExchangeInformation ( > - IN REDFISH_FEATURE_INTERNAL_DATA *ThisList > + IN REDFISH_FEATURE_INTERNAL_DATA *ThisList > ) > { > - > if (ThisList->InformationExchange !=3D NULL) { > if (ThisList->InformationExchange->SendInformation.Type =3D=3D > InformationTypeCollectionMemberUri) { > if (ThisList->InformationExchange->SendInformation.ParentUri !=3D = NULL) { > FreePool (ThisList->InformationExchange->SendInformation.ParentU= ri); > ThisList->InformationExchange->SendInformation.ParentUri =3D NUL= L; > } > + > if (ThisList->InformationExchange->SendInformation.PropertyName != =3D > NULL) { > FreePool (ThisList->InformationExchange- > >SendInformation.PropertyName); > ThisList->InformationExchange->SendInformation.PropertyName =3D > NULL; > } > + > if (ThisList->InformationExchange->SendInformation.FullUri !=3D NU= LL) { > FreePool (ThisList->InformationExchange->SendInformation.FullUri= ); > ThisList->InformationExchange->SendInformation.FullUri =3D NULL; > @@ -97,10 +103,10 @@ DestroryExchangeInformation ( > DestroyConfiglanguageList (&ThisList->InformationExchange- > >ReturnedInformation.ConfigureLanguageList); > } >=20 > - ThisList->InformationExchange->SendInformation.Type =3D > InformationTypeNone; > + ThisList->InformationExchange->SendInformation.Type =3D > InformationTypeNone; > ThisList->InformationExchange->ReturnedInformation.Type =3D > InformationTypeNone; > - > } > + > return EFI_SUCCESS; > } >=20 > @@ -114,44 +120,47 @@ DestroryExchangeInformation ( > **/ > VOID > StartUpFeatureDriver ( > - IN REDFISH_FEATURE_INTERNAL_DATA *ThisFeatureDriverList, > - IN EFI_STRING CurrentConfigLanguageUri, > - IN REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext > -) > + IN REDFISH_FEATURE_INTERNAL_DATA *ThisFeatureDriverList, > + IN EFI_STRING CurrentConfigLanguageUri, > + IN REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext > + ) > { > - EFI_STATUS Status; > - UINTN Index; > - REDFISH_FEATURE_INTERNAL_DATA *ThisList; > - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList; > - EFI_STRING NextParentUri; > + EFI_STATUS Status; > + UINTN Index; > + REDFISH_FEATURE_INTERNAL_DATA *ThisList; > + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList; > + EFI_STRING NextParentUri; >=20 > NextParentUri =3D (EFI_STRING)AllocateZeroPool (MaxParentUriLength * > sizeof (CHAR16)); > if (NextParentUri =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: Fail to allocate memory for parent configur= e > language.\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for parent > configure language.\n", __FUNCTION__)); > return; > } > + > if (CurrentConfigLanguageUri !=3D NULL) { > - StrCpyS(NextParentUri, MaxParentUriLength, CurrentConfigLanguageUri)= ; > + StrCpyS (NextParentUri, MaxParentUriLength, > CurrentConfigLanguageUri); > } >=20 > ThisList =3D ThisFeatureDriverList; > while (TRUE) { > if (ThisList->Callback !=3D NULL) { > ThisList->InformationExchange =3D mInformationExchange; > - Status =3D SetupExchangeInformationInfo (ThisList, NextParentUri); > + Status =3D SetupExchangeInformationInfo (Th= isList, > NextParentUri); > if (!EFI_ERROR (Status)) { > - Status =3D ThisList->Callback( > - StartupContext->This, > - StartupContext->Action, > - ThisList->Context, > - ThisList->InformationExchange > - ); > + Status =3D ThisList->Callback ( > + StartupContext->This, > + StartupContext->Action, > + ThisList->Context, > + ThisList->InformationExchange > + ); > } > + > if (EFI_ERROR (Status)) { > - DEBUG((DEBUG_ERROR, "%a: Callback to EDK2 Redfish feature driver > fail: %s.\n", __FUNCTION__, ThisList->InformationExchange- > >SendInformation.FullUri)); > + DEBUG ((DEBUG_ERROR, "%a: Callback to EDK2 Redfish feature drive= r > fail: %s.\n", __FUNCTION__, ThisList->InformationExchange- > >SendInformation.FullUri)); > } > } > - if (!EFI_ERROR (Status) && ThisList->Callback !=3D NULL && ThisList- > >ChildList !=3D NULL) { > + > + if (!EFI_ERROR (Status) && (ThisList->Callback !=3D NULL) && (ThisLi= st- > >ChildList !=3D NULL)) { > // > // Go through child list only when the parent node is managed by f= eature > driver. > // > @@ -165,52 +174,56 @@ StartUpFeatureDriver ( > // Copy RESOURCE_INFORMATION_RETURNED then destroy the > exchange information. > // > CopyConfiglanguageList (&ThisList->InformationExchange- > >ReturnedInformation.ConfigureLanguageList, &ConfigLangList); > - DestroryExchangeInformation(ThisList); > + DestroryExchangeInformation (ThisList); > // > // Modify the collection instance according to the returned > InformationTypeCollectionMemberConfigLanguage. > // > - for (Index =3D 0; Index < ConfigLangList.Count; Index ++) { > + for (Index =3D 0; Index < ConfigLangList.Count; Index++) { > StrCatS (NextParentUri, MaxParentUriLength, ThisList->NodeNa= me); > StrCatS (NextParentUri, MaxParentUriLength, > NodeIsCollectionSymbol); > SetResourceConfigLangMemberInstance (&NextParentUri, > MaxParentUriLength, (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > *)&ConfigLangList.List[Index]); > - StartUpFeatureDriver(ThisList->ChildList, NextParentUri, > StartupContext); > + StartUpFeatureDriver (ThisList->ChildList, NextParentUri, > StartupContext); > } > + > DestroyConfiglanguageList (&ConfigLangList); > } else { > - DEBUG((DEBUG_ERROR, "%a: No > InformationTypeCollectionMemberConfigLanguage of %s returned.\n", > __FUNCTION__, ThisList->InformationExchange->SendInformation.FullUri)); > - DEBUG((DEBUG_ERROR, "%a: Redfish service maybe not connected o= r > the network has problems.\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: No > InformationTypeCollectionMemberConfigLanguage of %s returned.\n", > __FUNCTION__, ThisList->InformationExchange->SendInformation.FullUri)); > + DEBUG ((DEBUG_ERROR, "%a: Redfish service maybe not connected > or the network has problems.\n", __FUNCTION__)); > return; > } > } else { > StrCatS (NextParentUri, MaxParentUriLength, ThisList->NodeName); > - StartUpFeatureDriver(ThisList->ChildList, NextParentUri, > StartupContext); > + StartUpFeatureDriver (ThisList->ChildList, NextParentUri, > StartupContext); > } > + > // > // Restore the parent configure language URI for this level. > // > if (CurrentConfigLanguageUri !=3D NULL) { > - StrCpyS(NextParentUri, MaxParentUriLength, > CurrentConfigLanguageUri); > - } else{ > - NextParentUri [0] =3D 0; > + StrCpyS (NextParentUri, MaxParentUriLength, > CurrentConfigLanguageUri); > + } else { > + NextParentUri[0] =3D 0; > } > } else { > DestroryExchangeInformation (ThisList); > } > + > // > // Check sibling Redfish feature driver. > // > if (ThisList->SiblingList =3D=3D NULL) { > break; > } > + > // > // Go next sibling Redfish feature driver. > // > ThisList =3D ThisList->SiblingList; > - }; > + } > + > if (NextParentUri !=3D NULL) { > FreePool (NextParentUri); > } > - > } >=20 > /** > @@ -224,14 +237,16 @@ StartUpFeatureDriver ( > **/ > VOID > EFIAPI > -RedfishFeatureDriverStartup( > - IN EFI_EVENT Event, > - IN VOID *Context > +RedfishFeatureDriverStartup ( > + IN EFI_EVENT Event, > + IN VOID *Context > ) > { > - REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > + REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > + UINT16 RebootTimeout; >=20 > StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; > + RebootTimeout =3D PcdGet16 (PcdRedfishSystemRebootTimeout); > // > // Invoke EDK2 Redfish feature driver callback to start up > // the Redfish operations. > @@ -245,10 +260,15 @@ RedfishFeatureDriverStartup( > // > mInformationExchange =3D (RESOURCE_INFORMATION_EXCHANGE > *)AllocateZeroPool (sizeof (RESOURCE_INFORMATION_EXCHANGE)); > if (mInformationExchange =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: Fail to allocate memory for exchange > information.\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for exchange > information.\n", __FUNCTION__)); > return; > } >=20 > + // > + // Reset PcdRedfishSystemRebootRequired flag > + // > + PcdSetBoolS (PcdRedfishSystemRebootRequired, FALSE); > + > // > // Signal event before doing provisioning > // > @@ -263,6 +283,16 @@ RedfishFeatureDriverStartup( > // Signal event after provisioning finished > // > SignalAfterProvisioningEvent (); > + > + // > + // If system configuration is changed, reboot system. > + // > + if (PcdGetBool (PcdRedfishSystemRebootRequired)) { > + Print (L"System configuration is changed from RESTful interface. Reb= oot > system in %d seconds...\n", RebootTimeout); > + gBS->Stall (RebootTimeout * 1000000U); > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > + CpuDeadLoop (); > + } > } >=20 > /** > @@ -281,31 +311,33 @@ RedfishFeatureDriverStartup( > **/ > EFI_STATUS > NewInternalInstance ( > - IN OUT REDFISH_FEATURE_INTERNAL_DATA **PtrToNewInternalData, > - IN EFI_STRING NodeName, > - IN BOOLEAN NodeIsCollection > + IN OUT REDFISH_FEATURE_INTERNAL_DATA **PtrToNewInternalData, > + IN EFI_STRING NodeName, > + IN BOOLEAN NodeIsCollection > ) > { > - REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; > + REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; >=20 > - if (PtrToNewInternalData =3D=3D NULL || NodeName =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: Inproper given parameters\n", > __FUNCTION__)); > + if ((PtrToNewInternalData =3D=3D NULL) || (NodeName =3D=3D NULL)) { > + DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", > __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > *PtrToNewInternalData =3D NULL; > - NewInternalData =3D AllocateZeroPool (sizeof > (REDFISH_FEATURE_INTERNAL_DATA)); > + NewInternalData =3D AllocateZeroPool (sizeof > (REDFISH_FEATURE_INTERNAL_DATA)); > if (NewInternalData =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: No memory for > REDFISH_FEATURE_INTERNAL_DATA\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: No memory for > REDFISH_FEATURE_INTERNAL_DATA\n", __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } > + > NewInternalData->NodeName =3D AllocateZeroPool (StrSize (NodeName)); > StrnCpyS (NewInternalData->NodeName, StrSize (NodeName), (CONST > CHAR16 *)NodeName, StrLen (NodeName)); > NewInternalData->SiblingList =3D NULL; > - NewInternalData->ChildList =3D NULL; > + NewInternalData->ChildList =3D NULL; > if (NodeIsCollection) { > NewInternalData->Flags |=3D > REDFISH_FEATURE_INTERNAL_DATA_IS_COLLECTION; > } > + > *PtrToNewInternalData =3D NewInternalData; > return EFI_SUCCESS; > } > @@ -338,18 +370,19 @@ InsertRedfishFeatureUriNode ( > OUT REDFISH_FEATURE_INTERNAL_DATA **MatchNodeEntry > ) > { > - EFI_STATUS Status; > - REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; > - REDFISH_FEATURE_INTERNAL_DATA *ThisInternalData; > - REDFISH_FEATURE_INTERNAL_DATA *SiblingList; > + EFI_STATUS Status; > + REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; > + REDFISH_FEATURE_INTERNAL_DATA *ThisInternalData; > + REDFISH_FEATURE_INTERNAL_DATA *SiblingList; >=20 > *MatchNodeEntry =3D NULL; > if (NodeName =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: Node name is NULL.\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: Node name is NULL.\n", __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } > + > if (NextNodeEntry =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", > __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", > __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > @@ -358,27 +391,31 @@ InsertRedfishFeatureUriNode ( > if (EFI_ERROR (Status)) { > return Status; > } > - if (HeadEntryToInsert =3D=3D NULL && ResourceUriNodeList =3D=3D NULL= ) { > + > + if ((HeadEntryToInsert =3D=3D NULL) && (ResourceUriNodeList =3D=3D N= ULL)) { > ResourceUriNodeList =3D NewInternalData; > } else { > (*PrevisouEntry)->ChildList =3D NewInternalData; > } > + > *PrevisouEntry =3D NewInternalData; > *NextNodeEntry =3D NewInternalData->ChildList; > return EFI_SUCCESS; > } > + > // > // Go through sibling list to find the entry. > // > ThisInternalData =3D HeadEntryToInsert; > - SiblingList =3D ThisInternalData->SiblingList; > + SiblingList =3D ThisInternalData->SiblingList; > while (TRUE) { > - if (StrCmp((CONST CHAR16 *)ThisInternalData->NodeName, (CONST > CHAR16 *)NodeName) =3D=3D 0) { > + if (StrCmp ((CONST CHAR16 *)ThisInternalData->NodeName, (CONST > CHAR16 *)NodeName) =3D=3D 0) { > *MatchNodeEntry =3D ThisInternalData; > - *NextNodeEntry =3D ThisInternalData->ChildList; > - *PrevisouEntry =3D ThisInternalData; > + *NextNodeEntry =3D ThisInternalData->ChildList; > + *PrevisouEntry =3D ThisInternalData; > return EFI_SUCCESS; > } > + > // > // If sibing exist? > // > @@ -387,14 +424,17 @@ InsertRedfishFeatureUriNode ( > if (EFI_ERROR (Status)) { > return Status; > } > + > ThisInternalData->SiblingList =3D NewInternalData; > - *PrevisouEntry =3D NewInternalData; > - *NextNodeEntry =3D NewInternalData->ChildList; > + *PrevisouEntry =3D NewInternalData; > + *NextNodeEntry =3D NewInternalData->ChildList; > return EFI_SUCCESS; > } > + > ThisInternalData =3D SiblingList; > - SiblingList =3D ThisInternalData->SiblingList; > - }; > + SiblingList =3D ThisInternalData->SiblingList; > + } > + > return EFI_SUCCESS; > } >=20 > @@ -432,66 +472,74 @@ RedfishFeatureRegister ( > IN EFI_STRING FeatureManagedUri, > IN REDFISH_FEATURE_CALLBACK Callback, > IN VOID *Context > -) > + ) > { > - CHAR16 NodeName [MaxNodeNameLength]; > - EFI_STATUS Status; > - UINTN Index; > - UINTN AnchorIndex; > - UINTN UriLength; > - BOOLEAN NewUri; > - REDFISH_FEATURE_INTERNAL_DATA *ThisUriNode; > - REDFISH_FEATURE_INTERNAL_DATA *PreUriNode; > - REDFISH_FEATURE_INTERNAL_DATA *NewUriNode; > - REDFISH_FEATURE_INTERNAL_DATA *MatchNodeEntry; > - BOOLEAN ItsCollection; > - > - if (FeatureManagedUri =3D=3D NULL || Callback =3D=3D NULL) { > - DEBUG((DEBUG_ERROR, "%a: The given parameter is invalid\n", > __FUNCTION__)); > + CHAR16 NodeName[MaxNodeNameLength]; > + EFI_STATUS Status; > + UINTN Index; > + UINTN AnchorIndex; > + UINTN UriLength; > + BOOLEAN NewUri; > + REDFISH_FEATURE_INTERNAL_DATA *ThisUriNode; > + REDFISH_FEATURE_INTERNAL_DATA *PreUriNode; > + REDFISH_FEATURE_INTERNAL_DATA *NewUriNode; > + REDFISH_FEATURE_INTERNAL_DATA *MatchNodeEntry; > + BOOLEAN ItsCollection; > + > + if ((FeatureManagedUri =3D=3D NULL) || (Callback =3D=3D NULL)) { > + DEBUG ((DEBUG_ERROR, "%a: The given parameter is invalid\n", > __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } > + > // > // Walk through URI which managed by this EDK2 Redfish feature driver. > // > - UriLength =3D StrLen (FeatureManagedUri) + 1; // Add one NULL for the = last > node. > - Index =3D 0; > + UriLength =3D StrLen (FeatureManagedUri) + 1; // Add one NULL for th= e last > node. > + Index =3D 0; > AnchorIndex =3D 0; > ThisUriNode =3D ResourceUriNodeList; > - PreUriNode =3D ResourceUriNodeList; > - NewUri =3D FALSE; > + PreUriNode =3D ResourceUriNodeList; > + NewUri =3D FALSE; > while ((Index < UriLength)) { > - if ((Index - AnchorIndex + 1) >=3D MaxNodeNameLength) { // Increase = one > for the NULL terminator > - DEBUG((DEBUG_ERROR, "%a: the length of node name is >=3D > MaxNodeNameLength\n", __FUNCTION__)); > + if ((Index - AnchorIndex + 1) >=3D MaxNodeNameLength) { > + // Increase one for the NULL terminator > + DEBUG ((DEBUG_ERROR, "%a: the length of node name is >=3D > MaxNodeNameLength\n", __FUNCTION__)); > ASSERT (FALSE); > } > + > NodeName[Index - AnchorIndex] =3D *(FeatureManagedUri + Index); > - if (NodeName [Index - AnchorIndex] =3D=3D NodeSeperator || NodeName > [Index - AnchorIndex] =3D=3D UriSeperator || NodeName [Index - AnchorInde= x] > =3D=3D (CHAR16)0) { > - if (NodeName [Index - AnchorIndex] =3D=3D UriSeperator) { > + if ((NodeName[Index - AnchorIndex] =3D=3D NodeSeperator) || > (NodeName[Index - AnchorIndex] =3D=3D UriSeperator) || (NodeName[Index - > AnchorIndex] =3D=3D (CHAR16)0)) { > + if (NodeName[Index - AnchorIndex] =3D=3D UriSeperator) { > NewUri =3D TRUE; > } > - NodeName [Index - AnchorIndex] =3D 0; > - AnchorIndex =3D Index + 1; > + > + NodeName[Index - AnchorIndex] =3D 0; > + AnchorIndex =3D Index + 1; > // > // Insert node > // > - if (StrLen(NodeName) !=3D 0) { > + if (StrLen (NodeName) !=3D 0) { > ItsCollection =3D FALSE; > - if ((Index + StrLen(NodeIsCollectionSymbol)) < UriLength && > - *(FeatureManagedUri + Index + 1) =3D=3D NodeIsCollectionLeft= Bracket > && > - *(FeatureManagedUri + Index + 2) =3D=3D NodeIsCollectionRigh= tBracket) { > - Index +=3D (StrLen(NodeIsCollectionSymbol)); > - AnchorIndex +=3D (StrLen(NodeIsCollectionSymbol)); > + if (((Index + StrLen (NodeIsCollectionSymbol)) < UriLength) && > + (*(FeatureManagedUri + Index + 1) =3D=3D NodeIsCollectionLef= tBracket) > && > + (*(FeatureManagedUri + Index + 2) =3D=3D NodeIsCollectionRig= htBracket)) > + { > + Index +=3D (StrLen (NodeIsCollectionSymbol)); > + AnchorIndex +=3D (StrLen (NodeIsCollectionSymbol)); > ItsCollection =3D TRUE; > if (*(FeatureManagedUri + Index) =3D=3D UriSeperator) { > - NewUri =3D TRUE;; > + NewUri =3D TRUE; > } > } > - Status =3D InsertRedfishFeatureUriNode(ThisUriNode, &PreUriNode, > NodeName, ItsCollection, &NewUriNode, &MatchNodeEntry); > + > + Status =3D InsertRedfishFeatureUriNode (ThisUriNode, &PreUriNode= , > NodeName, ItsCollection, &NewUriNode, &MatchNodeEntry); > if (EFI_ERROR (Status)) { > return Status; > } > + > ThisUriNode =3D NewUriNode; > } > + > if (NewUri || ((Index + 1) >=3D UriLength)) { > // > // Setup the callabck and restart the searching for the > @@ -499,28 +547,31 @@ RedfishFeatureRegister ( > // > if (MatchNodeEntry !=3D NULL) { > MatchNodeEntry->Callback =3D Callback; > - MatchNodeEntry->Context =3D Context; > - MatchNodeEntry =3D NULL; > + MatchNodeEntry->Context =3D Context; > + MatchNodeEntry =3D NULL; > } else { > PreUriNode->Callback =3D Callback; > - PreUriNode->Context =3D Context; > + PreUriNode->Context =3D Context; > } > - NewUri =3D FALSE; > + > + NewUri =3D FALSE; > ThisUriNode =3D ResourceUriNodeList; > - Index ++; > + Index++; > continue; > } > } > - Index ++; > - }; > + > + Index++; > + } >=20 > if (ThisUriNode =3D=3D NULL) { > // > // No URI node was created > // > - DEBUG((DEBUG_ERROR, "%a: No URI node is added\n", __FUNCTION__)); > + DEBUG ((DEBUG_ERROR, "%a: No URI node is added\n", > __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } > + > return EFI_SUCCESS; > } >=20 > @@ -545,12 +596,12 @@ RedfishFeatureUnregister ( > IN EDKII_REDFISH_FEATURE_PROTOCOL *This, > IN EFI_STRING FeatureManagedUri, > IN VOID *Context > -) > + ) > { > return EFI_UNSUPPORTED; > } >=20 > -EDKII_REDFISH_FEATURE_PROTOCOL mRedfishFeatureProtocol =3D { > +EDKII_REDFISH_FEATURE_PROTOCOL mRedfishFeatureProtocol =3D { > RedfishFeatureRegister, > RedfishFeatureUnregister > }; > @@ -567,30 +618,30 @@ EDKII_REDFISH_FEATURE_PROTOCOL > mRedfishFeatureProtocol =3D { > EFI_STATUS > EFIAPI > RedfishFeatureCoreEntryPoint ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > ) > { > EFI_STATUS Status; > EFI_HANDLE Handle; > - EFI_GUID *EventGuid; > + EFI_GUID *EventGuid; >=20 > - Handle =3D NULL; > + Handle =3D NULL; > ResourceUriNodeList =3D NULL; > - EventGuid =3D (EFI_GUID *)PcdGetPtr > (PcdEdkIIRedfishFeatureDriverStartupEventGuid); > + EventGuid =3D (EFI_GUID *)PcdGetPtr > (PcdEdkIIRedfishFeatureDriverStartupEventGuid); >=20 > ZeroMem ((VOID *)&mFeatureDriverStartupContext, sizeof > (REDFISH_FEATURE_STARTUP_CONTEXT)); > - mFeatureDriverStartupContext.This =3D &mRedfishFeatureProtocol; > + mFeatureDriverStartupContext.This =3D &mRedfishFeatureProtocol; > mFeatureDriverStartupContext.Action =3D CallbackActionStartOperation; >=20 > Status =3D gBS->CreateEventEx ( > - EVT_NOTIFY_SIGNAL, > - TPL_CALLBACK, > - RedfishFeatureDriverStartup, > - (CONST VOID *)&mFeatureDriverStartupContext, > - EventGuid, > - &mEdkIIRedfishFeatureDriverStartupEvent > - ); > + EVT_NOTIFY_SIGNAL, > + TPL_CALLBACK, > + RedfishFeatureDriverStartup, > + (CONST VOID *)&mFeatureDriverStartupContext, > + EventGuid, > + &mEdkIIRedfishFeatureDriverStartupEvent > + ); > if (EFI_ERROR (Status)) { > return Status; > } > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > index 84b5e456d1..af274c01ca 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > @@ -2,6 +2,7 @@ > Definitions of RedfishFeatureCoreDxe >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -17,6 +18,8 @@ > #include > #include > #include > +#include > +#include > #include > #include >=20 > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > index ddcf991006..c67525eedd 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > @@ -4,6 +4,8 @@ > # drivers for the registration. > # > # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > ## > @@ -40,6 +42,7 @@ > RedfishFeatureUtilityLib > UefiBootServicesTableLib > UefiDriverEntryPoint > + UefiRuntimeServicesTableLib > UefiLib >=20 > [Protocols] > @@ -47,6 +50,8 @@ >=20 > [Pcd] >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupE > ventGuid > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootTimeout >=20 > [Depex] > TRUE > -- > 2.39.2.windows.1