From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.72]) by mx.groups.io with SMTP id smtpd.web09.28778.1658980090334701343 for ; Wed, 27 Jul 2022 20:48:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=Wn7v7icJ; 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.94.72, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lbpGZdQfRdLwsV7JPnt45BK27gqybgLNzjVrapJn0UmPMcKpyHMCI6bY0k5cbaHGopjnP3+KMS6jaFhVJv9EaUSbEsYbq6s7fd97cOTI3ki9XYLhbj1XRqg1hyFdmOj/+RZQj3vUs3u9ShuOcuy+tZGBQvulgYF9q8nRixcxD3U9VCEHJBtAvVibQqcuf0T5iERPTxBED8MuOz3bXFavmMYWJyg3NX561+HVsbYvOjaAw1HwHAQNuBfberSTs2XuzwYIlI6tDG2VrwM0m6Wvu+Si2QWE1khBL7aB5nUCkZ2nA3rS+g0vh3FCgyoj1jZkFqjFqeHp4zVqeGRJCF44CA== 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=6pOjX+eQZ4a0mBM2MSTD6Pyw3N5pURg/uEFS5Yk2h+Y=; b=C7mNX2tsRNUqZNQ0aBWq4E1HW6Telyu/ZvBFgZTwRF4+VcPtOSAH7w3F3FXPDwwQBJT32cdq/Z9OUh/AHt94t9MAoiqCpS9CHTcxBMHgH5I2LD5ruQRjM3QgkPZFAI87H9p9G/uNEZCyyvxo1nm6c5Tja3OW/7ZsS4UW+XhZbW5GY3BOlnlP59jsoRW2/lsr8PZnZ0dWnmalATVlRYHT9r/qnUJamOFXprR9/JMhza83Y4iEnILeBX53U+RZk8Q0NAzLLDWkxYY32Au1dIjUccVcHdb8NB0ErJxgY2APfZoN66xbPmHcB5ou+P4Wrt2Ao4/KvmOLAfdP+MlU5NxTrw== 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=6pOjX+eQZ4a0mBM2MSTD6Pyw3N5pURg/uEFS5Yk2h+Y=; b=Wn7v7icJnwV9P0H9yFOA5VD4xAANXRNrbFi54NzOZ0YGR01M0qUcTpc7qYLUpHcvh8kscK4SFGfCbKdVasEz7p5cWMfPtTFwQI7bIQZeYR7ir3QxlNgE4pEF3VKtn4iNyRfdVic+vTOcWUDFeuFFThIEaQxPCHZWXIp9mWUz1Ao= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by CY4PR1201MB2486.namprd12.prod.outlook.com (2603:10b6:903:d6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Thu, 28 Jul 2022 03:48:06 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06%5]) with mapi id 15.20.5458.025; Thu, 28 Jul 2022 03:48:05 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: "Yang, Atom" , Nick Ramirez Subject: Re: [edk2-staging][PATCH v3 14/15] edk2-staging/RedfishClientPkg: Introduce Computer System feature driver Thread-Topic: [edk2-staging][PATCH v3 14/15] edk2-staging/RedfishClientPkg: Introduce Computer System feature driver Thread-Index: AQHYoVmUQ0+YkJE4ukKxIvU5Zb4RcK2TJttg Date: Thu, 28 Jul 2022 03:48:05 +0000 Message-ID: References: <20220727013802.247-1-nickle.wang@hpe.com> <20220727013802.247-15-nickle.wang@hpe.com> In-Reply-To: <20220727013802.247-15-nickle.wang@hpe.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=2022-07-28T03:48:02Z; 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=85e3fbd1-00ae-4aee-b610-4e3d1a19cd83; 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-office365-filtering-correlation-id: 861fa394-596c-4e86-c04b-08da704bfabf x-ms-traffictypediagnostic: CY4PR1201MB2486:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KpEsCbmoSOl/hRCetPWqXcMqUlKgpe1xg4kuGQj4HubN6J5u5Y99gPzUSPZhoN3ul1id1FIpprWQYIN1CYODdVcqYQ+itwDyNmPHgqsy3DcNQE5be08AoIf1OAE3UAVteEDwVw/JAZrEqWgRiFXblyeQDpzgE/D1tXUJqwSOTnTa7XrjIWmUMjCe3cp9HeB+61FOmUstXb8sAyxcbXwVMN+cLl/ZbXdmMBhWNFBhxpagme6TqsH2AMClKlXUEeN/c/dh1VGtEke+iGCXz209dZmb6YyzKgeNg8Qg4SAzGUeFZJsOdSpjElXjfidebicozm+Ryn9x90UCqgqCPCtNP/TwcvqEoJ6rEhSfAXKeZX1XXvZPWW1qv/Yv8bVGOgjQ7jlZgVPV8Hn28Uol8LXnzEYQC/ydjxGajDb/GFVJNZkXnOpxZ8XU72WOBm+2y/d/06OTj8n/ll/EgMXiCo9BgJAQwNpMhrsPYm1cL4Dyczl8vUU0UkwRZR7Xb3k7I+Z0Yhc1hhlKObyIJ251KjQ+hiseS+ZBzrJp+GV0wE+qDbDKG8I6C4e6QvtspITkxXj+DfR7TrpZOspMtEpHTMZ8ZnoPQDP/2Edbu1P9FBID+s16iXnq7F7O/Jvg8QDl8z8o1+2fJQpJg95aDeU+4a7dWtGG7LfBb8xRC1pwYP3AyCOtACKgP4N3/lKO3fIVvuEeN8lfrbjiQ6Zrsc9ayBTq+JFw9Zh7KzrQAJuG7izH+pmAxGRVdsixudD9ero83DEhEXFdAXmWTYm7WNAeT/z4po9ip6ZKM1AzVfXbWhDI3X+z3ShH1kvVH1s2apblK1cLjZ7FuAWwzKSS/S4q0DOISw== 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:(13230016)(4636009)(39860400002)(396003)(136003)(376002)(366004)(346002)(6506007)(52536014)(5660300002)(8936002)(30864003)(64756008)(66476007)(66556008)(66446008)(4326008)(8676002)(296002)(55016003)(316002)(2906002)(33656002)(71200400001)(38100700002)(7696005)(26005)(54906003)(110136005)(41300700001)(478600001)(86362001)(122000001)(9686003)(53546011)(66946007)(83380400001)(76116006)(19627235002)(186003)(38070700005)(579004)(559001)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4Dvc3M1hKwod2PpIks5z0fhxXmWRHL/0PYcVrmEXLAgHMWWEo9Ve9T+t0nR+?= =?us-ascii?Q?rk8IO632KOOYKpGQp6M/DWDPB8e87tApMkqlIQXrvkaLyOqqOTlHDFG6AU7S?= =?us-ascii?Q?ykraldYGMXxj0PlWE/QbUGzrZPEUIvopa8wwi/Ko9wD+ne/D5+c5I+2yiIIh?= =?us-ascii?Q?YoQDn8jnYE58Nx38jvg19jdq6gqYzYpJIMCnzTXxI6aZm4FDRf1Rs1dqCSmo?= =?us-ascii?Q?fypytWc/fT6hYQiDMVjYZFDGD72fVR1SKRsv2rTzfFIOeho5+abBEtieLZAV?= =?us-ascii?Q?vZdKU+hZxEpVPcug1Rztp538IrFg5PXA4KjmHW9NyDs5DwsaId95Y+wkdC29?= =?us-ascii?Q?dAn1wi3Q6f0XlmyeQrlQn49vqZVurUyEe9oWISuf+J2vbfNTYoCbVZDs04P5?= =?us-ascii?Q?yXQlRiTKv9GNfWHDuq+IHfWKrWCbtDNWlXEKLQ+33hNvyJjaJolztnImNuHq?= =?us-ascii?Q?hyh07wbIIuFDMLhRqZZd2GQsUI/nNIqCVKF6SFLpqqBjWSRzFKymqFt/q5RZ?= =?us-ascii?Q?jjsBTYxO3kY7AkaZlG7k7U3Zk0WChf+q04rz/IyDjKR5m13bStkrYbJQY7+0?= =?us-ascii?Q?+b0rxRYWDc5tYHb2sFMaHTmu07tApv3FwLODXsdrH+Aa758Lw+zgz+ATMWbG?= =?us-ascii?Q?FdLcu9Ovyt4ys5zP8PTyHLwAhKf27YQRamZ/n/X6pswK1AtFuAGUMY9JgF0H?= =?us-ascii?Q?FSBIJEOdscSsApUVc0yBehBDDg1gqUY80lzOt9Bl6aLo21f4TBbpPv/dbo9o?= =?us-ascii?Q?23gESwwo+KE0K+egqBhexx6JVWuy6kTLL8xTyeplfFEq4k0eXNFiU7Lsd1Xa?= =?us-ascii?Q?PILwRy9vfddb9d4ojVyHYAHDru7jlpRbabc0owUOKLdNHi5DU2xuY8htObLV?= =?us-ascii?Q?CZSI9y4kKMdSqgetyM2jbgfiLCO4azvhx2oicaz95Q9S8ASovu5D9pB9b3Q8?= =?us-ascii?Q?c840OHpjbHxws13KJas7ng6vRlw3QH1fhxbjjYK7amridhgsmhyKVS95Gkg3?= =?us-ascii?Q?rVVfV1ux7eIvcW1b6HdcROyy6AX5PnB1ZYI6tyrTJ2xb4RI2CbN9nspswKnh?= =?us-ascii?Q?RhG/+Z2EDoJHFCbVVKWuXdH+a0JFEIrxT2JMEm+ufdLCUX2NGxZXqEkeUuzN?= =?us-ascii?Q?qEm1dVKiWgPj+OLAOIqjqeLs6lHnzl61GZv6zU1iOht3qrtxgGsfiyulthIy?= =?us-ascii?Q?hDVEH0Q49Hl+pxBufvwuKG77FG9hwhXMPRX70L+Yvo5uUcVrbiZGrs6ZH0wc?= =?us-ascii?Q?8uOvAVeqw4YeaRklibbEcwE/NA4R547C39L+btcvuRV+bT4x65QTgeFxBvB/?= =?us-ascii?Q?lm41QqGUVChXjZjuwV3xV6bYDetv3A1TMFsA4hpPWP+yyk6oZ3i8sxdy1oX2?= =?us-ascii?Q?THg2S7F22SBQdjkGPPxA9/lrfr6ManuIQ1Ro7wyPpqzIp5oFBBA3EXDKtT7S?= =?us-ascii?Q?nTiHFSp+T/6GV1l8zxG3hEsEqCA7oaGAplqVzvaqpYmJNmmCZRrpivQLPh2X?= =?us-ascii?Q?gwN5iv3ZYPzborfQdAYKn9rlFgb6gv+dwp0c9SvrW/KU2yDyJZJcTWtsCXvM?= =?us-ascii?Q?6/zwEmoZ4D+h2cCXjDyqfsXBv0tPupcgrUvSDP7r?= 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: 861fa394-596c-4e86-c04b-08da704bfabf X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2022 03:48:05.7918 (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: kIS8ZyxLDcLE/NFMsOdCvgxnPIzpgr1EL19J9BDwhzkr9onv6mvmzmdTuraiRISxEmM5lm6TyCWi5GxDno7+GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB2486 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, July 27, 2022 9:38 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Yang, Atom > ; Nick Ramirez > Subject: [edk2-staging][PATCH v3 14/15] edk2-staging/RedfishClientPkg: > Introduce Computer System feature driver >=20 > [CAUTION: External Email] >=20 > Introduce new feature driver to support Computer System version 1.5.0 > schema. Update corresponding FDF and DSC file to enable this feature > driver. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Yang Atom > Cc: Nick Ramirez > --- > .../v1_5_0/Common/ComputerSystemCommon.c | 1614 > +++++++++++++++++ > .../v1_5_0/Common/ComputerSystemCommon.h | 27 + > .../v1_5_0/Dxe/ComputerSystemDxe.c | 645 +++++++ > .../v1_5_0/Dxe/ComputerSystemDxe.inf | 51 + > RedfishClientPkg/RedfishClient.fdf.inc | 2 + > .../RedfishClientComponents.dsc.inc | 7 +- > RedfishClientPkg/RedfishClientLibs.dsc.inc | 1 + > 7 files changed, 2346 insertions(+), 1 deletion(-) > create mode 100644 > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSy > stemCommon.c > create mode 100644 > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSy > stemCommon.h > create mode 100644 > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > Dxe.c > create mode 100644 > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > Dxe.inf >=20 > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > new file mode 100644 > index 0000000000..0a9c746f3b > --- /dev/null > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > @@ -0,0 +1,1614 @@ > +/** @file > + Redfish feature driver implementation - common functions > + > + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "ComputerSystemCommon.h" > + > +CHAR8 ComputerSystemEmptyJson[] =3D "{\"@odata.id\": \"\", > \"@odata.type\": \"#ComputerSystem.v1_5_0.ComputerSystem\", \"Id\": > \"\", \"Name\": \"\", \"Boot\":{}}"; > + > +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D > NULL; > + > +/** > + Consume resource from given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + @param[in] HeaderEtag The Etag string returned in HTTP head= er. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishConsumeResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json, > + IN CHAR8 *HeaderEtag OPTIONAL > + ) > +{ > + EFI_STATUS Status; > + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem; > + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCs; > + EFI_STRING ConfigureLang; > + > + > + if (Private =3D=3D NULL || IS_EMPTY_STRING (Json)) { > + return EFI_INVALID_PARAMETER; > + } > + > + ComputerSystem =3D NULL; > + ComputerSystemCs =3D NULL; > + ConfigureLang =3D NULL; > + > + Status =3D Private->JsonStructProtocol->ToStructure ( > + Private->JsonStructProtocol, > + NULL, > + Json, > + (EFI_REST_JSON_STRUCTURE_HEADE= R > **)&ComputerSystem > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", > __FUNCTION__, Status)); > + return Status; > + } > + > + ComputerSystemCs =3D ComputerSystem->ComputerSystem; > + > + // > + // Check ETAG to see if we need to consume it > + // > + if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { > + // > + // No change > + // > + DEBUG ((DEBUG_INFO, "%a, ETAG: %s has no change, ignore consume > action\n", __FUNCTION__, Private->Uri)); > + Status =3D EFI_ALREADY_STARTED; > + goto ON_RELEASE; > + } > + > + // > + // Handle ASSETTAG > + // > + if (ComputerSystemCs->AssetTag !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "AssetTag"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >AssetTag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // BIOS will be handled by feature driver. > + // > + > + // > + // Handle BIOSVERSION > + // > + if (ComputerSystemCs->BiosVersion !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "BiosVersion"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >BiosVersion); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT > + // > + if (ComputerSystemCs->Boot =3D=3D NULL) { > + ComputerSystemCs->Boot =3D AllocateZeroPool (sizeof > (RedfishComputerSystem_V1_5_0_Boot_CS)); > + ASSERT (ComputerSystemCs->Boot !=3D NULL); > + } > + > + // > + // Handle BOOT->BOOTNEXT > + // > + if (ComputerSystemCs->Boot->BootNext !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/BootNext"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >BootNext); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT->BOOTORDER > + // > + if (ComputerSystemCs->Boot->BootOrder !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/BootOrder"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >BootOrder); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT->BOOTSOURCEOVERRIDEENABLED > + // > + if (ComputerSystemCs->Boot->BootSourceOverrideEnabled !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/BootSourceOverrideEnabled"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >BootSourceOverrideEnabled); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT->BOOTSOURCEOVERRIDEMODE > + // > + if (ComputerSystemCs->Boot->BootSourceOverrideMode !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/BootSourceOverrideMode"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >BootSourceOverrideMode); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT->BOOTSOURCEOVERRIDETARGET > + // > + if (ComputerSystemCs->Boot->BootSourceOverrideTarget !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/BootSourceOverrideTarget"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >BootSourceOverrideTarget); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle BOOT->UEFITARGETBOOTSOURCEOVERRIDE > + // > + if (ComputerSystemCs->Boot->UefiTargetBootSourceOverride !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Boot/UefiTargetBootSourceOverride"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot- > >UefiTargetBootSourceOverride); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // ETHERNETINTERFACES will be handled by collection driver. > + // > + > + // > + // Handle HOSTNAME > + // > + if (ComputerSystemCs->HostName !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "HostName"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >HostName); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle HOSTWATCHDOGTIMER > + // > + if (ComputerSystemCs->HostWatchdogTimer =3D=3D NULL) { > + ComputerSystemCs->HostWatchdogTimer =3D AllocateZeroPool (sizeof > (RedfishComputerSystem_V1_5_0_WatchdogTimer_CS)); > + ASSERT (ComputerSystemCs->HostWatchdogTimer !=3D NULL); > + } > + > + // > + // Handle HOSTWATCHDOGTIMER->FUNCTIONENABLED > + // > + if (ComputerSystemCs->HostWatchdogTimer->FunctionEnabled !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "HostWatchdogTimer/FunctionEnabled"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsBooleanType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, > (BOOLEAN)*ComputerSystemCs->HostWatchdogTimer->FunctionEnabled); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle HOSTWATCHDOGTIMER->TIMEOUTACTION > + // > + if (ComputerSystemCs->HostWatchdogTimer->TimeoutAction !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "HostWatchdogTimer/TimeoutAction"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >HostWatchdogTimer->TimeoutAction); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle HOSTWATCHDOGTIMER->WARNINGACTION > + // > + if (ComputerSystemCs->HostWatchdogTimer->WarningAction !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "HostWatchdogTimer/WarningAction"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >HostWatchdogTimer->WarningAction); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle HOSTEDSERVICES > + // > + if (ComputerSystemCs->HostedServices =3D=3D NULL) { > + ComputerSystemCs->HostedServices =3D AllocateZeroPool (sizeof > (RedfishComputerSystem_V1_5_0_HostedServices_CS)); > + ASSERT (ComputerSystemCs->HostedServices !=3D NULL); > + } > + > + // > + // Handle HOSTINGROLES > + // > +// > +// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle INDICATORLED > + // > + if (ComputerSystemCs->IndicatorLED !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "IndicatorLED"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >IndicatorLED); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // LOGSERVICES will be handled by collection driver. > + // > + > + // > + // Handle MANUFACTURER > + // > + if (ComputerSystemCs->Manufacturer !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Manufacturer"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >Manufacturer); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // MEMORY will be handled by collection driver. > + // > + > + // > + // Handle MEMORYSUMMARY > + // > + if (ComputerSystemCs->MemorySummary =3D=3D NULL) { > + ComputerSystemCs->MemorySummary =3D AllocateZeroPool (sizeof > (RedfishComputerSystem_V1_5_0_MemorySummary_CS)); > + ASSERT (ComputerSystemCs->MemorySummary !=3D NULL); > + } > + > + // > + // Handle MEMORYSUMMARY->MEMORYMIRRORING > + // > + if (ComputerSystemCs->MemorySummary->MemoryMirroring !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "MemorySummary/MemoryMirroring"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >MemorySummary->MemoryMirroring); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle MEMORYSUMMARY->TOTALSYSTEMMEMORYGIB > + // > + if (ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB !=3D > NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "MemorySummary/TotalSystemMemoryGiB"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsNumericType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, > (UINTN)*ComputerSystemCs->MemorySummary- > >TotalSystemMemoryGiB); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle MEMORYSUMMARY->TOTALSYSTEMPERSISTENTMEMORYGIB > + // > + if (ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "MemorySummary/TotalSystemPersistentMemoryGiB"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsNumericType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, > (UINTN)*ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle MODEL > + // > + if (ComputerSystemCs->Model !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "Model"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Model); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // NETWORKINTERFACES will be handled by collection driver. > + // > + > + // > + // Handle PCIEDEVICES > + // > +// > +// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle PCIEFUNCTIONS > + // > +// > +// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle PARTNUMBER > + // > + if (ComputerSystemCs->PartNumber !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "PartNumber"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >PartNumber); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle POWERSTATE > + // > + if (ComputerSystemCs->PowerState !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "PowerState"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >PowerState); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle PROCESSORSUMMARY > + // > + if (ComputerSystemCs->ProcessorSummary =3D=3D NULL) { > + ComputerSystemCs->ProcessorSummary =3D AllocateZeroPool (sizeof > (RedfishComputerSystem_V1_5_0_ProcessorSummary_CS)); > + ASSERT (ComputerSystemCs->ProcessorSummary !=3D NULL); > + } > + > + // > + // Handle PROCESSORSUMMARY->COUNT > + // > + if (ComputerSystemCs->ProcessorSummary->Count !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "ProcessorSummary/Count"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsNumericType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, > (UINTN)*ComputerSystemCs->ProcessorSummary->Count); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle PROCESSORSUMMARY->LOGICALPROCESSORCOUNT > + // > + if (ComputerSystemCs->ProcessorSummary->LogicalProcessorCount !=3D > NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "ProcessorSummary/LogicalProcessorCount"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsNumericType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, > (UINTN)*ComputerSystemCs->ProcessorSummary->LogicalProcessorCount); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle PROCESSORSUMMARY->MODEL > + // > + if (ComputerSystemCs->ProcessorSummary->Model !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "ProcessorSummary/Model"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >ProcessorSummary->Model); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // PROCESSORS will be handled by collection driver. > + // > + > + // > + // Handle REDUNDANCY > + // > +// > +// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle SKU > + // > + if (ComputerSystemCs->SKU !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "SKU"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->SKU); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // SECUREBOOT will be handled by feature driver. > + // > + > + // > + // Handle SERIALNUMBER > + // > + if (ComputerSystemCs->SerialNumber !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "SerialNumber"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >SerialNumber); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // SIMPLESTORAGE will be handled by collection driver. > + // > + > + // > + // STORAGE will be handled by collection driver. > + // > + > + // > + // Handle SUBMODEL > + // > + if (ComputerSystemCs->SubModel !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "SubModel"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >SubModel); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle SYSTEMTYPE > + // > + if (ComputerSystemCs->SystemType !=3D NULL) { > + // > + // Find corresponding configure language for collection resource. > + // > + ConfigureLang =3D GetConfigureLang (ComputerSystemCs->odata_id, > "SystemType"); > + if (ConfigureLang !=3D NULL) { > + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs- > >SystemType); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + FreePool (ConfigureLang); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: > %s\n", __FUNCTION__, Private->Uri)); > + } > + } > + > + // > + // Handle TRUSTEDMODULES > + // > +// > +// ****** Warning ****** > +// Unsupported array type: > +// > + > + > +ON_RELEASE: > + > + // > + // Release resource. > + // > + Private->JsonStructProtocol->DestoryStructure ( > + Private->JsonStructProtocol, > + (EFI_REST_JSON_STRUCTURE_HEADER *)Compu= terSystem > + ); > + > + return EFI_SUCCESS; > +} > + > +EFI_STATUS > +ProvisioningComputerSystemProperties ( > + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol, > + IN CHAR8 *InputJson, > + IN CHAR8 *ResourceId, OPTIONAL > + IN EFI_STRING ConfigureLang, > + IN BOOLEAN ProvisionMode, > + OUT CHAR8 **ResultJson > + ) > +{ > + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem; > + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCs; > + EFI_STATUS Status; > + BOOLEAN PropertyChanged; > + CHAR8 *AsciiStringValue; > + CHAR8 **AsciiStringArrayValue; > + UINTN ArraySize; > + BOOLEAN *BooleanValue; > + INT32 *IntegerValue; > + INT64 *NumericValue; > + > + > + > + if (JsonStructProtocol =3D=3D NULL || ResultJson =3D=3D NULL || > IS_EMPTY_STRING (InputJson) || IS_EMPTY_STRING (ConfigureLang)) { > + return EFI_INVALID_PARAMETER; > + } > + > + DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s with: %s\n", > __FUNCTION__, ConfigureLang, (ProvisionMode ? L"Provision resource" : > L"Update resource"))); > + > + *ResultJson =3D NULL; > + PropertyChanged =3D FALSE; > + > + ComputerSystem =3D NULL; > + Status =3D JsonStructProtocol->ToStructure ( > + JsonStructProtocol, > + NULL, > + InputJson, > + (EFI_REST_JSON_STRUCTURE_HEADER > **)&ComputerSystem > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, ToStructure failure: %r\n", __FUNCTION__, > Status)); > + return Status; > + } > + > + ComputerSystemCs =3D ComputerSystem->ComputerSystem; > + > + // > + // ID > + // > + if (ComputerSystemCs->Id =3D=3D NULL && !IS_EMPTY_STRING (ResourceId)) > { > + ComputerSystemCs->Id =3D AllocateCopyPool (AsciiStrSize (ResourceId)= , > ResourceId); > + } > + > + // > + // Handle ASSETTAG > + // > + if (PropertyChecker (ComputerSystemCs->AssetTag, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"AssetTag", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->AssetTag, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->AssetTag =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BIOSVERSION > + // > + if (PropertyChecker (ComputerSystemCs->BiosVersion, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"BiosVersion", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->BiosVersion, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->BiosVersion =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT > + // > + if (ComputerSystemCs->Boot !=3D NULL) { > + // > + // Handle BOOT->BOOTNEXT > + // > + if (PropertyChecker (ComputerSystemCs->Boot->BootNext, > ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootNext", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Boot- > >BootNext, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Boot->BootNext =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT->BOOTORDER > + // > + if (PropertyChecker (ComputerSystemCs->Boot->BootOrder, > ProvisionMode)) { > + AsciiStringArrayValue =3D GetPropertyStringArrayValue > (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootOrder", > ConfigureLang, &ArraySize); > + if (AsciiStringArrayValue !=3D NULL) { > + if (ProvisionMode || !CompareRedfishStringArrayValues > (ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize)) { > + AddRedfishCharArray (&ComputerSystemCs->Boot->BootOrder, > AsciiStringArrayValue, ArraySize); > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT->BOOTSOURCEOVERRIDEENABLED > + // > + if (PropertyChecker (ComputerSystemCs->Boot- > >BootSourceOverrideEnabled, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideEnabled", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideEnabled, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Boot->BootSourceOverrideEnabled =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT->BOOTSOURCEOVERRIDEMODE > + // > + if (PropertyChecker (ComputerSystemCs->Boot- > >BootSourceOverrideMode, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideMode", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideMode, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Boot->BootSourceOverrideMode =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT->BOOTSOURCEOVERRIDETARGET > + // > + if (PropertyChecker (ComputerSystemCs->Boot- > >BootSourceOverrideTarget, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideTarget", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideTarget, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Boot->BootSourceOverrideTarget =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle BOOT->UEFITARGETBOOTSOURCEOVERRIDE > + // > + if (PropertyChecker (ComputerSystemCs->Boot- > >UefiTargetBootSourceOverride, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/UefiTargetBootSourceOverride", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Boot- > >UefiTargetBootSourceOverride, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Boot->UefiTargetBootSourceOverride =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + } > + > + // > + // Handle HOSTNAME > + // > + if (PropertyChecker (ComputerSystemCs->HostName, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostName", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->HostName, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->HostName =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle HOSTWATCHDOGTIMER > + // > + if (ComputerSystemCs->HostWatchdogTimer !=3D NULL) { > + // > + // Handle HOSTWATCHDOGTIMER->FUNCTIONENABLED > + // > + if (PropertyChecker (ComputerSystemCs->HostWatchdogTimer- > >FunctionEnabled, ProvisionMode)) { > + BooleanValue =3D GetPropertyBooleanValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/FunctionEnabled", > ConfigureLang); > + if (BooleanValue !=3D NULL) { > + if (ProvisionMode || *ComputerSystemCs->HostWatchdogTimer- > >FunctionEnabled !=3D *BooleanValue) { > + IntegerValue =3D AllocatePool (sizeof (*IntegerValue)); > + if (IntegerValue !=3D NULL) { > + *IntegerValue =3D (BooleanValue ? 0x01 : 0x00); > + ComputerSystemCs->HostWatchdogTimer->FunctionEnabled =3D > IntegerValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + } > + // > + // Handle HOSTWATCHDOGTIMER->TIMEOUTACTION > + // > + if (PropertyChecker (ComputerSystemCs->HostWatchdogTimer- > >TimeoutAction, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/TimeoutAction", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs- > >HostWatchdogTimer->TimeoutAction, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->HostWatchdogTimer->TimeoutAction =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle HOSTWATCHDOGTIMER->WARNINGACTION > + // > + if (PropertyChecker (ComputerSystemCs->HostWatchdogTimer- > >WarningAction, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/WarningAction", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs- > >HostWatchdogTimer->WarningAction, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->HostWatchdogTimer->WarningAction =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + } > + > + // > + // Handle HOSTEDSERVICES > + // > + if (ComputerSystemCs->HostedServices !=3D NULL) { > + } > + > + // > + // Handle HOSTINGROLES > + // > +//// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle INDICATORLED > + // > + if (PropertyChecker (ComputerSystemCs->IndicatorLED, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"IndicatorLED", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->IndicatorLED, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->IndicatorLED =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle MANUFACTURER > + // > + if (PropertyChecker (ComputerSystemCs->Manufacturer, ProvisionMode)) > { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Manufacturer", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Manufacturer, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Manufacturer =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle MEMORYSUMMARY > + // > + if (ComputerSystemCs->MemorySummary !=3D NULL) { > + // > + // Handle MEMORYSUMMARY->MEMORYMIRRORING > + // > + if (PropertyChecker (ComputerSystemCs->MemorySummary- > >MemoryMirroring, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"MemorySummary/MemoryMirroring", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs- > >MemorySummary->MemoryMirroring, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->MemorySummary->MemoryMirroring =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle MEMORYSUMMARY->TOTALSYSTEMMEMORYGIB > + // > + if (PropertyChecker (ComputerSystemCs->MemorySummary- > >TotalSystemMemoryGiB, ProvisionMode)) { > + NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, > L"MemorySummary/TotalSystemMemoryGiB", ConfigureLang); > + if (NumericValue !=3D NULL) { > + if (ProvisionMode || *ComputerSystemCs->MemorySummary- > >TotalSystemMemoryGiB !=3D *NumericValue) { > + ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB =3D > NumericValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle MEMORYSUMMARY->TOTALSYSTEMPERSISTENTMEMORYGIB > + // > + if (PropertyChecker (ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB, ProvisionMode)) { > + NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, > L"MemorySummary/TotalSystemPersistentMemoryGiB", ConfigureLang); > + if (NumericValue !=3D NULL) { > + if (ProvisionMode || *ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB !=3D *NumericValue) { > + ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB =3D NumericValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + } > + > + // > + // Handle MODEL > + // > + if (PropertyChecker (ComputerSystemCs->Model, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Model", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->Model, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->Model =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle PCIEDEVICES > + // > +//// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle PCIEFUNCTIONS > + // > +//// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle PARTNUMBER > + // > + if (PropertyChecker (ComputerSystemCs->PartNumber, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"PartNumber", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->PartNumber, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->PartNumber =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle POWERSTATE > + // > + if (PropertyChecker (ComputerSystemCs->PowerState, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"PowerState", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->PowerState, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->PowerState =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle PROCESSORSUMMARY > + // > + if (ComputerSystemCs->ProcessorSummary !=3D NULL) { > + // > + // Handle PROCESSORSUMMARY->COUNT > + // > + if (PropertyChecker (ComputerSystemCs->ProcessorSummary->Count, > ProvisionMode)) { > + NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Count", > ConfigureLang); > + if (NumericValue !=3D NULL) { > + if (ProvisionMode || *ComputerSystemCs->ProcessorSummary- > >Count !=3D *NumericValue) { > + ComputerSystemCs->ProcessorSummary->Count =3D NumericValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle PROCESSORSUMMARY->LOGICALPROCESSORCOUNT > + // > + if (PropertyChecker (ComputerSystemCs->ProcessorSummary- > >LogicalProcessorCount, ProvisionMode)) { > + NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, > L"ProcessorSummary/LogicalProcessorCount", ConfigureLang); > + if (NumericValue !=3D NULL) { > + if (ProvisionMode || *ComputerSystemCs->ProcessorSummary- > >LogicalProcessorCount !=3D *NumericValue) { > + ComputerSystemCs->ProcessorSummary->LogicalProcessorCount =3D > NumericValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle PROCESSORSUMMARY->MODEL > + // > + if (PropertyChecker (ComputerSystemCs->ProcessorSummary->Model, > ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Model", > ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs- > >ProcessorSummary->Model, AsciiStringValue) !=3D 0) { > + ComputerSystemCs->ProcessorSummary->Model =3D AsciiStringValue= ; > + PropertyChanged =3D TRUE; > + } > + } > + } > + } > + > + // > + // Handle REDUNDANCY > + // > +//// ****** Warning ****** > +// Unsupported array type: > +// > + > + // > + // Handle SKU > + // > + if (PropertyChecker (ComputerSystemCs->SKU, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"SKU", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->SKU, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->SKU =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle SERIALNUMBER > + // > + if (PropertyChecker (ComputerSystemCs->SerialNumber, ProvisionMode)) > { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"SerialNumber", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->SerialNumber, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->SerialNumber =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle SUBMODEL > + // > + if (PropertyChecker (ComputerSystemCs->SubModel, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"SubModel", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->SubModel, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->SubModel =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle SYSTEMTYPE > + // > + if (PropertyChecker (ComputerSystemCs->SystemType, ProvisionMode)) { > + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"SystemType", ConfigureLang); > + if (AsciiStringValue !=3D NULL) { > + if (ProvisionMode || AsciiStrCmp (ComputerSystemCs->SystemType, > AsciiStringValue) !=3D 0) { > + ComputerSystemCs->SystemType =3D AsciiStringValue; > + PropertyChanged =3D TRUE; > + } > + } > + } > + // > + // Handle TRUSTEDMODULES > + // > +//// ****** Warning ****** > +// Unsupported array type: > +// > + > + > + // > + // Convert C structure back to JSON text. > + // > + Status =3D JsonStructProtocol->ToJson ( > + JsonStructProtocol, > + (EFI_REST_JSON_STRUCTURE_HEADER *)Compu= terSystem, > + ResultJson > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __FUNCTION__, > Status)); > + return Status; > + } > + > + // > + // Release resource. > + // > + JsonStructProtocol->DestoryStructure ( > + JsonStructProtocol, > + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem > + ); > + > + return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND); > +} > + > +EFI_STATUS > +ProvisioningComputerSystemResource ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN UINTN Index, > + IN EFI_STRING ConfigureLang > + ) > +{ > + CHAR8 *Json; > + EFI_STATUS Status; > + EFI_STRING NewResourceLocation; > + CHAR8 *EtagStr; > + CHAR8 ResourceId[16]; > + > + if (IS_EMPTY_STRING (ConfigureLang) || Private =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + EtagStr =3D NULL; > + AsciiSPrint (ResourceId, sizeof (ResourceId), "%d", Index); > + > + Status =3D ProvisioningComputerSystemProperties ( > + Private->JsonStructProtocol, > + ComputerSystemEmptyJson, > + ResourceId, > + ConfigureLang, > + TRUE, > + &Json > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, provisioning resource for %s failed: %r\n"= , > __FUNCTION__, ConfigureLang, Status)); > + return Status; > + } > + > + Status =3D CreatePayloadToPostResource (Private->RedfishService, Priva= te- > >Payload, Json, &NewResourceLocation, &EtagStr); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, post ComputerSystem resource for %s > failed: %r\n", __FUNCTION__, ConfigureLang, Status)); > + goto RELEASE_RESOURCE; > + } > + > + ASSERT (NewResourceLocation !=3D NULL); > + > + // > + // Keep location of new resource. > + // > + if (NewResourceLocation !=3D NULL) { > + RedfisSetRedfishUri (ConfigureLang, NewResourceLocation); > + } > + > + // > + // Handle Etag > + // > + if (EtagStr !=3D NULL) { > + SetEtagWithUri (EtagStr, NewResourceLocation); > + FreePool (EtagStr); > + } > + > +RELEASE_RESOURCE: > + > + if (NewResourceLocation !=3D NULL) { > + FreePool (NewResourceLocation); > + } > + > + if (Json !=3D NULL) { > + FreePool (Json); > + } > + > + return Status; > +} > + > +EFI_STATUS > +ProvisioningComputerSystemResources ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private > + ) > +{ > + UINTN Index; > + EFI_STATUS Status; > + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST > UnifiedConfigureLangList; > + > + if (Private =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang > (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, > REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList); > + if (EFI_ERROR (Status) || UnifiedConfigureLangList.Count =3D=3D 0) { > + DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure > language: %s: %r\n", __FUNCTION__, REDPATH_ARRAY_PATTERN, Status)); > + return EFI_NOT_FOUND; > + } > + // > + // Set the configuration language in the > RESOURCE_INFORMATION_EXCHANGE. > + // This information is sent back to the parent resource (e.g. the coll= ection > driver). > + // > + EdkIIRedfishResourceSetConfigureLang (&UnifiedConfigureLangList); > + > + for (Index =3D 0; Index < UnifiedConfigureLangList.Count; Index++) { > + DEBUG ((DEBUG_INFO, "[%d] create ComputerSystem resource from: > %s\n", UnifiedConfigureLangList.List[Index].Index, > UnifiedConfigureLangList.List[Index].ConfigureLang)); > + ProvisioningComputerSystemResource (Private, > UnifiedConfigureLangList.List[Index].Index, > UnifiedConfigureLangList.List[Index].ConfigureLang); > + FreePool (UnifiedConfigureLangList.List[Index].ConfigureLang); > + } > + > + return EFI_SUCCESS; > +} > + > + > +EFI_STATUS > +ProvisioningComputerSystemExistResource ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private > + ) > +{ > + EFI_STATUS Status; > + EFI_STRING ConfigureLang; > + CHAR8 *EtagStr; > + CHAR8 *Json; > + > + if (Private =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + EtagStr =3D NULL; > + Json =3D NULL; > + ConfigureLang =3D NULL; > + > + ConfigureLang =3D RedfishGetConfigLanguage (Private->Uri); > + if (ConfigureLang =3D=3D NULL) { > + return EFI_NOT_FOUND; > + } > + > + Status =3D ProvisioningComputerSystemProperties ( > + Private->JsonStructProtocol, > + ComputerSystemEmptyJson, > + NULL, > + ConfigureLang, > + TRUE, > + &Json > + ); > + if (EFI_ERROR (Status)) { > + if (Status =3D=3D EFI_NOT_FOUND) { > + DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource > for %s ignored. Nothing changed\n", __FUNCTION__, ConfigureLang)); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s > failed: %r\n", __FUNCTION__, ConfigureLang, Status)); > + } > + goto ON_RELEASE; > + } > + > + DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for > %s\n", __FUNCTION__, ConfigureLang)); > + // > + // PUT back to instance > + // > + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Priv= ate- > >Payload, Json, &EtagStr); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + // > + // Handle Etag > + // > + if (EtagStr !=3D NULL) { > + SetEtagWithUri (EtagStr, Private->Uri); > + FreePool (EtagStr); > + } > + > +ON_RELEASE: > + > + if (Json !=3D NULL) { > + FreePool (Json); > + } > + > + if (ConfigureLang !=3D NULL) { > + FreePool (ConfigureLang); > + } > + > + return Status; > +} > + > +/** > + Provisioning redfish resource by given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] ResourceExist TRUE if resource exists, PUT method w= ill be > used. > + FALSE if resource does not exist POST= method is used. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishProvisioningResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN BOOLEAN ResourceExist > + ) > +{ > + if (Private =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + return (ResourceExist ? ProvisioningComputerSystemExistResource > (Private) : ProvisioningComputerSystemResources (Private)); > +} > + > +/** > + Check resource from given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishCheckResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json > + ) > +{ > + UINTN Index; > + EFI_STATUS Status; > + EFI_STRING *ConfigureLangList; > + UINTN Count; > + EFI_STRING Property; > + > + if (Private =3D=3D NULL || IS_EMPTY_STRING (Json)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, > &ConfigureLangList, &Count); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, > BiosConfigToRedfishGetConfigureLangRegex failed: %r\n", __FUNCTION__, > Status)); > + return Status; > + } > + > + if (Count =3D=3D 0) { > + return EFI_NOT_FOUND; > + } > + > + Status =3D EFI_SUCCESS; > + for (Index =3D 0; Index < Count; Index++) { > + > + Property =3D GetPropertyFromConfigureLang (Private->Uri, > ConfigureLangList[Index]); > + if (Property =3D=3D NULL) { > + continue; > + } > + > + DEBUG ((DEBUG_INFO, "%a, [%d] check attribute for: %s\n", > __FUNCTION__, Index, Property)); > + if (!MatchPropertyWithJsonContext (Property, Json)) { > + DEBUG ((DEBUG_INFO, "%a, property is missing: %s\n", __FUNCTION__, > Property)); > + Status =3D EFI_NOT_FOUND; > + } > + } > + > + FreePool (ConfigureLangList); > + > + return Status; > +} > + > +/** > + Update resource to given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishUpdateResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *InputJson > + ) > +{ > + EFI_STATUS Status; > + CHAR8 *Json; > + EFI_STRING ConfigureLang; > + CHAR8 *EtagStr; > + > + if (Private =3D=3D NULL || IS_EMPTY_STRING (InputJson)) { > + return EFI_INVALID_PARAMETER; > + } > + > + EtagStr =3D NULL; > + Json =3D NULL; > + ConfigureLang =3D NULL; > + > + ConfigureLang =3D RedfishGetConfigLanguage (Private->Uri); > + if (ConfigureLang =3D=3D NULL) { > + return EFI_NOT_FOUND; > + } > + > + Status =3D ProvisioningComputerSystemProperties ( > + Private->JsonStructProtocol, > + InputJson, > + NULL, > + ConfigureLang, > + FALSE, > + &Json > + ); > + if (EFI_ERROR (Status)) { > + if (Status =3D=3D EFI_NOT_FOUND) { > + DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s ignored. > Nothing changed\n", __FUNCTION__, ConfigureLang)); > + } else { > + DEBUG ((DEBUG_ERROR, "%a, update resource for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + goto ON_RELEASE; > + } > + > + DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", > __FUNCTION__, ConfigureLang)); > + // > + // PUT back to instance > + // > + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Priv= ate- > >Payload, Json, &EtagStr); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", > __FUNCTION__, ConfigureLang, Status)); > + } > + > + // > + // Handle Etag > + // > + if (EtagStr !=3D NULL) { > + SetEtagWithUri (EtagStr, Private->Uri); > + FreePool (EtagStr); > + } > + > +ON_RELEASE: > + > + if (Json !=3D NULL) { > + FreePool (Json); > + } > + > + if (ConfigureLang !=3D NULL) { > + FreePool (ConfigureLang); > + } > + > + return Status; > +} > + > +/** > + Identify resource from given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishIdentifyResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json > + ) > +{ > + BOOLEAN Supported; > + EFI_STATUS Status; > + EFI_STRING EndOfChar; > + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList; > + > + Supported =3D RedfishIdentifyResource (Private->Uri, Private->Json); > + if (Supported) { > + Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang > (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, > REDPATH_ARRAY_PATTERN, &ConfigLangList); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, > BiosConfigToRedfishGetConfigureLangRegex failed: %r\n", __FUNCTION__, > Status)); > + return Status; > + } > + > + if (ConfigLangList.Count =3D=3D 0) { > + return EFI_SUCCESS; > + } > + > + EndOfChar =3D StrStr (ConfigLangList.List[0].ConfigureLang, L"}"); > + if (EndOfChar =3D=3D NULL) { > + ASSERT (FALSE); > + return EFI_DEVICE_ERROR; > + } > + > + //EndOfChar =3D StrStr (ConfigLangList.List[0].ConfigureLang, L"}"); > + Status =3D IsRedpathArray (ConfigLangList.List[0].ConfigureLang, NUL= L, > &EndOfChar); > + if (EFI_ERROR (Status) && Status !=3D EFI_NOT_FOUND) { > + ASSERT (FALSE); > + return EFI_DEVICE_ERROR; > + } > + if (Status !=3D EFI_SUCCESS) { > + // > + // This is not the collection redpath. > + // > + GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, > &EndOfChar); > + } > + *(++EndOfChar) =3D '\0'; > + // > + // Keep URI and ConfigLang mapping > + // > + RedfisSetRedfishUri (ConfigLangList.List[0].ConfigureLang, Private->= Uri); > + // > + // Set the configuration language in the > RESOURCE_INFORMATION_EXCHANGE. > + // This information is sent back to the parent resource (e.g. the co= llection > driver). > + // > + EdkIIRedfishResourceSetConfigureLang (&ConfigLangList); > + DestroyConfiglanguageList (&ConfigLangList); > + return EFI_SUCCESS; > + } > + > + return EFI_UNSUPPORTED; > +} > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.h > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.h > new file mode 100644 > index 0000000000..64efc7fd99 > --- /dev/null > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.h > @@ -0,0 +1,27 @@ > +/** @file > + > + Redfish feature driver implementation - internal header file > + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_ > +#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_ > + > +#include > 0.h> > +#include > + > +// > +// Schema information. > +// > +#define RESOURCE_SCHEMA "ComputerSystem" > +#define RESOURCE_SCHEMA_MAJOR "1" > +#define RESOURCE_SCHEMA_MINOR "5" > +#define RESOURCE_SCHEMA_ERRATA "0" > +#define RESOURCE_SCHEMA_VERSION "v1_5_0" > +#define REDPATH_ARRAY_PATTERN L"/Systems/\\{.*\\}/" > +#define REDPATH_ARRAY_PREFIX L"/Systems/" > +#define RESOURCE_SCHEMA_FULL "x-uefi-redfish- > ComputerSystem.v1_5_0" > + > +#endif > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > emDxe.c > new file mode 100644 > index 0000000000..c2a638d7c0 > --- /dev/null > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > emDxe.c > @@ -0,0 +1,645 @@ > +/** @file > + Redfish feature driver implementation - ComputerSystem > + > + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "../Common/ComputerSystemCommon.h" > + > +extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > + > +EFI_HANDLE medfishResourceConfigProtocolHandle; > + > +/** > + Provising redfish resource by given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] Uri Target URI to create resource. > + @param[in] PostMode TRUE if the resource does not exist, = post > method is used. > + FALSE if the resource exist but prope= rty is missing, put > method is used. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishResourceProvisioningResource ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri, > + IN BOOLEAN PostMode > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + > + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + return EFI_INVALID_PARAMETER; > + } > + > + DEBUG ((DEBUG_INFO, "%a, provisioning in %s mode\n", __FUNCTION__, > (PostMode ? L"POST" : L"PATCH"))); > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, Uri)); > + return Status; > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D Response.Payload; > + ASSERT (Private->Payload !=3D NULL); > + > + Status =3D RedfishProvisioningResourceCommon (Private, !PostMode); > + > + // > + // Release resource > + // > + if (Private->Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + Private->Payload =3D NULL; > + } > + > + return Status; > +} > + > +/** > + Consume resource from given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishResourceConsumeResource ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + CHAR8 *Etag; > + > + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, Uri)); > + return Status; > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D Response.Payload; > + ASSERT (Private->Payload !=3D NULL); > + > + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > + ASSERT (Private->Json !=3D NULL); > + > + // > + // Find etag in HTTP response header > + // > + Etag =3D NULL; > + Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", > __FUNCTION__)); > + } > + > + Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > + if (EFI_ERROR (Status)) { > + if (Status !=3D EFI_ALREADY_STARTED) { > + DEBUG ((DEBUG_ERROR, "%a, failed to consume resource from: %s: > %r\n", __FUNCTION__, Uri, Status)); > + } > + } else { > + // > + // Keep etag after consuming pending settings. > + // > + if (Etag !=3D NULL) { > + SetEtagWithUri (Etag, Private->Uri); > + } > + } > + > + // > + // Release resource > + // > + if (Private->Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + Private->Payload =3D NULL; > + } > + > + if (Private->Json !=3D NULL) { > + FreePool (Private->Json); > + Private->Json =3D NULL; > + } > + > + return Status; > +} > + > +/** > + Get information about this protocol. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[out] Schema Supported schema. > + @param[out] Major Supported major number. > + @param[out] Minor Supported minor number. > + @param[out] Errata Supported errata number. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishResourceGetInfo ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + OUT REDFISH_SCHEMA_INFO *Info > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + > + if (This =3D=3D NULL || Info =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + AsciiStrCpyS (Info->Schema, REDFISH_SCHEMA_STRING_SIZE, > RESOURCE_SCHEMA); > + AsciiStrCpyS (Info->Major, REDFISH_SCHEMA_VERSION_SIZE, > RESOURCE_SCHEMA_MAJOR); > + AsciiStrCpyS (Info->Minor, REDFISH_SCHEMA_VERSION_SIZE, > RESOURCE_SCHEMA_MINOR); > + AsciiStrCpyS (Info->Errata, REDFISH_SCHEMA_VERSION_SIZE, > RESOURCE_SCHEMA_ERRATA); > + > + return EFI_SUCCESS; > +} > + > +/** > + Update resource to given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishResourceUpdate ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + > + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, Uri)); > + return Status; > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D Response.Payload; > + ASSERT (Private->Payload !=3D NULL); > + > + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > + ASSERT (Private->Json !=3D NULL); > + > + Status =3D RedfishUpdateResourceCommon (Private, Private->Json); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to update resource from: %s: %r\n", > __FUNCTION__, Uri, Status)); > + } > + > + // > + // Release resource > + // > + if (Private->Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + Private->Payload =3D NULL; > + } > + > + if (Private->Json !=3D NULL) { > + FreePool (Private->Json); > + Private->Json =3D NULL; > + } > + > + return Status; > +} > + > +/** > + Check resource on given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishResourceCheck ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + > + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, Uri)); > + return Status; > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D Response.Payload; > + ASSERT (Private->Payload !=3D NULL); > + > + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > + ASSERT (Private->Json !=3D NULL); > + > + Status =3D RedfishCheckResourceCommon (Private, Private->Json); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __FUNCTION__, Uri, Status)); > + } > + > + // > + // Release resource > + // > + if (Private->Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + Private->Payload =3D NULL; > + } > + > + if (Private->Json !=3D NULL) { > + FreePool (Private->Json); > + Private->Json =3D NULL; > + } > + > + return Status; > +} > + > +/** > + Identify resource on given URI. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS This is target resource which we want= to > handle. > + @retval EFI_UNSUPPORTED This is not the target resource. > + @retval Others Some error happened. > + > +**/ > + > +EFI_STATUS > +RedfishResourceIdentify ( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + > + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL (This); > + > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, Uri)); > + return Status; > + } > + > + Private->Uri =3D Uri; > + Private->Payload =3D Response.Payload; > + ASSERT (Private->Payload !=3D NULL); > + > + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > + ASSERT (Private->Json !=3D NULL); > + > + Status =3D RedfishIdentifyResourceCommon (Private, Private->Json); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __FUNCTION__, > Uri, Status)); > + } > + // > + // Release resource > + // > + if (Private->Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + Private->Payload =3D NULL; > + } > + > + if (Private->Json !=3D NULL) { > + FreePool (Private->Json); > + Private->Json =3D NULL; > + } > + > + return Status; > +} > + > +EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig > =3D { > + RedfishResourceProvisioningResource, > + RedfishResourceConsumeResource, > + RedfishResourceUpdate, > + RedfishResourceCheck, > + RedfishResourceIdentify, > + RedfishResourceGetInfo > +}; > + > +/** > + Initialize a Redfish configure handler. > + > + This function will be called by the Redfish config driver to initializ= e each > Redfish configure > + handler. > + > + @param[in] This Pointer to > EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL instance. > + @param[in] RedfishConfigServiceInfo Redfish service informaion. > + > + @retval EFI_SUCCESS The handler has been initialized = successfully. > + @retval EFI_DEVICE_ERROR Failed to create or configure the= REST EX > protocol instance. > + @retval EFI_ALREADY_STARTED This handler has already been > initialized. > + @retval Other Error happens during the initiali= zation. > + > +**/ > +EFI_STATUS > +EFIAPI > +RedfishResourceInit ( > + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This, > + IN REDFISH_CONFIG_SERVICE_INFORMATION > *RedfishConfigServiceInfo > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); > + > + Private->RedfishService =3D RedfishCreateService > (RedfishConfigServiceInfo); > + if (Private->RedfishService =3D=3D NULL) { > + return EFI_DEVICE_ERROR; > + } > + > + return EFI_SUCCESS; > +} > + > +/** > + Stop a Redfish configure handler. > + > + @param[in] This Pointer to > EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL instance. > + > + @retval EFI_SUCCESS This handler has been stoped successf= ully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +EFIAPI > +RedfishResourceStop ( > + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This > + ) > +{ > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + > + Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); > + > + if (Private->Event !=3D NULL) { > + gBS->CloseEvent (Private->Event); > + Private->Event =3D NULL; > + } > + > + if (Private->RedfishService !=3D NULL) { > + RedfishCleanupService (Private->RedfishService); > + Private->RedfishService =3D NULL; > + } > + > + if (Private->Payload !=3D NULL) { > + RedfishCleanupPayload (Private->Payload); > + Private->Payload =3D NULL; > + } > + > + return EFI_SUCCESS; > +} > + > +EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D { > + RedfishResourceInit, > + RedfishResourceStop > +}; > + > +/** > + Callback function when gEfiRestJsonStructureProtocolGuid is installed. > + > + @param[in] Event Event whose notification function is being invoked= . > + @param[in] Context Pointer to the notification function's context. > +**/ > +VOID > +EFIAPI > +EfiRestJasonStructureProtocolIsReady > + ( > + IN EFI_EVENT Event, > + IN VOID *Context > + ) > +{ > + EFI_STATUS Status; > + > + if (mRedfishResourcePrivate =3D=3D NULL) { > + return; > + } > + > + if (mRedfishResourcePrivate->JsonStructProtocol !=3D NULL) { > + return; > + } > + > + Status =3D gBS->LocateProtocol ( > + &gEfiRestJsonStructureProtocolGuid, > + NULL, > + (VOID **)&mRedfishResourcePrivate->JsonStructProtocol > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to locate > gEfiRestJsonStructureProtocolGuid: %r\n", __FUNCTION__, Status)); > + } > + > + gBS->CloseEvent (Event); > +} > + > +/** > + Unloads an image. > + > + @param ImageHandle Handle that identifies the image to be > unloaded. > + > + @retval EFI_SUCCESS The image has been unloaded. > + @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image > handle. > + > +**/ > +EFI_STATUS > +EFIAPI > +RedfishResourceUnload ( > + IN EFI_HANDLE ImageHandle > + ) > +{ > + EFI_STATUS Status; > + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler; > + > + if (mRedfishResourcePrivate =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + ConfigHandler =3D NULL; > + > + // > + // Firstly, find ConfigHandler Protocol interface in this ImageHandle. > + // > + Status =3D gBS->OpenProtocol ( > + ImageHandle, > + &gEdkIIRedfishConfigHandlerProtocolGuid, > + (VOID **) &ConfigHandler, > + NULL, > + NULL, > + EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL > + ); > + if (EFI_ERROR (Status) || ConfigHandler =3D=3D NULL) { > + return Status; > + } > + > + ConfigHandler->Stop (ConfigHandler); > + > + // > + // Last, uninstall ConfigHandler Protocol and resource protocol. > + // > + Status =3D gBS->UninstallMultipleProtocolInterfaces ( > + ImageHandle, > + &gEdkIIRedfishConfigHandlerProtocolGuid, > + ConfigHandler, > + &gEdkIIRedfishResourceConfigProtocolGuid, > + &mRedfishResourcePrivate->RedfishResourceConfig, > + NULL > + ); > + > + FreePool (mRedfishResourcePrivate); > + mRedfishResourcePrivate =3D NULL; > + > + return Status; > +} > + > + > +/** > + This is the declaration of an EFI image entry point. This entry point = is > + the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers incl= uding > + both device drivers and bus drivers. It initialize the global variable= s and > + publish the driver binding protocol. > + > + @param[in] ImageHandle The firmware allocated handle for the UE= FI > image. > + @param[in] SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The operation completed successfully. > + @retval EFI_ACCESS_DENIED EFI_ISCSI_INITIATOR_NAME_PROTOCOL > was installed unexpectedly. > + @retval Others Other errors as indicated. > +**/ > +EFI_STATUS > +EFIAPI > +RedfishResourceEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + VOID *Registration; > + > + if (mRedfishResourcePrivate !=3D NULL) { > + return EFI_ALREADY_STARTED; > + } > + > + medfishResourceConfigProtocolHandle =3D ImageHandle; > + > + mRedfishResourcePrivate =3D AllocateZeroPool (sizeof > (REDFISH_RESOURCE_COMMON_PRIVATE)); > + CopyMem (&mRedfishResourcePrivate->ConfigHandler, > &mRedfishConfigHandler, sizeof > (EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL)); > + CopyMem (&mRedfishResourcePrivate->RedfishResourceConfig, > &mRedfishResourceConfig, sizeof > (EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL)); > + > + // > + // Publish config handler protocol and resource protocol. > + // > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > + &ImageHandle, > + &gEdkIIRedfishConfigHandlerProtocolGuid, > + &mRedfishResourcePrivate->ConfigHandler, > + &gEdkIIRedfishResourceConfigProtocolGuid, > + &mRedfishResourcePrivate->RedfishResourceConfig, > + NULL > + ); > + > + EfiCreateProtocolNotifyEvent ( > + &gEfiRestJsonStructureProtocolGuid, > + TPL_CALLBACK, > + EfiRestJasonStructureProtocolIsReady, > + NULL, > + &Registration > + ); > + > + return Status; > +} > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.inf > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > emDxe.inf > new file mode 100644 > index 0000000000..67412f5f31 > --- /dev/null > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyst > emDxe.inf > @@ -0,0 +1,51 @@ > +## @file > +# > +# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development > LP
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D ComputerSystemDxe > + FILE_GUID =3D 584bae05-d78d-4df9-b5e9-3e987a99480a > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D RedfishResourceEntryPoint > + UNLOAD_IMAGE =3D RedfishResourceUnload > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RedfishPkg/RedfishPkg.dec > + RedfishClientPkg/RedfishClientPkg.dec > + > +[Sources] > + ../Common/ComputerSystemCommon.h > + ../Common/ComputerSystemCommon.c > + ComputerSystemDxe.c > + > +[LibraryClasses] > + BaseMemoryLib > + DebugLib > + EdkIIRedfishResourceConfigLib > + RedfishLib > + RedfishFeatureUtilityLib > + RedfishResourceIdentifyLib > + UefiLib > + UefiDriverEntryPoint > + > + > +[Protocols] > + gEdkIIRedfishConfigHandlerProtocolGuid ## PRODUCED > + gEfiRestJsonStructureProtocolGuid ## CONSUMED > + gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED > + > +[Pcd] > + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize > + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize > + > +[Depex] > + TRUE > diff --git a/RedfishClientPkg/RedfishClient.fdf.inc > b/RedfishClientPkg/RedfishClient.fdf.inc > index 7d5de56591..90240efbf7 100644 > --- a/RedfishClientPkg/RedfishClient.fdf.inc > +++ b/RedfishClientPkg/RedfishClient.fdf.inc > @@ -16,6 +16,7 @@ > INF > RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.inf > INF RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf > INF > RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf > + INF > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > Dxe.inf > INF > RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSyste > mCollectionDxe.inf >=20 > !include RedfishClientPkg/RedfishJsonStructureDxe.fdf.inc > @@ -24,5 +25,6 @@ > # > INF > RedfishClientPkg/Converter/Memory/v1_7_1/RedfishMemory_V1_7_1_Dx > e.inf > INF > RedfishClientPkg/Converter/MemoryCollection/RedfishMemoryCollection_ > Dxe.inf > + INF > RedfishClientPkg/Converter/ComputerSystem/v1_5_0/RedfishComputerSys > tem_V1_5_0_Dxe.inf > INF > RedfishClientPkg/Converter/ComputerSystemCollection/RedfishComputerS > ystemCollection_Dxe.inf > !endif > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc > b/RedfishClientPkg/RedfishClientComponents.dsc.inc > index d4a33385f6..084796e4b5 100644 > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc > @@ -16,11 +16,16 @@ > RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.inf >=20 > RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.inf > +!endif > # > # Below two modules should be pulled in by build tool. > # > RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.inf >=20 > RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf > + > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > Dxe.inf { > + > + > RedfishResourceIdentifyLib|RedfishClientPkg/Library/RedfishResourceIdenti > fyLibComuterSystem/v1_5_0/RedfishResourceIdentifyLibComuterSystem.in > f > + } >=20 > RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSyste > mCollectionDxe.inf >=20 > !include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc > @@ -30,5 +35,5 @@ > # >=20 > RedfishClientPkg/Converter/Memory/v1_7_1/RedfishMemory_V1_7_1_Dx > e.inf >=20 > RedfishClientPkg/Converter/MemoryCollection/RedfishMemoryCollection_ > Dxe.inf > -!endif > + > RedfishClientPkg/Converter/ComputerSystem/v1_5_0/RedfishComputerSys > tem_V1_5_0_Dxe.inf >=20 > RedfishClientPkg/Converter/ComputerSystemCollection/RedfishComputerS > ystemCollection_Dxe.inf > diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc > b/RedfishClientPkg/RedfishClientLibs.dsc.inc > index 21595613f5..05ad09ef5e 100644 > --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc > +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc > @@ -19,6 +19,7 @@ > # >=20 > MemoryV1_7_1Lib|RedfishClientPkg/ConverterLib/edk2library/Memory/v1 > _7_1/Lib.inf >=20 > MemoryCollectionLib|RedfishClientPkg/ConverterLib/edk2library/MemoryC > ollection/Lib.inf > + > ComputerSystemV1_5_0Lib|RedfishClientPkg/ConverterLib/edk2library/Co > mputerSystem/v1_5_0/Lib.inf >=20 > ComputerSystemCollectionLib|RedfishClientPkg/ConverterLib/edk2library/C > omputerSystemCollection/Lib.inf >=20 > NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf > -- > 2.32.0.windows.2