From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.8537.1657628527676215356 for ; Tue, 12 Jul 2022 05:22:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=LWfxSn8N; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0192e24d61=nickle.wang@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26CCHuUO021148; Tue, 12 Jul 2022 12:22:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=JpjFDGaQTfjK9n9p5XvU9vvEVn0WHBDidxg2PvFiB6Q=; b=LWfxSn8NrAY+bOaZmeoxrxkboVwb3GeT1v6+pwzQwyXP6jVIiNPma60wQyPnD3JlDkyM /3jGqDD+LDTdK54iGz2qspBmWxH0jesm/4HIHBZJ2BwZSoIlpgrZ0W56jRkXfAw8lOjg 36ZC23qVxeVWXcvx9GCF0rNPAr6kOdVxwMX9wmr1Ex1tITSS/dAIHpo0batMw0LwTJxc ch0Qa+7SmSTUPr0DnMFujU+9Q83JQ8CTQeH4I8lxPwfoGlZYRXYYnzloB14fsCWaAMh2 6pRVAXdGHRQg+Y3vviR5OezQjCgQRQMro2KSFBhehE6Q78hPgqKvvlveiBR/2tZYH/vO 5Q== Received: from p1lg14880.it.hpe.com (p1lg14880.it.hpe.com [16.230.97.201]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3h98u8011f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Jul 2022 12:22:05 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14880.it.hpe.com (Postfix) with ESMTPS id D05A4800223; Tue, 12 Jul 2022 12:22:04 +0000 (UTC) Received: from WAFM3XJD5N.asiapacific.hpqcorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id CD7D6803287; Tue, 12 Jul 2022 12:22:03 +0000 (UTC) From: "Nickle Wang" To: devel@edk2.groups.io Cc: Abner Chang , Yang Atom , Nick Ramirez Subject: [edk2-staging][PATCH 15/15] edk2-staging/RedfishClientPkg: Introduce Bios feature driver Date: Tue, 12 Jul 2022 20:21:43 +0800 Message-Id: <20220712122143.1827-16-nickle.wang@hpe.com> X-Mailer: git-send-email 2.32.0.windows.2 In-Reply-To: <20220712122143.1827-1-nickle.wang@hpe.com> References: <20220712122143.1827-1-nickle.wang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: R_Be3RX3il28794MvdHIQwB63_HWeiHA X-Proofpoint-ORIG-GUID: R_Be3RX3il28794MvdHIQwB63_HWeiHA X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-12_08,2022-07-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207120048 Content-Transfer-Encoding: quoted-printable Introduce new feature driver to support Bios version 1.0.9 schema. Update corresponding FDF and DSC file to enable this feature driver. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Yang Atom Cc: Nick Ramirez --- .../Features/Bios/v1_0_9/Common/BiosCommon.c | 741 ++++++++++++++++ .../Features/Bios/v1_0_9/Common/BiosCommon.h | 30 + .../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 789 ++++++++++++++++++ .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf | 52 ++ RedfishClientPkg/RedfishClient.fdf.inc | 2 + .../RedfishClientComponents.dsc.inc | 2 + RedfishClientPkg/RedfishClientLibs.dsc.inc | 6 +- 7 files changed, 1621 insertions(+), 1 deletion(-) create mode 100644 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon= .c create mode 100644 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon= .h create mode 100644 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c create mode 100644 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/Re= dfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c new file mode 100644 index 0000000000..d910d0d8a9 --- /dev/null +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -0,0 +1,741 @@ +/** @file=0D + Redfish feature driver implementation - common functions=0D +=0D + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "BiosCommon.h"=0D +=0D +CHAR8 BiosEmptyJson[] =3D "{\"@odata.id\": \"\", \"@odata.type\": \"#Bios.= v1_0_9.Bios\", \"Id\": \"\", \"Name\": \"\", \"Attributes\":{}}";=0D +=0D +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate =3D NULL;=0D +=0D +/**=0D + Consume resource from given URI.=0D +=0D + @param[in] This Pointer to REDFISH_RESOURCE_COMMON_PRIV= ATE instance.=0D + @param[in] Json The JSON to consume.=0D + @param[in] HeaderEtag The Etag string returned in HTTP header= .=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishConsumeResourceCommon (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN CHAR8 *Json,=0D + IN CHAR8 *HeaderEtag OPTIONAL=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_REDFISH_BIOS_V1_0_9 *Bios;=0D + EFI_REDFISH_BIOS_V1_0_9_CS *BiosCs;=0D + EFI_STRING ConfigureLang;=0D + RedfishCS_Type_EmptyProp_CS_Data *EmptyPropCs;=0D +=0D +=0D + if (Private =3D=3D NULL || IS_EMPTY_STRING (Json)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Bios =3D NULL;=0D + BiosCs =3D NULL;=0D + ConfigureLang =3D NULL;=0D +=0D + Status =3D Private->JsonStructProtocol->ToStructure (=0D + Private->JsonStructProtocol,=0D + NULL,=0D + Json,=0D + (EFI_REST_JSON_STRUCTURE_HEADER = **)&Bios=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __FUNCTION__, S= tatus));=0D + return Status;=0D + }=0D +=0D + BiosCs =3D Bios->Bios;=0D +=0D + //=0D + // Check ETAG to see if we need to consume it=0D + //=0D + if (CheckEtag (Private->Uri, HeaderEtag, BiosCs->odata_etag)) {=0D + //=0D + // No change=0D + //=0D + DEBUG ((DEBUG_INFO, "%a, ETAG: %s has no change, ignore consume action= \n", __FUNCTION__, Private->Uri));=0D + Status =3D EFI_ALREADY_STARTED;=0D + goto ON_RELEASE;=0D + }=0D +=0D + //=0D + // Handle ATTRIBUTEREGISTRY=0D + //=0D + if (BiosCs->AttributeRegistry !=3D NULL) {=0D + //=0D + // Find corresponding configure language for collection resource.=0D + //=0D + ConfigureLang =3D GetConfigureLang (BiosCs->odata_id, "AttributeRegist= ry");=0D + if (ConfigureLang !=3D NULL) {=0D + Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, ConfigureLang, BiosCs->AttributeRegistry);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __FU= NCTION__, ConfigureLang, Status));=0D + }=0D +=0D + FreePool (ConfigureLang);=0D + } else {=0D + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s= \n", __FUNCTION__, Private->Uri));=0D + }=0D + }=0D +=0D + //=0D + // Handle ATTRIBUTES=0D + //=0D + if (BiosCs->Attributes =3D=3D NULL) {=0D + BiosCs->Attributes =3D AllocateZeroPool (sizeof (RedfishBios_V1_0_9_At= tributes_CS));=0D + ASSERT (BiosCs->Attributes !=3D NULL);=0D + }=0D +=0D + //=0D + // Handle ATTRIBUTES->EmptyProperty=0D + //=0D + if (BiosCs->Attributes !=3D NULL) {=0D + //=0D + // Validate empty property.=0D + //=0D + if (BiosCs->Attributes->Prop.ForwardLink =3D=3D &BiosCs->Attributes->P= rop) {=0D + goto ON_RELEASE;=0D + }=0D + EmptyPropCs =3D (RedfishCS_Type_EmptyProp_CS_Data *)BiosCs->Attributes= ->Prop.ForwardLink;=0D + if (EmptyPropCs->Header.ResourceType =3D=3D RedfishCS_Type_JSON) {=0D + DEBUG ((DEBUG_ERROR, "%a, Empty property with RedfishCS_Type_JSON ty= pe resource is not supported yet. (%s)\n", __FUNCTION__, Private->Uri));=0D + goto ON_RELEASE;=0D + }=0D + //=0D + // Find corresponding configure language for collection resource.=0D + //=0D + ConfigureLang =3D GetConfigureLang (BiosCs->odata_id, "Attributes");=0D + if (ConfigureLang !=3D NULL) {=0D + Status =3D ApplyFeatureSettingsVagueType (RESOURCE_SCHEMA, RESOURCE_= SCHEMA_VERSION, ConfigureLang, EmptyPropCs->KeyValuePtr, EmptyPropCs->NunmO= fProperties);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __FU= NCTION__, ConfigureLang, Status));=0D + }=0D +=0D + FreePool (ConfigureLang);=0D + } else {=0D + DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s= \n", __FUNCTION__, Private->Uri));=0D + }=0D + }=0D +=0D +=0D +ON_RELEASE:=0D +=0D + //=0D + // Release resource.=0D + //=0D + Private->JsonStructProtocol->DestoryStructure (=0D + Private->JsonStructProtocol,=0D + (EFI_REST_JSON_STRUCTURE_HEADER *)Bios=0D + );=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +ProvisioningBiosProperties (=0D + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol,=0D + IN CHAR8 *InputJson,=0D + IN CHAR8 *ResourceId, OPTIONAL=0D + IN EFI_STRING ConfigureLang,=0D + IN BOOLEAN ProvisionMode,=0D + OUT CHAR8 **ResultJson=0D + )=0D +{=0D + EFI_REDFISH_BIOS_V1_0_9 *Bios;=0D + EFI_REDFISH_BIOS_V1_0_9_CS *BiosCs;=0D + EFI_STATUS Status;=0D + BOOLEAN PropertyChanged;=0D + CHAR8 *AsciiStringValue;=0D + RedfishCS_EmptyProp_KeyValue *PropertyVagueValues;=0D + UINT32 VagueValueNumber;=0D +=0D +=0D +=0D + if (JsonStructProtocol =3D=3D NULL || ResultJson =3D=3D NULL || IS_EMPTY= _STRING (InputJson) || IS_EMPTY_STRING (ConfigureLang)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s with: %s\n", __FUNCTIO= N__, ConfigureLang, (ProvisionMode ? L"Provision resource" : L"Update resou= rce")));=0D +=0D + *ResultJson =3D NULL;=0D + PropertyChanged =3D FALSE;=0D +=0D + Bios =3D NULL;=0D + Status =3D JsonStructProtocol->ToStructure (=0D + JsonStructProtocol,=0D + NULL,=0D + InputJson,=0D + (EFI_REST_JSON_STRUCTURE_HEADER **)&Bios= =0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, ToStructure failure: %r\n", __FUNCTION__, St= atus));=0D + return Status;=0D + }=0D +=0D + BiosCs =3D Bios->Bios;=0D +=0D + //=0D + // ID=0D + //=0D + if (BiosCs->Id =3D=3D NULL && !IS_EMPTY_STRING (ResourceId)) {=0D + BiosCs->Id =3D AllocateCopyPool (AsciiStrSize (ResourceId), ResourceId= );=0D + }=0D +=0D + //=0D + // Handle ATTRIBUTEREGISTRY=0D + //=0D + if (PropertyChecker (BiosCs->AttributeRegistry, ProvisionMode)) {=0D + AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"AttributeRegistry", ConfigureLang);=0D + if (AsciiStringValue !=3D NULL) {=0D + if (ProvisionMode || AsciiStrCmp (BiosCs->AttributeRegistry, AsciiSt= ringValue) !=3D 0) {=0D + BiosCs->AttributeRegistry =3D AsciiStringValue;=0D + PropertyChanged =3D TRUE;=0D + }=0D + }=0D + }=0D + //=0D + // Handle ATTRIBUTES=0D + //=0D + if (BiosCs->Attributes !=3D NULL) {=0D + //=0D + // Handle ATTRIBUTES=0D + //=0D + if (PropertyChecker (BiosCs->Attributes, ProvisionMode)) {=0D + PropertyVagueValues =3D GetPropertyVagueValue (RESOURCE_SCHEMA, RESO= URCE_SCHEMA_VERSION, L"Attributes", ConfigureLang, &VagueValueNumber);=0D + if (PropertyVagueValues !=3D NULL) {=0D + if (ProvisionMode || !CompareRedfishPropertyVagueValues (=0D + ((RedfishCS_Type_EmptyProp_CS_Data *)BiosCs= ->Attributes->Prop.ForwardLink)->KeyValuePtr,=0D + ((RedfishCS_Type_EmptyProp_CS_Data *)BiosCs= ->Attributes->Prop.ForwardLink)->NunmOfProperties,=0D + PropertyVagueValues,=0D + VagueValueNumber)) {=0D + //=0D + // Use the properties on system to replace the one on Redfish se= rvice.=0D + //=0D + ((RedfishCS_Type_EmptyProp_CS_Data *)BiosCs->Attributes->Prop.Fo= rwardLink)->KeyValuePtr =3D PropertyVagueValues;=0D + ((RedfishCS_Type_EmptyProp_CS_Data *)BiosCs->Attributes->Prop.Fo= rwardLink)->NunmOfProperties =3D VagueValueNumber;=0D + PropertyChanged =3D TRUE;=0D + }=0D + }=0D + }=0D + }=0D +=0D +=0D + //=0D + // Convert C structure back to JSON text.=0D + //=0D + Status =3D JsonStructProtocol->ToJson (=0D + JsonStructProtocol,=0D + (EFI_REST_JSON_STRUCTURE_HEADER *)Bios,=0D + ResultJson=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __FUNCTION__, Status= ));=0D + return Status;=0D + }=0D +=0D + //=0D + // Release resource.=0D + //=0D + JsonStructProtocol->DestoryStructure (=0D + JsonStructProtocol,=0D + (EFI_REST_JSON_STRUCTURE_HEADER *)Bios=0D + );=0D +=0D + return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND);=0D +}=0D +=0D +EFI_STATUS=0D +ProvisioningBiosResource (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN UINTN Index,=0D + IN EFI_STRING ConfigureLang=0D + )=0D +{=0D + CHAR8 *Json;=0D + EFI_STATUS Status;=0D + EFI_STRING NewResourceLocation;=0D + CHAR8 *EtagStr;=0D + CHAR8 ResourceId[16];=0D +=0D + if (IS_EMPTY_STRING (ConfigureLang) || Private =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + EtagStr =3D NULL;=0D + AsciiSPrint (ResourceId, sizeof (ResourceId), "%d", Index);=0D +=0D + Status =3D ProvisioningBiosProperties (=0D + Private->JsonStructProtocol,=0D + BiosEmptyJson,=0D + ResourceId,=0D + ConfigureLang,=0D + TRUE,=0D + &Json=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, provisioning resource for %s failed: %r\n", = __FUNCTION__, ConfigureLang, Status));=0D + return Status;=0D + }=0D +=0D + Status =3D CreatePayloadToPostResource (Private->RedfishService, Private= ->Payload, Json, &NewResourceLocation, &EtagStr);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", __F= UNCTION__, ConfigureLang, Status));=0D + goto RELEASE_RESOURCE;=0D + }=0D +=0D + ASSERT (NewResourceLocation !=3D NULL);=0D +=0D + //=0D + // Keep location of new resource.=0D + //=0D + if (NewResourceLocation !=3D NULL) {=0D + RedfisSetRedfishUri (ConfigureLang, NewResourceLocation);=0D + }=0D +=0D + //=0D + // Handle Etag=0D + //=0D + if (EtagStr !=3D NULL) {=0D + SetEtagWithUri (EtagStr, NewResourceLocation);=0D + FreePool (EtagStr);=0D + }=0D +=0D +RELEASE_RESOURCE:=0D +=0D + if (NewResourceLocation !=3D NULL) {=0D + FreePool (NewResourceLocation);=0D + }=0D +=0D + if (Json !=3D NULL) {=0D + FreePool (Json);=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +EFI_STATUS=0D +ProvisioningBiosResources (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private=0D + )=0D +{=0D + UINTN Index;=0D + EFI_STATUS Status;=0D + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST UnifiedConfigureLangList;=0D +=0D + if (Private =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHE= MA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangLi= st);=0D + if (EFI_ERROR (Status) || UnifiedConfigureLangList.Count =3D=3D 0) {=0D + DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure languag= e: %s: %r\n", __FUNCTION__, REDPATH_ARRAY_PATTERN, Status));=0D + return EFI_NOT_FOUND;=0D + }=0D + //=0D + // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE.= =0D + // This information is sent back to the parent resource (e.g. the collec= tion driver).=0D + //=0D + EdkIIRedfishResourceSetConfigureLang (&UnifiedConfigureLangList);=0D +=0D + for (Index =3D 0; Index < UnifiedConfigureLangList.Count; Index++) {=0D + DEBUG ((DEBUG_INFO, "[%d] create Bios resource from: %s\n", UnifiedCon= figureLangList.List[Index].Index, UnifiedConfigureLangList.List[Index].Conf= igureLang));=0D + ProvisioningBiosResource (Private, UnifiedConfigureLangList.List[Index= ].Index, UnifiedConfigureLangList.List[Index].ConfigureLang);=0D + FreePool (UnifiedConfigureLangList.List[Index].ConfigureLang);=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +EFI_STATUS=0D +ProvisioningBiosExistResource (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_STRING ConfigureLang;=0D + CHAR8 *EtagStr;=0D + CHAR8 *Json;=0D +=0D + if (Private =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + EtagStr =3D NULL;=0D + Json =3D NULL;=0D + ConfigureLang =3D NULL;=0D +=0D + ConfigureLang =3D RedfishGetConfigLanguage (Private->Uri);=0D + if (ConfigureLang =3D=3D NULL) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + Status =3D ProvisioningBiosProperties (=0D + Private->JsonStructProtocol,=0D + BiosEmptyJson,=0D + NULL,=0D + ConfigureLang,=0D + TRUE,=0D + &Json=0D + );=0D + if (EFI_ERROR (Status)) {=0D + if (Status =3D=3D EFI_NOT_FOUND) {=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for= %s ignored. Nothing changed\n", __FUNCTION__, ConfigureLang));=0D + } else {=0D + DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s fail= ed: %r\n", __FUNCTION__, ConfigureLang, Status));=0D + }=0D + goto ON_RELEASE;=0D + }=0D +=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\= n", __FUNCTION__, ConfigureLang));=0D + //=0D + // PUT back to instance=0D + //=0D + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, &EtagStr);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __FUNCT= ION__, ConfigureLang, Status));=0D + }=0D +=0D + //=0D + // Handle Etag=0D + //=0D + if (EtagStr !=3D NULL) {=0D + SetEtagWithUri (EtagStr, Private->Uri);=0D + FreePool (EtagStr);=0D + }=0D +=0D +ON_RELEASE:=0D +=0D + if (Json !=3D NULL) {=0D + FreePool (Json);=0D + }=0D +=0D + if (ConfigureLang !=3D NULL) {=0D + FreePool (ConfigureLang);=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Provisioning redfish resource by given URI.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[in] ResourceExist TRUE if resource exists, PUT method wil= l be used.=0D + FALSE if resource does not exist POST m= ethod is used.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishProvisioningResourceCommon (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN BOOLEAN ResourceExist=0D + )=0D +{=0D + if (Private =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + return (ResourceExist ? ProvisioningBiosExistResource (Private) : Provis= ioningBiosResources (Private));=0D +}=0D +=0D +/**=0D + Check resource from given URI.=0D +=0D + @param[in] This Pointer to REDFISH_RESOURCE_COMMON_PRIV= ATE instance.=0D + @param[in] Json The JSON to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishCheckResourceCommon (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN CHAR8 *Json=0D + )=0D +{=0D + UINTN Index;=0D + EFI_STATUS Status;=0D + EFI_STRING *ConfigureLangList;=0D + UINTN Count;=0D + EFI_STRING Property;=0D +=0D + if (Private =3D=3D NULL || IS_EMPTY_STRING (Json)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOU= RCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, &Count);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, BiosConfigToRedfishGetConfigureLangRegex fai= led: %r\n", __FUNCTION__, Status));=0D + return Status;=0D + }=0D +=0D + if (Count =3D=3D 0) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + Status =3D EFI_SUCCESS;=0D + for (Index =3D 0; Index < Count; Index++) {=0D +=0D + Property =3D GetPropertyFromConfigureLang (Private->Uri, ConfigureLang= List[Index]);=0D + if (Property =3D=3D NULL) {=0D + continue;=0D + }=0D +=0D + DEBUG ((DEBUG_INFO, "%a, [%d] check attribute for: %s\n", __FUNCTION__= , Index, Property));=0D + if (!MatchPropertyWithJsonContext (Property, Json)) {=0D + DEBUG ((DEBUG_INFO, "%a, property is missing: %s\n", __FUNCTION__, P= roperty));=0D + Status =3D EFI_NOT_FOUND;=0D + }=0D + }=0D +=0D + FreePool (ConfigureLangList);=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Update resource to given URI.=0D +=0D + @param[in] This Pointer to REDFISH_RESOURCE_COMMON_PRIV= ATE instance.=0D + @param[in] Json The JSON to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishUpdateResourceCommon (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN CHAR8 *InputJson=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CHAR8 *Json;=0D + EFI_STRING ConfigureLang;=0D + CHAR8 *EtagStr;=0D +=0D + if (Private =3D=3D NULL || IS_EMPTY_STRING (InputJson)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + EtagStr =3D NULL;=0D + Json =3D NULL;=0D + ConfigureLang =3D NULL;=0D +=0D + ConfigureLang =3D RedfishGetConfigLanguage (Private->Uri);=0D + if (ConfigureLang =3D=3D NULL) {=0D + return EFI_NOT_FOUND;=0D + }=0D +=0D + Status =3D ProvisioningBiosProperties (=0D + Private->JsonStructProtocol,=0D + InputJson,=0D + NULL,=0D + ConfigureLang,=0D + FALSE,=0D + &Json=0D + );=0D + if (EFI_ERROR (Status)) {=0D + if (Status =3D=3D EFI_NOT_FOUND) {=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s ignored. No= thing changed\n", __FUNCTION__, ConfigureLang));=0D + } else {=0D + DEBUG ((DEBUG_ERROR, "%a, update resource for %s failed: %r\n", __FU= NCTION__, ConfigureLang, Status));=0D + }=0D + goto ON_RELEASE;=0D + }=0D +=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", __FUNCTION_= _, ConfigureLang));=0D + //=0D + // PUT back to instance=0D + //=0D + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, &EtagStr);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __FUNCT= ION__, ConfigureLang, Status));=0D + }=0D +=0D + //=0D + // Handle Etag=0D + //=0D + if (EtagStr !=3D NULL) {=0D + SetEtagWithUri (EtagStr, Private->Uri);=0D + FreePool (EtagStr);=0D + }=0D +=0D +ON_RELEASE:=0D +=0D + if (Json !=3D NULL) {=0D + FreePool (Json);=0D + }=0D +=0D + if (ConfigureLang !=3D NULL) {=0D + FreePool (ConfigureLang);=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Identify resource from given URI.=0D +=0D + @param[in] This Pointer to REDFISH_RESOURCE_COMMON_PRIV= ATE instance.=0D + @param[in] Json The JSON to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishIdentifyResourceCommon (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN CHAR8 *Json=0D + )=0D +{=0D + BOOLEAN Supported;=0D + EFI_STATUS Status;=0D + EFI_STRING EndOfChar;=0D + REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList;=0D +=0D + Supported =3D RedfishIdentifyResource (Private->Uri, Private->Json);=0D + if (Supported) {=0D + Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SC= HEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, BiosConfigToRedfishGetConfigureLangRegex f= ailed: %r\n", __FUNCTION__, Status));=0D + return Status;=0D + }=0D +=0D + if (ConfigLangList.Count =3D=3D 0) {=0D + return EFI_SUCCESS;=0D + }=0D +=0D + //EndOfChar =3D StrStr (ConfigLangList.List[0].ConfigureLang, L"}");=0D + Status =3D IsRedpathArray (ConfigLangList.List[0].ConfigureLang, NULL,= &EndOfChar);=0D + if (EFI_ERROR (Status) && Status !=3D EFI_NOT_FOUND) {=0D + ASSERT (FALSE);=0D + return EFI_DEVICE_ERROR;=0D + }=0D + if (Status !=3D EFI_SUCCESS) {=0D + //=0D + // This is not the collection redpath.=0D + //=0D + GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, &End= OfChar);=0D + }=0D + *(++EndOfChar) =3D '\0';=0D + //=0D + // Keep URI and ConfigLang mapping=0D + //=0D + RedfisSetRedfishUri (ConfigLangList.List[0].ConfigureLang, Private->Ur= i);=0D + //=0D + // Set the configuration language in the RESOURCE_INFORMATION_EXCHANGE= .=0D + // This information is sent back to the parent resource (e.g. the coll= ection driver).=0D + //=0D + EdkIIRedfishResourceSetConfigureLang (&ConfigLangList);=0D + DestroyConfiglanguageList (&ConfigLangList);=0D + return EFI_SUCCESS;=0D + }=0D +=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +EFI_STATUS=0D +HandleResource (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN EFI_STRING Uri=0D + )=0D +{=0D + EFI_STATUS Status;=0D + REDFISH_SCHEMA_INFO SchemaInfo;=0D + EFI_STRING ConfigLang;=0D +=0D + if (Private =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + //=0D + // Resource match=0D + //=0D +=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, process resource for: %s\n", __FUNCTIO= N__, Uri));=0D +=0D + Status =3D GetRedfishSchemaInfo (Private->RedfishService, Private->JsonS= tructProtocol, Uri, &SchemaInfo);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to get schema information from: %s %r= \n", __FUNCTION__, Uri, Status));=0D + return Status;=0D + }=0D + //=0D + // Check and see if this is target resource that we want to handle.=0D + // Some resource is handled by other provider so we have to make sure th= is first.=0D + //=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%s Identify for %s\n", __FUNCTION__, Uri))= ;=0D + ConfigLang =3D RedfishGetConfigLanguage (Uri);=0D + if (ConfigLang =3D=3D NULL) {=0D + Status =3D EdkIIRedfishResourceConfigIdentify (&SchemaInfo, Uri, Priva= te->InformationExchange);=0D + if (EFI_ERROR (Status)) {=0D + if (Status =3D=3D EFI_UNSUPPORTED) {=0D + DEBUG ((DEBUG_INFO, "%a, \"%s\" is not handled by us\n", __FUNCTIO= N__, Uri));=0D + return EFI_SUCCESS;=0D + }=0D +=0D + DEBUG ((DEBUG_ERROR, "%a, fail to identify resource: \"%s\": %r\n", = __FUNCTION__, Uri, Status));=0D + return Status;=0D + }=0D + } else {=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a, history record found: %s\n", __FUNCT= ION__, ConfigLang));=0D + FreePool (ConfigLang);=0D + }=0D +=0D + //=0D + // Check and see if target property exist or not even when collection me= meber exists.=0D + // If not, we sill do provision.=0D + //=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __FUNCTION__, Uri));=0D + Status =3D EdkIIRedfishResourceConfigCheck (&SchemaInfo, Uri);=0D + if (EFI_ERROR (Status)) {=0D + //=0D + // The target property does not exist, do the provision to create prop= erty.=0D + //=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __FUNCTION__, Ur= i));=0D + Status =3D EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Uri, = Private->InformationExchange, FALSE);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", = __FUNCTION__, Status));=0D + }=0D +=0D + return Status;=0D + }=0D +=0D + //=0D + // Consume first.=0D + //=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __FUNCTION__, Uri));= =0D + Status =3D EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", _= _FUNCTION__, Uri, Status));=0D + }=0D +=0D + //=0D + // Patch.=0D + //=0D + DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __FUNCTION__, Uri));= =0D + Status =3D EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __= FUNCTION__, Uri, Status));=0D + }=0D +=0D + return Status;=0D +}=0D diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h b/Re= dfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h new file mode 100644 index 0000000000..321ded7637 --- /dev/null +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h @@ -0,0 +1,30 @@ +/** @file=0D +=0D + Redfish feature driver implementation - internal header file=0D + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef EFI_REDFISH_BIOS_COMMON_H_=0D +#define EFI_REDFISH_BIOS_COMMON_H_=0D +=0D +#include =0D +#include =0D +=0D +//=0D +// Schema information.=0D +//=0D +#define REDFISH_MANAGED_URI L"Systems/{}/Bios"=0D +#define MAX_URI_LENGTH 256=0D +#define RESOURCE_SCHEMA "Bios"=0D +#define RESOURCE_SCHEMA_MAJOR "1"=0D +#define RESOURCE_SCHEMA_MINOR "0"=0D +#define RESOURCE_SCHEMA_ERRATA "9"=0D +#define RESOURCE_SCHEMA_VERSION "v1_0_9"=0D +#define REDPATH_ARRAY_PATTERN L"/Bios/.*"=0D +#define REDPATH_ARRAY_PREFIX L"/Bios/"=0D +#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-Bios.v1_0_9"=0D +#define REDFISH_SCHEMA_NAME "ComputerSystem"=0D +=0D +#endif=0D diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishC= lientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c new file mode 100644 index 0000000000..a478061cde --- /dev/null +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -0,0 +1,789 @@ +/** @file=0D + Redfish feature driver implementation - Bios=0D +=0D + (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "../Common/BiosCommon.h"=0D +=0D +extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate;=0D +=0D +EFI_STATUS=0D +HandleResource (=0D + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private,=0D + IN EFI_STRING Uri=0D + );=0D +=0D +EFI_HANDLE medfishResourceConfigProtocolHandle;=0D +=0D +/**=0D + Provising redfish resource by given URI.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[in] Uri Target URI to create resource.=0D + @param[in] PostMode TRUE if the resource does not exist, po= st method is used.=0D + FALSE if the resource exist but propert= y is missing, put method is used.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishResourceProvisioningResource (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + IN EFI_STRING Uri,=0D + IN BOOLEAN PostMode=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STATUS Status;=0D + REDFISH_RESPONSE Response;=0D +=0D + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + DEBUG ((DEBUG_INFO, "%a, provisioning in %s mode\n", __FUNCTION__, (Post= Mode ? L"POST" : L"PATCH")));=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __FUNCTION_= _, Uri));=0D + return Status;=0D + }=0D +=0D + Private->Uri =3D Uri;=0D + Private->Payload =3D Response.Payload;=0D + ASSERT (Private->Payload !=3D NULL);=0D +=0D + Status =3D RedfishProvisioningResourceCommon (Private, !PostMode);=0D +=0D + //=0D + // Release resource=0D + //=0D + if (Private->Payload !=3D NULL) {=0D + RedfishFreeResponse (=0D + Response.StatusCode,=0D + Response.HeaderCount,=0D + Response.Headers,=0D + Response.Payload=0D + );=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Consume resource from given URI.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[in] Uri The target URI to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishResourceConsumeResource (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + IN EFI_STRING Uri=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STATUS Status;=0D + REDFISH_RESPONSE Response;=0D + CHAR8 *Etag;=0D +=0D + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __FUNCTION_= _, Uri));=0D + return Status;=0D + }=0D +=0D + Private->Uri =3D Uri;=0D + Private->Payload =3D Response.Payload;=0D + ASSERT (Private->Payload !=3D NULL);=0D +=0D + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Payload= ), EDKII_JSON_COMPACT);=0D + ASSERT (Private->Json !=3D NULL);=0D +=0D + //=0D + // Find etag in HTTP response header=0D + //=0D + Etag =3D NULL;=0D + Status =3D GetEtagAndLocation (&Response, &Etag, NULL);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", __FU= NCTION__));=0D + }=0D +=0D + Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag);= =0D + if (EFI_ERROR (Status)) {=0D + if (Status !=3D EFI_ALREADY_STARTED) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to consume resource from: %s: %r\n"= , __FUNCTION__, Uri, Status));=0D + }=0D + } else {=0D + //=0D + // Keep etag after consuming pending settings.=0D + //=0D + if (Etag !=3D NULL) {=0D + SetEtagWithUri (Etag, Private->Uri);=0D + }=0D + }=0D +=0D + //=0D + // Release resource=0D + //=0D + if (Private->Payload !=3D NULL) {=0D + RedfishFreeResponse (=0D + Response.StatusCode,=0D + Response.HeaderCount,=0D + Response.Headers,=0D + Response.Payload=0D + );=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + if (Private->Json !=3D NULL) {=0D + FreePool (Private->Json);=0D + Private->Json =3D NULL;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Get information about this protocol.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[out] Schema Supported schema.=0D + @param[out] Major Supported major number.=0D + @param[out] Minor Supported minor number.=0D + @param[out] Errata Supported errata number.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishResourceGetInfo (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + OUT REDFISH_SCHEMA_INFO *Info=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D +=0D + if (This =3D=3D NULL || Info =3D=3D NULL) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + AsciiStrCpyS (Info->Schema, REDFISH_SCHEMA_STRING_SIZE, RESOURCE_SCHEMA)= ;=0D + AsciiStrCpyS (Info->Major, REDFISH_SCHEMA_VERSION_SIZE, RESOURCE_SCHEMA_= MAJOR);=0D + AsciiStrCpyS (Info->Minor, REDFISH_SCHEMA_VERSION_SIZE, RESOURCE_SCHEMA_= MINOR);=0D + AsciiStrCpyS (Info->Errata, REDFISH_SCHEMA_VERSION_SIZE, RESOURCE_SCHEMA= _ERRATA);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + Update resource to given URI.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[in] Uri The target URI to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishResourceUpdate (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + IN EFI_STRING Uri=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STATUS Status;=0D + REDFISH_RESPONSE Response;=0D +=0D + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __FUNCTION_= _, Uri));=0D + return Status;=0D + }=0D +=0D + Private->Uri =3D Uri;=0D + Private->Payload =3D Response.Payload;=0D + ASSERT (Private->Payload !=3D NULL);=0D +=0D + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Payload= ), EDKII_JSON_COMPACT);=0D + ASSERT (Private->Json !=3D NULL);=0D +=0D + Status =3D RedfishUpdateResourceCommon (Private, Private->Json);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to update resource from: %s: %r\n", _= _FUNCTION__, Uri, Status));=0D + }=0D +=0D + //=0D + // Release resource=0D + //=0D + if (Private->Payload !=3D NULL) {=0D + RedfishFreeResponse (=0D + Response.StatusCode,=0D + Response.HeaderCount,=0D + Response.Headers,=0D + Response.Payload=0D + );=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + if (Private->Json !=3D NULL) {=0D + FreePool (Private->Json);=0D + Private->Json =3D NULL;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Check resource on given URI.=0D +=0D + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance.=0D + @param[in] Uri The target URI to consume.=0D +=0D + @retval EFI_SUCCESS Value is returned successfully.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +RedfishResourceCheck (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + IN EFI_STRING Uri=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STATUS Status;=0D + REDFISH_RESPONSE Response;=0D +=0D + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __FUNCTION_= _, Uri));=0D + return Status;=0D + }=0D +=0D + Private->Uri =3D Uri;=0D + Private->Payload =3D Response.Payload;=0D + ASSERT (Private->Payload !=3D NULL);=0D +=0D + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Payload= ), EDKII_JSON_COMPACT);=0D + ASSERT (Private->Json !=3D NULL);=0D +=0D + Status =3D RedfishCheckResourceCommon (Private, Private->Json);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", __= FUNCTION__, Uri, Status));=0D + }=0D +=0D + //=0D + // Release resource=0D + //=0D + if (Private->Payload !=3D NULL) {=0D + RedfishFreeResponse (=0D + Response.StatusCode,=0D + Response.HeaderCount,=0D + Response.Headers,=0D + Response.Payload=0D + );=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + if (Private->Json !=3D NULL) {=0D + FreePool (Private->Json);=0D + Private->Json =3D NULL;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + Identify resource on given URI.=0D +=0D + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFI= G_PROTOCOL instance.=0D + @param[in] Uri The target URI to consume.=0D +=0D + @retval EFI_SUCCESS This is target resource which we want t= o handle.=0D + @retval EFI_UNSUPPORTED This is not the target resource.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +=0D +EFI_STATUS=0D +RedfishResourceIdentify (=0D + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This,=0D + IN EFI_STRING Uri=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STATUS Status;=0D + REDFISH_RESPONSE Response;=0D +=0D + if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) {=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This);=0D +=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + Status =3D GetResourceByUri (Private->RedfishService, Uri, &Response);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __FUNCTION_= _, Uri));=0D + return Status;=0D + }=0D +=0D + Private->Uri =3D Uri;=0D + Private->Payload =3D Response.Payload;=0D + ASSERT (Private->Payload !=3D NULL);=0D +=0D + Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Payload= ), EDKII_JSON_COMPACT);=0D + ASSERT (Private->Json !=3D NULL);=0D +=0D + Status =3D RedfishIdentifyResourceCommon (Private, Private->Json);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __FUNCTION__, Uri= , Status));=0D + }=0D + //=0D + // Release resource=0D + //=0D + if (Private->Payload !=3D NULL) {=0D + RedfishFreeResponse (=0D + Response.StatusCode,=0D + Response.HeaderCount,=0D + Response.Headers,=0D + Response.Payload=0D + );=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + if (Private->Json !=3D NULL) {=0D + FreePool (Private->Json);=0D + Private->Json =3D NULL;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig =3D {=0D + RedfishResourceProvisioningResource,=0D + RedfishResourceConsumeResource,=0D + RedfishResourceUpdate,=0D + RedfishResourceCheck,=0D + RedfishResourceIdentify,=0D + RedfishResourceGetInfo=0D +};=0D +=0D +/**=0D + Initialize a Redfish configure handler.=0D +=0D + This function will be called by the Redfish config driver to initialize = each Redfish configure=0D + handler.=0D +=0D + @param[in] This Pointer to EDKII_REDFISH_CONFIG_HA= NDLER_PROTOCOL instance.=0D + @param[in] RedfishConfigServiceInfo Redfish service informaion.=0D +=0D + @retval EFI_SUCCESS The handler has been initialized su= ccessfully.=0D + @retval EFI_DEVICE_ERROR Failed to create or configure the R= EST EX protocol instance.=0D + @retval EFI_ALREADY_STARTED This handler has already been initi= alized.=0D + @retval Other Error happens during the initializa= tion.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +RedfishResourceInit (=0D + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This,=0D + IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCOL (T= his);=0D +=0D + Private->RedfishService =3D RedfishCreateService (RedfishConfigServiceIn= fo);=0D + if (Private->RedfishService =3D=3D NULL) {=0D + return EFI_DEVICE_ERROR;=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + Stop a Redfish configure handler.=0D +=0D + @param[in] This Pointer to EDKII_REDFISH_CONFIG_HANDLER= _PROTOCOL instance.=0D +=0D + @retval EFI_SUCCESS This handler has been stoped successful= ly.=0D + @retval Others Some error happened.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +RedfishResourceStop (=0D + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This=0D + )=0D +{=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D +=0D + Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCOL (T= his);=0D +=0D + if (Private->Event !=3D NULL) {=0D + gBS->CloseEvent (Private->Event);=0D + Private->Event =3D NULL;=0D + }=0D +=0D + if (Private->RedfishService !=3D NULL) {=0D + RedfishCleanupService (Private->RedfishService);=0D + Private->RedfishService =3D NULL;=0D + }=0D +=0D + if (Private->Payload !=3D NULL) {=0D + RedfishCleanupPayload (Private->Payload);=0D + Private->Payload =3D NULL;=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D {=0D + RedfishResourceInit,=0D + RedfishResourceStop=0D +};=0D +=0D +/**=0D + Callback function when gEfiRestJsonStructureProtocolGuid is installed.=0D +=0D + @param[in] Event Event whose notification function is being invoked.= =0D + @param[in] Context Pointer to the notification function's context.=0D +**/=0D +VOID=0D +EFIAPI=0D +EfiRestJasonStructureProtocolIsReady=0D + (=0D + IN EFI_EVENT Event,=0D + IN VOID *Context=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + if (mRedfishResourcePrivate =3D=3D NULL) {=0D + return;=0D + }=0D +=0D + if (mRedfishResourcePrivate->JsonStructProtocol !=3D NULL) {=0D + return;=0D + }=0D +=0D + Status =3D gBS->LocateProtocol (=0D + &gEfiRestJsonStructureProtocolGuid,=0D + NULL,=0D + (VOID **)&mRedfishResourcePrivate->JsonStructProtocol=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to locate gEfiRestJsonStructureProtoc= olGuid: %r\n", __FUNCTION__, Status));=0D + }=0D +=0D + gBS->CloseEvent (Event);=0D +}=0D +=0D +/**=0D + Unloads an image.=0D +=0D + @param ImageHandle Handle that identifies the image to be unl= oaded.=0D +=0D + @retval EFI_SUCCESS The image has been unloaded.=0D + @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +RedfishResourceUnload (=0D + IN EFI_HANDLE ImageHandle=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler;=0D +=0D + if (mRedfishResourcePrivate =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + ConfigHandler =3D NULL;=0D +=0D + //=0D + // Firstly, find ConfigHandler Protocol interface in this ImageHandle.=0D + //=0D + Status =3D gBS->OpenProtocol (=0D + ImageHandle,=0D + &gEdkIIRedfishConfigHandlerProtocolGuid,=0D + (VOID **) &ConfigHandler,=0D + NULL,=0D + NULL,=0D + EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL=0D + );=0D + if (EFI_ERROR (Status) || ConfigHandler =3D=3D NULL) {=0D + return Status;=0D + }=0D +=0D + ConfigHandler->Stop (ConfigHandler);=0D +=0D + //=0D + // Last, uninstall ConfigHandler Protocol and resource protocol.=0D + //=0D + Status =3D gBS->UninstallMultipleProtocolInterfaces (=0D + ImageHandle,=0D + &gEdkIIRedfishConfigHandlerProtocolGuid,=0D + ConfigHandler,=0D + &gEdkIIRedfishResourceConfigProtocolGuid,=0D + &mRedfishResourcePrivate->RedfishResourceConfig,=0D + NULL=0D + );=0D +=0D + FreePool (mRedfishResourcePrivate);=0D + mRedfishResourcePrivate =3D NULL;=0D +=0D + return Status;=0D +}=0D +=0D +/**=0D + The callback function provided by Redfish Feature driver.=0D +=0D + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROT= OCOL instance.=0D + @param[in] FeatureAction The action Redfish feature driver sho= uld take.=0D + @param[in] Uri The collection URI.=0D + @param[in] Context The context of Redfish feature driver= .=0D + @param[in,out] InformationExchange The pointer to RESOURCE_INFORMATION_E= XCHANGE=0D +=0D + @retval EFI_SUCCESS Redfish feature driver callback is exec= uted successfully.=0D + @retval Others Some errors happened.=0D +=0D + @retval EFI_SUCCESS Redfish feature driver callback is exec= uted successfully.=0D + @retval Others Some errors happened.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +RedfishExternalResourceResourceFeatureCallback (=0D + IN EDKII_REDFISH_FEATURE_PROTOCOL *This,=0D + IN FEATURE_CALLBACK_ACTION FeatureAction,=0D + IN VOID *Context,=0D + IN OUT RESOURCE_INFORMATION_EXCHANGE *InformationExchange=0D + )=0D +{=0D + EFI_STATUS Status;=0D + REDFISH_SERVICE RedfishService;=0D + REDFISH_RESOURCE_COMMON_PRIVATE *Private;=0D + EFI_STRING ResourceUri;=0D +=0D + if (FeatureAction !=3D CallbackActionStartOperation) {=0D + return EFI_UNSUPPORTED;=0D + }=0D +=0D + Private =3D (REDFISH_RESOURCE_COMMON_PRIVATE *)Context;=0D +=0D + RedfishService =3D Private->RedfishService;=0D + if (RedfishService =3D=3D NULL) {=0D + return EFI_NOT_READY;=0D + }=0D +=0D + //=0D + // Save in private structure.=0D + //=0D + Private->InformationExchange =3D InformationExchange;=0D +=0D + //=0D + // Find Redfish version on BMC=0D + //=0D + Private->RedfishVersion =3D RedfishGetVersion (RedfishService);=0D +=0D + //=0D + // Create the full URI from Redfish service root.=0D + //=0D + ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * sizeof(CH= AR16));=0D + if (ResourceUri =3D=3D NULL) {=0D + DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for full URI.\n", __= FUNCTION__));=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D + StrCatS (ResourceUri, MAX_URI_LENGTH, Private->RedfishVersion);=0D + StrCatS (ResourceUri, MAX_URI_LENGTH, InformationExchange->SendInformati= on.FullUri);=0D +=0D + //=0D + // Initialize collection path=0D + //=0D + Private->Uri =3D RedfishGetUri (ResourceUri);=0D + if (Private->Uri =3D=3D NULL) {=0D + ASSERT (FALSE);=0D + return EFI_OUT_OF_RESOURCES;=0D + }=0D +=0D + Status =3D HandleResource (Private, Private->Uri);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",= __FUNCTION__, Private->Uri, Status));=0D + }=0D +=0D + FreePool (Private->Uri);=0D + return Status;=0D +}=0D +=0D +/**=0D + Callback function when gEdkIIRedfishFeatureProtocolGuid is installed.=0D +=0D + @param[in] Event Event whose notification function is being invoked.= =0D + @param[in] Context Pointer to the notification function's context.=0D +**/=0D +VOID=0D +EFIAPI=0D +EdkIIRedfishFeatureProtocolIsReady=0D + (=0D + IN EFI_EVENT Event,=0D + IN VOID *Context=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EDKII_REDFISH_FEATURE_PROTOCOL *FeatureProtocol;=0D +=0D + if (mRedfishResourcePrivate =3D=3D NULL) {=0D + return;=0D + }=0D +=0D + if (mRedfishResourcePrivate->FeatureProtocol !=3D NULL) {=0D + return;=0D + }=0D +=0D + Status =3D gBS->LocateProtocol (=0D + &gEdkIIRedfishFeatureProtocolGuid,=0D + NULL,=0D + (VOID **)&FeatureProtocol=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to locate gEdkIIRedfishFeatureProtoco= lGuid: %r\n", __FUNCTION__, Status));=0D + gBS->CloseEvent (Event);=0D + return;=0D + }=0D +=0D + Status =3D FeatureProtocol->Register (=0D + FeatureProtocol,=0D + REDFISH_MANAGED_URI,=0D + RedfishExternalResourceResourceFeatureCallba= ck,=0D + (VOID *)mRedfishResourcePrivate=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a, failed to register %s: %r\n", __FUNCTION__, = REDFISH_MANAGED_URI, Status));=0D + }=0D +=0D + mRedfishResourcePrivate->FeatureProtocol =3D FeatureProtocol;=0D +=0D + gBS->CloseEvent (Event);=0D +}=0D +=0D +/**=0D + This is the declaration of an EFI image entry point. This entry point is= =0D + the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers includ= ing=0D + both device drivers and bus drivers. It initialize the global variables = and=0D + publish the driver binding protocol.=0D +=0D + @param[in] ImageHandle The firmware allocated handle for the UEFI= image.=0D + @param[in] SystemTable A pointer to the EFI System Table.=0D +=0D + @retval EFI_SUCCESS The operation completed successfully.=0D + @retval EFI_ACCESS_DENIED EFI_ISCSI_INITIATOR_NAME_PROTOCOL was inst= alled unexpectedly.=0D + @retval Others Other errors as indicated.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +RedfishResourceEntryPoint (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + )=0D +{=0D + EFI_STATUS Status;=0D + VOID *Registration;=0D +=0D + if (mRedfishResourcePrivate !=3D NULL) {=0D + return EFI_ALREADY_STARTED;=0D + }=0D +=0D + medfishResourceConfigProtocolHandle =3D ImageHandle;=0D +=0D + mRedfishResourcePrivate =3D AllocateZeroPool (sizeof (REDFISH_RESOURCE_C= OMMON_PRIVATE));=0D + CopyMem (&mRedfishResourcePrivate->ConfigHandler, &mRedfishConfigHandler= , sizeof (EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL));=0D + CopyMem (&mRedfishResourcePrivate->RedfishResourceConfig, &mRedfishResou= rceConfig, sizeof (EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL));=0D +=0D + //=0D + // Publish config handler protocol and resource protocol.=0D + //=0D + Status =3D gBS->InstallMultipleProtocolInterfaces (=0D + &ImageHandle,=0D + &gEdkIIRedfishConfigHandlerProtocolGuid,=0D + &mRedfishResourcePrivate->ConfigHandler,=0D + &gEdkIIRedfishResourceConfigProtocolGuid,=0D + &mRedfishResourcePrivate->RedfishResourceConfig,=0D + NULL=0D + );=0D +=0D + EfiCreateProtocolNotifyEvent (=0D + &gEfiRestJsonStructureProtocolGuid,=0D + TPL_CALLBACK,=0D + EfiRestJasonStructureProtocolIsReady,=0D + NULL,=0D + &Registration=0D + );=0D +=0D + EfiCreateProtocolNotifyEvent (=0D + &gEdkIIRedfishFeatureProtocolGuid,=0D + TPL_CALLBACK,=0D + EdkIIRedfishFeatureProtocolIsReady,=0D + (VOID *)mRedfishResourcePrivate,=0D + &Registration=0D + );=0D +=0D + return Status;=0D +}=0D diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf b/Redfis= hClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf new file mode 100644 index 0000000000..8c01a3b877 --- /dev/null +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf @@ -0,0 +1,52 @@ +## @file=0D +#=0D +# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D BiosDxe=0D + FILE_GUID =3D d6c99bb0-ca18-45aa-8be6-a60c3ba5ecd8=0D + MODULE_TYPE =3D DXE_DRIVER=0D + VERSION_STRING =3D 1.0=0D + ENTRY_POINT =3D RedfishResourceEntryPoint=0D + UNLOAD_IMAGE =3D RedfishResourceUnload=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + MdeModulePkg/MdeModulePkg.dec=0D + RedfishPkg/RedfishPkg.dec=0D + RedfishClientPkg/RedfishClientPkg.dec=0D +=0D +[Sources]=0D + ../Common/BiosCommon.h=0D + ../Common/BiosCommon.c=0D + BiosDxe.c=0D +=0D +[LibraryClasses]=0D + BaseMemoryLib=0D + DebugLib=0D + EdkIIRedfishResourceConfigLib=0D + RedfishLib=0D + RedfishFeatureUtilityLib=0D + RedfishVersionLib=0D + RedfishResourceIdentifyLib=0D + UefiLib=0D + UefiDriverEntryPoint=0D +=0D +[Protocols]=0D + gEdkIIRedfishConfigHandlerProtocolGuid ## PRODUCED=0D + gEfiRestJsonStructureProtocolGuid ## CONSUMED=0D + gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED=0D + gEdkIIRedfishFeatureProtocolGuid ## CONSUMED=0D +=0D +[Pcd]=0D + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize=0D + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize=0D +=0D +[Depex]=0D + TRUE=0D diff --git a/RedfishClientPkg/RedfishClient.fdf.inc b/RedfishClientPkg/Redf= ishClient.fdf.inc index 90240efbf7..fa4e53898b 100644 --- a/RedfishClientPkg/RedfishClient.fdf.inc +++ b/RedfishClientPkg/RedfishClient.fdf.inc @@ -18,6 +18,7 @@ INF RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.in= f=0D INF RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx= e.inf=0D INF RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystem= CollectionDxe.inf=0D + INF RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf=0D =0D !include RedfishClientPkg/RedfishJsonStructureDxe.fdf.inc=0D #=0D @@ -27,4 +28,5 @@ INF RedfishClientPkg/Converter/MemoryCollection/RedfishMemoryCollection_= Dxe.inf=0D INF RedfishClientPkg/Converter/ComputerSystem/v1_5_0/RedfishComputerSyst= em_V1_5_0_Dxe.inf=0D INF RedfishClientPkg/Converter/ComputerSystemCollection/RedfishComputerS= ystemCollection_Dxe.inf=0D + INF RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf=0D !endif=0D diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc b/RedfishClie= ntPkg/RedfishClientComponents.dsc.inc index 084796e4b5..e83f4bc9bf 100644 --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc @@ -27,6 +27,7 @@ RedfishResourceIdentifyLib|RedfishClientPkg/Library/RedfishResourceI= dentifyLibComuterSystem/v1_5_0/RedfishResourceIdentifyLibComuterSystem.inf= =0D }=0D RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemColl= ectionDxe.inf=0D + RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf=0D =0D !include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc=0D =0D @@ -37,3 +38,4 @@ RedfishClientPkg/Converter/MemoryCollection/RedfishMemoryCollection_Dxe.= inf=0D RedfishClientPkg/Converter/ComputerSystem/v1_5_0/RedfishComputerSystem_V= 1_5_0_Dxe.inf=0D RedfishClientPkg/Converter/ComputerSystemCollection/RedfishComputerSyste= mCollection_Dxe.inf=0D + RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf=0D diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/= RedfishClientLibs.dsc.inc index 05ad09ef5e..fe0c4b0885 100644 --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc @@ -15,12 +15,16 @@ !endif=0D =0D #=0D - # Below two modules should be pulled in by build tool.=0D + # Below modules should be pulled in by build tool.=0D #=0D MemoryV1_7_1Lib|RedfishClientPkg/ConverterLib/edk2library/Memory/v1_7_1/= Lib.inf=0D MemoryCollectionLib|RedfishClientPkg/ConverterLib/edk2library/MemoryColl= ection/Lib.inf=0D ComputerSystemV1_5_0Lib|RedfishClientPkg/ConverterLib/edk2library/Comput= erSystem/v1_5_0/Lib.inf=0D ComputerSystemCollectionLib|RedfishClientPkg/ConverterLib/edk2library/Co= mputerSystemCollection/Lib.inf=0D + BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.= inf=0D + #=0D + # Above modules should be pulled in by build tool.=0D + #=0D =0D NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf=0D HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf=0D --=20 2.32.0.windows.2