From nobody Wed May 1 13:32:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78226+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78226+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1627401007; cv=none; d=zohomail.com; s=zohoarc; b=BrND/ZmyAEkinjrcQI1vIyGkO92ShJWg8nfLEuSjhjsk+KP5xA8nRu/yb+7jB9LDqd0+BHqaCVdwlotC71lmqeLbpWN1ya2P2hUdh2eY1l/EnYq7DXNmfXc5XRZeLHTEvtU6gL4tJNSaJa6Ecllbjw0wcfMEBkvsgqHC+n30FE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627401007; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=VGBuLsBiaaAZ3FbxpxQnRSQleyofulgC12RNRWpcxU4=; b=lEHOhSzinVkSfuRDN9aLWI6CIyOVHQjUjXnsSovpppNJgb29GM2XduB58piZlbQ/r6bi3oNILfiKnaIt376h/Fr5vO4jZd8QkeyTSuzzAxcgSvwaB35UTsjFXlPci25erCj6vEvG6mrv5X5Mi4bJON0Rb8B2ChVd5A2nXZie6OA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78226+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627401007021351.420463998807; Tue, 27 Jul 2021 08:50:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1nVhYY1788612x4cFdZlRCsi; Tue, 27 Jul 2021 08:50:06 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.3293.1627401005754191321 for ; Tue, 27 Jul 2021 08:50:05 -0700 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RFmofm016798; Tue, 27 Jul 2021 15:49:59 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 3a2366rhnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 15:49:59 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id AB030AA; Tue, 27 Jul 2021 15:49:58 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id C913A48; Tue, 27 Jul 2021 15:49:57 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client RedfishFeatureCore PATCH 1/3] RedfishClientPkg: Initial commit of meta files Date: Tue, 27 Jul 2021 22:54:40 +0800 Message-Id: <20210727145442.22840-2-abner.chang@hpe.com> In-Reply-To: <20210727145442.22840-1-abner.chang@hpe.com> References: <20210727145442.22840-1-abner.chang@hpe.com> X-Proofpoint-GUID: sFdE5QEdKMYGfXiNiVINe_7QzgBPyAOV X-Proofpoint-ORIG-GUID: sFdE5QEdKMYGfXiNiVINe_7QzgBPyAOV X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: wKYm2gBkcGJqE2h7YFZXt4l5x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627401006; bh=JTlSsQ/kS37q9B3knZQ0ajH7wfzHnipyzI4G/agNukY=; h=Cc:Date:From:Reply-To:Subject:To; b=Vd485VYiNzMrpmyBDbQZxuB5vSddGuaYXMLp+tzd4V7UZH9yPfFA8nTDubv353h09cj Ag5X5FkUCg8LhgN8ZPlXqgHvWnO1fJMTZ+T7Kvh8/7OXtAsH+uuN4H2RzlTYQA9RnJ1ts WGR5kWFT8KN+KWPxIcl0evJHxS4lNPAc2Kk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627401009029100002 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Initial commit of RedfishclientPkg meta files Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- RedfishClientPkg/RedfishClientPkg.dec | 24 ++++++++++ RedfishClientPkg/RedfishClient.dsc.inc | 21 +++++++++ .../RedfishClientComponents.dsc.inc | 16 +++++++ RedfishClientPkg/RedfishClientDefines.dsc.inc | 27 +++++++++++ RedfishClientPkg/RedfishClientLibs.dsc.inc | 13 ++++++ RedfishClientPkg/RedfishClientPkg.dsc | 46 +++++++++++++++++++ RedfishClientPkg/RedfishClient.fdf.inc | 14 ++++++ 7 files changed, 161 insertions(+) create mode 100644 RedfishClientPkg/RedfishClientPkg.dec create mode 100644 RedfishClientPkg/RedfishClient.dsc.inc create mode 100644 RedfishClientPkg/RedfishClientComponents.dsc.inc create mode 100644 RedfishClientPkg/RedfishClientDefines.dsc.inc create mode 100644 RedfishClientPkg/RedfishClientLibs.dsc.inc create mode 100644 RedfishClientPkg/RedfishClientPkg.dsc create mode 100644 RedfishClientPkg/RedfishClient.fdf.inc diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi= shClientPkg.dec new file mode 100644 index 0000000000..4038a47bd5 --- /dev/null +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -0,0 +1,24 @@ +## @file +# Redfish Client Package +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + DEC_SPECIFICATION =3D 0x0001001b + PACKAGE_NAME =3D RedfishClientPkg + PACKAGE_GUID =3D 61B1638B-1DF9-4052-9468-382FC164AA85 + PACKAGE_VERSION =3D 1.0 + +[Includes] + Include + + +[LibraryClasses] + +[Protocols] + +[Guids] + gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee, = { 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } } diff --git a/RedfishClientPkg/RedfishClient.dsc.inc b/RedfishClientPkg/Redf= ishClient.dsc.inc new file mode 100644 index 0000000000..ad771fcb7f --- /dev/null +++ b/RedfishClientPkg/RedfishClient.dsc.inc @@ -0,0 +1,21 @@ +## @file +# Redfish Client DSC include file for Platform DSC +# +# This file includes all required information to enable Redfish features. +# It can be included to a platform DSC file by using "!include RedfishClie= ntPkg/RedfishClient.dsc.inc". +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + !include RedfishClientPkg/RedfishClientDefines.dsc.inc + +[LibraryClasses] + !include RedfishClientPkg/RedfishClientLibs.dsc.inc + +[Components] + !include RedfishClientPkg/RedfishClientComponents.dsc.inc + diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc b/RedfishClie= ntPkg/RedfishClientComponents.dsc.inc new file mode 100644 index 0000000000..0648fa9d54 --- /dev/null +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc @@ -0,0 +1,16 @@ +## @file +# Redfish Client DSC include file for [Components*] section of all Archite= ctures. +# +# This file can be included to the [Components*] section(s) of a platform = DSC file +# by using "!include RedfishClientPkg/RedfishClientComponents.dsc.inc" to = specify the INF files +# of EDKII Redfish drivers according to the value of flags described in +# "RedfishClientDefines.dsc.inc". +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +!if $(REDFISH_CLIENT) =3D=3D TRUE +!endif diff --git a/RedfishClientPkg/RedfishClientDefines.dsc.inc b/RedfishClientP= kg/RedfishClientDefines.dsc.inc new file mode 100644 index 0000000000..14b7d67102 --- /dev/null +++ b/RedfishClientPkg/RedfishClientDefines.dsc.inc @@ -0,0 +1,27 @@ +## @file +# RedfishClientPkg DSC include file for [Defines] section of all Architect= ures. +# +# This file can be included to the [Defines] section of a platform DSC fil= e by +# using "!include RedfishClientPkg/RedfishClientDefines.dsc.inc" to set va= lue of +# flags. +# +# These flags can be defined before the !include line, or changed on the c= ommand +# line to enable or disable related feature support. +# -D FLAG=3DVALUE +# +# The default value of these flags are: +# DEFINE REDFISH_CLIENT =3D TRUE +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +!ifndef REDFISH_CLIENT + # + # This flag is to enable or disable the EDK2 Redfish client support. + # + DEFINE REDFISH_CLIENT =3D TRUE +!endif + diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/= RedfishClientLibs.dsc.inc new file mode 100644 index 0000000000..2f360abed6 --- /dev/null +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc @@ -0,0 +1,13 @@ +## @file +# Redfish DSC include file for [LibraryClasses*] section of all Architectu= res. +# +# This file can be included to the [LibraryClasses*] section(s) of a platf= orm DSC file +# by using "!include RedfishPkg/RedfisLibs.dsc.inc" to specify the library= instances +# of EDKII network library classes. +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + diff --git a/RedfishClientPkg/RedfishClientPkg.dsc b/RedfishClientPkg/Redfi= shClientPkg.dsc new file mode 100644 index 0000000000..f423bf3861 --- /dev/null +++ b/RedfishClientPkg/RedfishClientPkg.dsc @@ -0,0 +1,46 @@ +## @file +# Redfish Client Package +# +# (C) Copyright 2021 Hewlett-Packard Enterprise Development LP. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + PLATFORM_NAME =3D RedfishClientPkg + PLATFORM_GUID =3D 43491BF9-2879-492B-905E-E82E0C30B412 + PLATFORM_VERSION =3D 1.0 + DSC_SPECIFICATION =3D 0x0001001c + OUTPUT_DIRECTORY =3D Build/RedfishClientPkg + SUPPORTED_ARCHITECTURES =3D IA32|X64|ARM|AARCH64|RISCV64 + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER =3D DEFAULT + +!include MdePkg/MdeLibs.dsc.inc + +[LibraryClasses] + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + +[LibraryClasses.ARM, LibraryClasses.AARCH64] + # + # This library provides the instrinsic functions generated by a given co= mpiler. + # + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf + +[Components] + + !include RedfishClientPkg/RedfishClient.dsc.inc diff --git a/RedfishClientPkg/RedfishClient.fdf.inc b/RedfishClientPkg/Redf= ishClient.fdf.inc new file mode 100644 index 0000000000..4f0714004e --- /dev/null +++ b/RedfishClientPkg/RedfishClient.fdf.inc @@ -0,0 +1,14 @@ +## @file +# Redfish Client FDF include file for [FV*] section of all Architectures. +# +# This file can be included to the [FV*] section(s) of a platform FDF file +# by using "!include RedfishClientPkg/RedfisClientLibs.fdf.inc" to specify= the module instances +# to be built in the firmware volume. +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +!if $(REDFISH_CLIENT) =3D=3D TRUE +!endif --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78226): https://edk2.groups.io/g/devel/message/78226 Mute This Topic: https://groups.io/mt/84484819/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 13:32:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78229+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78229+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1627401015; cv=none; d=zohomail.com; s=zohoarc; b=mcmMuOrjYscKvL9YW2rdSNIH1ATkrM8hiOETofyvb8B/xFqFjqu7cIx2fvqLOYYdLwOhHAAjtG9WkeW72VnwYAS1imCpd+c9uNfKSZu2EY7y5BJH84nz1NhOUMm4WV69MnxeUqBS6MEdvhafgGBxBP2CvvI+D/JbbA08hiUyKJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627401015; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=Y4w7bL+zN2ktdk4SKZR2eYegggNMl3wW9XuUnj8dvD8=; b=H2i6L3ZN2hGP3Jt3eW+GoliDu8rNQcYcvzWe6VFLYIdMZ9ItlS2yOcuoSrISAL8mQq6vjQrVFHP3tT8v4QzHI6tsr6JYIDepJfnWMuSo+Xc75r9yWyEXU7K0NG90dYlZBMzJKibS13eORBaoQ7CUO8rr4CPAObgiX6JrNNk7iUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78229+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627401015809475.8128848382556; Tue, 27 Jul 2021 08:50:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 19ICYY1788612xQf20U7K2Kc; Tue, 27 Jul 2021 08:50:15 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.3122.1627401014803601224 for ; Tue, 27 Jul 2021 08:50:15 -0700 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RFm1sa014604; Tue, 27 Jul 2021 15:50:03 GMT X-Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 3a236dgj3a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 15:50:02 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id DCD5A4F; Tue, 27 Jul 2021 15:49:59 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 06B1348; Tue, 27 Jul 2021 15:49:58 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client RedfishFeatureCore PATCH 2/3] RedfishClientPkg/RedfishFeatureCoreDxe: Redfish Feature Core DXE driver Date: Tue, 27 Jul 2021 22:54:41 +0800 Message-Id: <20210727145442.22840-3-abner.chang@hpe.com> In-Reply-To: <20210727145442.22840-1-abner.chang@hpe.com> References: <20210727145442.22840-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: gAr2ZwSX83nt-zSj2oq_ax8qVUThbt36 X-Proofpoint-GUID: gAr2ZwSX83nt-zSj2oq_ax8qVUThbt36 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: YRRnM6LJKAw8rRdFiMS5jviPx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627401015; bh=BblS1/oJlGd6q168Gv0IXuWcfcrejRUGyAaO/7coK9w=; h=Cc:Date:From:Reply-To:Subject:To; b=a4kmRID1aBtapow89FDqSF7P73haY5FFOytelmNwbD8uwiDeNGRF3XhQ16POf6w3w8+ zWR4Elw6oI0UJxSSD3//cpe66QmKcymy9btYrdoBuLpwz59aPIYl942rvFiBvqkpdXXF6 kxTl4klSutAYzKDMbnAHOWSuz0d2Ky7fr5A= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627401017757100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" EDKII Redfish Feature Core DXE driver provides the protocol interface to the auto-generated Redfish feature driver to register itself for the Redfish resource URI it manages. Refer to the Readme.md for the details. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao --- RedfishClientPkg/RedfishClientPkg.dec | 13 +- .../RedfishClientComponents.dsc.inc | 2 + RedfishClientPkg/RedfishClient.fdf.inc | 1 + .../RedfishFeatureCoreDxe.inf | 49 +++ .../Include/Protocol/EdkIIRedfishFeature.h | 116 ++++++ .../RedfishFeatureCoreDxe.h | 43 ++ .../RedfishFeatureCoreDxe.c | 382 ++++++++++++++++++ RedfishClientPkg/Readme.md | 36 ++ 8 files changed, 641 insertions(+), 1 deletion(-) create mode 100644 RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCo= reDxe.inf create mode 100644 RedfishClientPkg/Include/Protocol/EdkIIRedfishFeature.h create mode 100644 RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCo= reDxe.h create mode 100644 RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCo= reDxe.c diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi= shClientPkg.dec index 4038a47bd5..6da0468e65 100644 --- a/RedfishClientPkg/RedfishClientPkg.dec +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -15,10 +15,21 @@ [Includes] Include =20 - [LibraryClasses] =20 [Protocols] + ## Include/Protocol/EdkIIRedfishFeature.h + gEdkIIRedfishFeatureProtocolGuid =3D { 0x785CC694, 0x4930, 0xEFBF, { 0x2= A, 0xCB, 0xA4, 0xB6, 0xA1, 0xCC, 0xAA, 0x34 } } =20 [Guids] gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee, = { 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } } + +[PcdsFixedAtBuild] + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|UINT= 32|0x10000001 + gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8|UINT= 32|0x10000002 + # + # gEfiEventReadyToBootGuid is the default event to startup Redfish featu= re drivers. + # { 0x7CE88FB3, 0x4BD7, 0x4679, { 0x87, 0xA8, 0xA8, 0xD8, 0xDE, 0xE5, 0x= 0D, 0x2B }} + # + gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupEv= entGuid|{0xB3, 0x8F, 0xE8, 0x7C, 0xD7, 0x4B, 0x79, 0x46, 0x87, 0xA8, 0xA8, = 0xD8, 0xDE, 0xE5, 0x0D, 0x2B}|VOID*|0x10000003 + diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc b/RedfishClie= ntPkg/RedfishClientComponents.dsc.inc index 0648fa9d54..e4e2619bfb 100644 --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc @@ -13,4 +13,6 @@ ## =20 !if $(REDFISH_CLIENT) =3D=3D TRUE + RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf !endif + diff --git a/RedfishClientPkg/RedfishClient.fdf.inc b/RedfishClientPkg/Redf= ishClient.fdf.inc index 4f0714004e..d4c5874787 100644 --- a/RedfishClientPkg/RedfishClient.fdf.inc +++ b/RedfishClientPkg/RedfishClient.fdf.inc @@ -11,4 +11,5 @@ # ## !if $(REDFISH_CLIENT) =3D=3D TRUE + INF RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf !endif diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.i= nf b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf new file mode 100644 index 0000000000..5a2cd7fecc --- /dev/null +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf @@ -0,0 +1,49 @@ +## @file +# RedfishFeatureCoreDxe is the DXE driver which provides +# EdkIIRedfishFeatureCoreProtocol to EDK2 Redfish Feature +# drivers for the registration. +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001000b + BASE_NAME =3D RedfishFeatureCoreDxe + FILE_GUID =3D 1E01A624-4161-F1F1-25BC-D28E77420D8E + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D RedfishFeatureCoreEntryPoint + +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 RISCV64 +# + +[Sources] + RedfishFeatureCoreDxe.c + RedfishFeatureCoreDxe.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishClientPkg/RedfishClientPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + PrintLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Protocols] + gEdkIIRedfishFeatureProtocolGuid ## BY_START + +[Pcd] + gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupEv= entGuid + +[Depex] + TRUE diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishFeature.h b/Redf= ishClientPkg/Include/Protocol/EdkIIRedfishFeature.h new file mode 100644 index 0000000000..036622128d --- /dev/null +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishFeature.h @@ -0,0 +1,116 @@ +/** @file + This file defines the EDKII_REDFISH_FEATURE_PROTOCOL interface. + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef EDKII_REDFISH_FEATURE_H_ +#define EDKII_REDFISH_FEATURE_H_ + +typedef struct _EDKII_REDFISH_FEATURE_PROTOCOL EDKII_REDFISH_FEATURE_PROTO= COL; + +#define EDKII_REDFISH_FEATURE_PROTOCOL_GUID \ + { \ + 0x785CC694, 0x4930, 0xEFBF, { 0x2A, 0xCB, 0xA4, 0xB6, 0xA1, 0xCC, 0x= AA, 0x34 } \ + } + +typedef enum { + CallbackActionNone =3D 0, ///< Invalid action + CallbackActionStartOperation, ///< Start the operations on Redfish resou= rce + CallbackActionMax +} FEATURE_CALLBACK_ACTION; + +typedef enum { + InformationTypeNone =3D 0, ///< Invalid information. + InformationTypeCollectionMemberUri, ///< URI to the new created collecti= on member. + InformationTypeMax +} FEATURE_RETURNED_INFORMATION_TYPE; + +typedef struct { + FEATURE_RETURNED_INFORMATION_TYPE Type; +} FEATURE_RETURNED_INFORMATION; + +/** + The callback function provided by Redfish Feature driver. + + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROT= OCOL instance. + @param[in] FeatureAction The action Redfish feature driver sho= uld take. + @param[in] Context The context of Redfish feature driver. + @param[in,out] InformationReturned The pointer to retrive the pointer to + FEATURE_RETURNED_INFOMATION. The memo= ry block of this + information should be freed by caller. + + @retval EFI_SUCCESS Redfish feature driver callback is exec= uted successfully. + @retval Others Some errors happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *REDFISH_FEATURE_CALLBACK) ( + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, + IN FEATURE_CALLBACK_ACTION FeatureAction, + IN VOID *Context, + IN OUT FEATURE_RETURNED_INFORMATION **InformationReturned +); +/** + The registration function for the Redfish Feature driver. + + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROTOC= OL instance. + @param[in] FeatureManagedUri The URI represents the hierarchy path o= f the Redfish + resource in the entire Redfish data mod= el that managed + by Redfish feature driver . Each node i= n the hierarchy + path is the property name defined in th= e schema of the + resource. + @param[in] Callback Callback routine associated with this r= egistration that + provided by Redfish feature driver to e= xecute the action + on Redfish resource which is managed by= this Redfish + feature driver. + @param[in] Context The context of the registering feature = driver. The pointer + to the conext is delivered through call= back function. + @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *REDFISH_FEATURE_REGISTER) ( + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, + IN EFI_STRING FeatureManagedUri, + IN REDFISH_FEATURE_CALLBACK Callback, + IN VOID *Context +); + +/** + The unregistration function for the Redfish Feature driver. + + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROTOC= OL instance. + @param[in] FeatureManagedUri The URI represents the hierarchy path o= f the Redfish + resource in the entire Redfish data mod= el that managed + by Redfish feature driver . Each node i= n the hierarchy + path is the property name defined in th= e schema of the + resource. + @param[in] Context The context used for the previous featu= re driver + registration. + @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *REDFISH_FEATURE_UNREGISTER) ( + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, + IN EFI_STRING FeatureManagedUri, + IN VOID *Context +); + +struct _EDKII_REDFISH_FEATURE_PROTOCOL { + REDFISH_FEATURE_REGISTER Register; + REDFISH_FEATURE_UNREGISTER Unregister; +}; + +extern EFI_GUID gEdkIIRedfishFeatureProtocolGuid; + +#endif diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h new file mode 100644 index 0000000000..7b1778b038 --- /dev/null +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h @@ -0,0 +1,43 @@ +/** @file + Definitions of RedfishFeatureCoreDxe + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef EDKII_REDFISH_FEATURE_CORE_DXE_H_ +#define EDKII_REDFISH_FEATURE_CORE_DXE_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define MaxNodeNameLength 64 +#define NodeSeperator L'/' +#define NodeIsCollectionLeftBracket '{' +#define NodeIsCollectionRightBracket '}' + +typedef struct _REDFISH_FEATURE_INTERNAL_DATA REDFISH_FEATURE_INTERNAL_DAT= A; +struct _REDFISH_FEATURE_INTERNAL_DATA { + REDFISH_FEATURE_INTERNAL_DATA *SiblingList; ///< Next same level in hier= archy of resource URI. + REDFISH_FEATURE_INTERNAL_DATA *ChildList; ///< Next level in hierarchy= of resource URI. + EFI_STRING NodeName; ///< Name of the node in hierarchy= of resource URI. + REDFISH_FEATURE_CALLBACK Callback; ///< Callback function of Redfish = feature driver. + VOID *Context; ///< Context of feature driver. + FEATURE_RETURNED_INFORMATION *ReturnedInformation; ///< Information retu= rned from Redfish feature driver. + UINT32 Flags; +}; +#define REDFISH_FEATURE_INTERNAL_DATA_IS_COLLECTION 0x00000001 + +typedef struct { + EDKII_REDFISH_FEATURE_PROTOCOL *This; + FEATURE_CALLBACK_ACTION Action; +} REDFISH_FEATURE_STARTUP_CONTEXT; +#endif diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c new file mode 100644 index 0000000000..e5dcc3de8e --- /dev/null +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -0,0 +1,382 @@ +/** @file + RedfishFeatureCoreDxe produces EdkIIRedfishFeatureCoreProtocol + for EDK2 Redfish Feature driver registration. + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +EFI_EVENT mEdkIIRedfishFeatureDriverStartupEvent; +REDFISH_FEATURE_STARTUP_CONTEXT mFeatureDriverStartupContext; +REDFISH_FEATURE_INTERNAL_DATA *ResourceUriNodeList; + +/** + Startup child feature drivers and it's sibing feature drivers. + + @param[in] HeadList Head list of this feature driver + @param[in] ThisFeatureDriverList This feature driver list. + @param[in] StartupContext Start up information + +**/ +VOID +StartUpFeatureDriver ( + IN REDFISH_FEATURE_INTERNAL_DATA *ThisFeatureDriverList, + IN REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext +) +{ + EFI_STATUS Status; + REDFISH_FEATURE_INTERNAL_DATA *ThisList; + + ThisList =3D ThisFeatureDriverList; + while (TRUE) { + if (ThisList->Callback !=3D NULL) { + Status =3D ThisList->Callback( + StartupContext->This, + StartupContext->Action, + ThisList->Context, + &ThisList->ReturnedInformation + ); + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "%a: Callback to EDK2 Redfish feature driver f= ail.", __FUNCTION__)); + } + } + if (ThisList->ChildList !=3D NULL) { + StartUpFeatureDriver (ThisList->ChildList, StartupContext); + } + // + // Check sibling Redfish feature driver. + // + if (ThisList->SiblingList =3D=3D NULL) { + break; + } + // + // Go next sibling Redfish feature driver. + // + ThisList =3D ThisList->SiblingList; + }; +} + +/** + Callback routine when mEdkIIRedfishFeatureDriverStartupEvent + is signaled. + + @param[in] Event Event whose notification function is b= eing invoked. + @param[in] Context The pointer to the notification functi= on's context, + which is implementation-dependent. + +**/ +VOID +RedfishFeatureDriverStartup( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; + + StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; + // + // Invoke EDK2 Redfish feature driver callback to start up + // the Redfish operations. + // + if (ResourceUriNodeList =3D=3D NULL) { + return; + } + // + // Invoke the callback by the hierarchy level + // + StartUpFeatureDriver (ResourceUriNodeList, StartupContext); +} + +/** + Create new internal data instance. + + @param[in,out] PtrToNewInternalData Pointer to receive new instance of + REDFISH_FEATURE_INTERNAL_DATA. + @param[in] NodeName Name of URI node. + + @retval EFI_SUCCESS New entry is inserted successfully. + @retval EFI_INVALID_PARAMETER Improper given parameters. + @retval EFI_OUT_OF_RESOURCES Lack of memory for the internal data st= ructure. + +**/ +EFI_STATUS +NewInternalInstance ( + IN OUT REDFISH_FEATURE_INTERNAL_DATA **PtrToNewInternalData, + IN EFI_STRING NodeName + ) +{ + REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; + + if (PtrToNewInternalData =3D=3D NULL || NodeName =3D=3D NULL) { + DEBUG((DEBUG_ERROR, "%a: Inproper given parameters\n", __FUNCTION__)); + return EFI_INVALID_PARAMETER; + } + + *PtrToNewInternalData =3D NULL; + NewInternalData =3D AllocateZeroPool (sizeof (REDFISH_FEATURE_INTERNAL_D= ATA)); + if (NewInternalData =3D=3D NULL) { + DEBUG((DEBUG_ERROR, "%a: No memory for REDFISH_FEATURE_INTERNAL_DATA\n= ", __FUNCTION__)); + return EFI_OUT_OF_RESOURCES; + } + NewInternalData->NodeName =3D AllocateZeroPool (StrSize (NodeName)); + StrnCpyS (NewInternalData->NodeName, StrSize (NodeName), (CONST CHAR16 *= )NodeName, StrLen (NodeName)); + NewInternalData->SiblingList =3D NULL; + NewInternalData->ChildList =3D NULL; + if (NodeName[0] =3D=3D (UINT16)NodeIsCollectionLeftBracket && + NodeName [StrLen (NodeName) - 1] =3D=3D (UINT16)NodeIsCollectionRigh= tBracket) { + NewInternalData->Flags |=3D REDFISH_FEATURE_INTERNAL_DATA_IS_COLLECTIO= N; + } + *PtrToNewInternalData =3D NewInternalData; + return EFI_SUCCESS; +} + +/** + Insert the URI node into internal data structure + + @param[in] HeadEntryToInsert The head entry to start the searching. + @param[in] NodeName Name of URI node. + @param[in] NextNodeEntry Pointer to receive the pointer of next h= ead + entry for inserting the follow up nodes. + The returned LIST_ENTRY is the address of + ChildList link list. + @retval EFI_SUCCESS New entry is inserted successfully. + @retval EFI_INVALID_PARAMETER Improper given parameters. + @retval EFI_OUT_OF_RESOURCES Lack of memory for the internal data st= ructure. + +**/ +EFI_STATUS +InsertRedfishFeatureUriNode ( + IN REDFISH_FEATURE_INTERNAL_DATA *HeadEntryToInsert, + IN EFI_STRING NodeName, + IN OUT REDFISH_FEATURE_INTERNAL_DATA **NextNodeEntry + ) +{ + EFI_STATUS Status; + REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; + REDFISH_FEATURE_INTERNAL_DATA *ThisInternalData; + REDFISH_FEATURE_INTERNAL_DATA *SiblingList; + + if (NodeName =3D=3D NULL) { + DEBUG((DEBUG_ERROR, "%a: Node name is NULL.\n", __FUNCTION__)); + return EFI_INVALID_PARAMETER; + } + if (NextNodeEntry =3D=3D NULL) { + DEBUG((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", __FUNCTION__= )); + return EFI_INVALID_PARAMETER; + } + + if (HeadEntryToInsert =3D=3D NULL || HeadEntryToInsert->ChildList =3D=3D= NULL) { + Status =3D NewInternalInstance (&NewInternalData, NodeName); + if (EFI_ERROR (Status)) { + return Status; + } + if (HeadEntryToInsert =3D=3D NULL) { + ResourceUriNodeList =3D NewInternalData; + } else { + HeadEntryToInsert->ChildList =3D NewInternalData; + } + *NextNodeEntry =3D NewInternalData; + return EFI_SUCCESS; + } + // + // Go through sibling list to find the entry. + // + ThisInternalData =3D HeadEntryToInsert; + SiblingList =3D ThisInternalData->SiblingList; + while (TRUE) { + if (StrCmp((CONST CHAR16 *)ThisInternalData->NodeName, (CONST CHAR16 *= )NodeName) =3D=3D 0) { + *NextNodeEntry =3D ThisInternalData->ChildList; + return EFI_SUCCESS; + } + // + // If sibing exist? + // + if (SiblingList =3D=3D NULL) { + Status =3D NewInternalInstance (&NewInternalData, NodeName); + if (EFI_ERROR (Status)) { + return Status; + } + ThisInternalData->SiblingList =3D NewInternalData; + *NextNodeEntry =3D NewInternalData->ChildList; + return EFI_SUCCESS; + } + SiblingList =3D SiblingList->SiblingList; + }; + return EFI_SUCCESS; +} + +/** + The registration function for the Redfish Feature driver. + + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROTOC= OL instance. + @param[in] FeatureManagedUri The URI represents the hierarchy path o= f the Redfish + resource in the entire Redfish data mod= el that managed + by Redfish feature driver . Each node i= n the hierarchy + path is the property name defined in th= e schema of the + resource. + e.g. "ServiceRoot/" - Managed by Servic= eRoot feature driver + "ServiceRoot/Systems[]/" - Managed= by ComputerSystemCollection feature driver + "ServiceRoot/Systems[1]/" - Manage= d by ComputerSystem feature driver + "ServiceRoot/Systems[2]/Bios/" - M= anaged by Bios feature driver + @param[in] Callback Callback routine associated with this r= egistration that + provided by Redfish feature driver to e= xecute the action + on Redfish resource which is managed by= this Redfish + feature driver. + @param[in] Context The context of the registering feature = driver. The pointer + to the conext is delivered through call= back function. + @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. + @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. + @retval EFI_INVALID_PARAMETER Improper given parameters or fail to re= gister + feature driver. + @retval EFI_OUT_OF_RESOURCES Lack of memory for the internal data st= ructure. + @retval Others Some error happened. + +**/ +EFI_STATUS +EFIAPI +RedfishFeatureRegister ( + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, + IN EFI_STRING FeatureManagedUri, + IN REDFISH_FEATURE_CALLBACK Callback, + IN VOID *Context +) +{ + CHAR16 NodeName [MaxNodeNameLength]; + EFI_STATUS Status; + UINTN Index; + UINTN AnchorIndex; + UINTN UriLength; + REDFISH_FEATURE_INTERNAL_DATA *ThisUriNode; + + if (FeatureManagedUri =3D=3D NULL || Callback =3D=3D NULL) { + DEBUG((DEBUG_ERROR, "%a: The given parameter is invalid\n", __FUNCTION= __)); + return EFI_INVALID_PARAMETER; + } + // + // Walk through URI which managed by this EDK2 Redfish feature driver. + // + UriLength =3D StrLen (FeatureManagedUri) + 1; // Add one NULL for the la= st node. + Index =3D 0; + AnchorIndex =3D 0; + ThisUriNode =3D ResourceUriNodeList; + do { + if ((Index - AnchorIndex + 1) >=3D MaxNodeNameLength) { // Increase on= e for the NULL terminator + DEBUG((DEBUG_ERROR, "%a: the length of node name is >=3D MaxNodeName= Length\n", __FUNCTION__)); + ASSERT (FALSE); + } + NodeName[Index - AnchorIndex] =3D *(FeatureManagedUri + Index); + if (NodeName [Index - AnchorIndex] =3D=3D NodeSeperator || NodeName [I= ndex - AnchorIndex] =3D=3D (CHAR16)0) { + NodeName [Index - AnchorIndex] =3D 0; + AnchorIndex =3D Index + 1; + // + // Insert node + // + if (StrLen(NodeName) !=3D 0) { + Status =3D InsertRedfishFeatureUriNode(ThisUriNode, NodeName, &Thi= sUriNode); + if (EFI_ERROR (Status)) { + return Status; + } + } + } + Index ++; + } while ((Index < UriLength)); + + if (ThisUriNode =3D=3D NULL) { + // + // No URI node was created + // + DEBUG((DEBUG_ERROR, "%a: No URI node is added\n", __FUNCTION__)); + return EFI_INVALID_PARAMETER; + } + // + // Add feature driver info to internal data instance. + // + ThisUriNode->Callback =3D Callback; + ThisUriNode->Context =3D Context; + return EFI_SUCCESS; +} + +/** + The unregistration function for the Redfish Feature driver. + + @param[in] This Pointer to EDKII_REDFISH_FEATURE_PROTOC= OL instance. + @param[in] FeatureManagedUri The URI represents the hierarchy path o= f the Redfish + resource in the entire Redfish data mod= el that managed + by Redfish feature driver . Each node i= n the hierarchy + path is the property name defined in th= e schema of the + resource. + @param[in] Context The context used for the previous featu= re driver + registration. + @retval EFI_SUCCESS Redfish feature driver is registered su= ccessfully. + @retval Others Some error happened. + +**/ +EFI_STATUS +RedfishFeatureUnregister ( + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, + IN EFI_STRING FeatureManagedUri, + IN VOID *Context +) +{ + return EFI_UNSUPPORTED; +} + +EDKII_REDFISH_FEATURE_PROTOCOL mRedfishFeatureProtocol =3D { + RedfishFeatureRegister, + RedfishFeatureUnregister +}; + +/** + Main entry for this driver. + + @param ImageHandle Image handle this driver. + @param SystemTable Pointer to SystemTable. + + @retval EFI_SUCESS This function always complete successfully. + +**/ +EFI_STATUS +EFIAPI +RedfishFeatureCoreEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + EFI_GUID *EventGuid; + + Handle =3D NULL; + ResourceUriNodeList =3D NULL; + EventGuid =3D (EFI_GUID *)PcdGetPtr (PcdEdkIIRedfishFeatureDriverStartup= EventGuid); + + ZeroMem ((VOID *)&mFeatureDriverStartupContext, sizeof (REDFISH_FEATURE_= STARTUP_CONTEXT)); + mFeatureDriverStartupContext.This =3D &mRedfishFeatureProtocol; + + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + RedfishFeatureDriverStartup, + (CONST VOID *)&mFeatureDriverStartupContext, + EventGuid, + &mEdkIIRedfishFeatureDriverStartupEvent + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Install the RedfishCredentialProtocol onto Handle. + // + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEdkIIRedfishFeatureProtocolGuid, + &mRedfishFeatureProtocol, + NULL + ); + return Status; +} diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md index 9e56fb9039..18a27633cf 100644 --- a/RedfishClientPkg/Readme.md +++ b/RedfishClientPkg/Readme.md @@ -119,6 +119,42 @@ struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL { For those Non-EDK2 HII-based platform configuration formats, the driver in= stance can provide its own implementation to get or set the platform configuratio= ns. =20 +### EDKII Redfish Feature Core DXE Driver ***[[12]](#[0])*** +EDKII Redfish Feature Core DXE driver provides the protocol interface to +the auto-generated Redfish feature driver to register itself for the +Redfish resource URI it manages. + +```C +struct _EDKII_REDFISH_FEATURE_PROTOCOL { + REDFISH_FEATURE_REGISTER Register; + REDFISH_FEATURE_UNREGISTER Unregister; +}; +``` + +Redfish Feature Core DXE driver records the +URI according to the URI hierarchy, and then it starts up the Redfish +feature drivers based on the hierarchy when the particular event +***[[11]](#[0])*** is triggered. This makes sure the upper-level Redfish +resource is built up before the lower-level resource. For example, +ComputerSystem resource must be ready before the Memory resource managed +by MemoryCollection because the Memory resource is part of ComputerSystem +resource. + +### Start-Up Event to Trigger EDKII Redfish Feature Core ***[[11]](#[0])*** +This is an EFI event for triggering EDKII Redfish Feature Core to travel +URIs in the database and execute the callback that registered by Redfish f= eature +drivers. The event GUID is defined in below PCD and is default set to +**gEfiEventReadyToBootGuid**. + +```C +PcdEdkIIRedfishFeatureDriverStartupEventGuid +``` + +This PCD can be overridden to any events based on the platform +implementation. EDKII Redfish Feature Core can be triggered earlier, +for example before the BDS or in the early DXE phase if the platform provi= des +the EFI REST EX protocol which is available before the BDS phase. + ### EDK2 HII VFR Form ***[[8]](#[0])*** According to **UEFI spec 2.9 section 35.6 Form Browser Protocol**, **EFI_HII_REST_STYLE_FORMSET_GUID** is used on HII form to indicate that H= II --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78229): https://edk2.groups.io/g/devel/message/78229 Mute This Topic: https://groups.io/mt/84484823/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 1 13:32:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78228+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78228+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1627401011; cv=none; d=zohomail.com; s=zohoarc; b=kb8M7oTScnxm3T1S1x4hdGYvBiDFzdQp8rXXVdP4JzqZrzFoz2M4ObG9E0Ex7cJGbZdbj+oxaNfOeF9oOd9s0AHE9Ep5dkoxQio9LnfqDrEopyqM98S/gXXOdG34YbBgAQMGqrWmHUXDfTeMgb1uaZLt8yYzyiMTHdctIog9JnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627401011; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fEt4ircECX1mMDtU1/69/TL090zEf26wqYc73OvTDOk=; b=nsG0n4GXxNjbo2RVdkMZzAd5t2FyFohQBBh6uGvkncJ35YTLioFRf8YsNN3O03jjzgqvgdXLfiE2EM2i2cuvjpWUmx7iU+g9esWuIIDLT1KE3DHgzlMBMcf18FJ33iF2an50cr/zUZNM+7oaWZdE9rjeTELPILIXmo0iU39Ly18= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78228+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627401011110116.05306515988002; Tue, 27 Jul 2021 08:50:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zKKvYY1788612x48oF1fVLZg; Tue, 27 Jul 2021 08:50:10 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.3138.1627401007658528371 for ; Tue, 27 Jul 2021 08:50:07 -0700 X-Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RFnQuI021409; Tue, 27 Jul 2021 15:50:02 GMT X-Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0a-002e3701.pphosted.com with ESMTP id 3a236g0gbc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 15:50:02 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 6C65961; Tue, 27 Jul 2021 15:50:01 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 38C8248; Tue, 27 Jul 2021 15:50:00 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client RedfishFeatureCore PATCH 3/3] RedfishClientPkg/Document: Update diagrams Date: Tue, 27 Jul 2021 22:54:42 +0800 Message-Id: <20210727145442.22840-4-abner.chang@hpe.com> In-Reply-To: <20210727145442.22840-1-abner.chang@hpe.com> References: <20210727145442.22840-1-abner.chang@hpe.com> X-Proofpoint-GUID: TnlmWE9-Wd5OSVwV8P0BAAkFboeATsok X-Proofpoint-ORIG-GUID: TnlmWE9-Wd5OSVwV8P0BAAkFboeATsok X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-002e3701.pphosted.com id 16RFnQuI021409 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: Wt22cnE4pRXeBdtClz870Q91x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627401010; bh=QbrbmuAYgH8fY1aRSqFfcSBp0+MxHkjMETpbqhkPrZY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=k9XLBM2R8xyoX28cl5RWDKFoiqXZdjpH/OZ0QHzCpRL1IfxVRma3Xkzrb66/BT3de4z +fHZqnCUKK/L6x0yN98xmSTsb3bGLDR+lVSTZotV2FcFguKfoyoGELIRrPJ0o+SVi8QcG ZL16h/vb9L3BmFQZCr08n9if0VE0QrR5CaI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627401011439100009 Content-Type: text/plain; charset="utf-8" Update architectural diagrams. You can skip reviewing this patch. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../Media/RedfishClientDriverStack.svg | 197 ++++++++++++------ 1 file changed, 135 insertions(+), 62 deletions(-) diff --git a/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg = b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg index 881d9647e5..913c941e73 100644 --- a/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg +++ b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg @@ -3,7 +3,7 @@ + viewBox=3D"0 0 873.222 715.588" xml:space=3D"preserve" color-interpolati= on-filters=3D"sRGB" class=3D"st71"> @@ -47,9 +47,9 @@ .st33 {stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-= width:4.5} .st34 {fill:#000000;fill-opacity:0.38;filter:url(#filter_3.3333334922791= );stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:= 0.38} .st35 {fill:#000000;fill-opacity:0.38;stroke:#000000;stroke-opacity:0.38= ;stroke-width:0.22935779816514} - .st36 {fill:#f2f2f2;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:= round;stroke-width:0.75} - .st37 {fill:#7f7f7f;fill-opacity:1;stroke:#7f7f7f;stroke-opacity:1;strok= e-width:0.22935779816514} - .st38 {fill:#d8d8d8;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:= round;stroke-width:0.75} + .st36 {fill:#f2f2f2;stroke:#ffff00;stroke-linecap:round;stroke-linejoin:= round;stroke-width:0.75} + .st37 {fill:#ffff00;fill-opacity:1;stroke:#ffff00;stroke-opacity:1;strok= e-width:0.22935779816514} + .st38 {fill:#d8d8d8;stroke:#ffff00;stroke-linecap:round;stroke-linejoin:= round;stroke-width:0.75} .st39 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:= round;stroke-width:0.24} .st40 {fill:#000000;fill-opacity:0.4;filter:url(#filter_3.3333334922791)= ;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0= .4} .st41 {fill:#0070c0;stroke:#003f6c;stroke-linecap:round;stroke-linejoin:= round;stroke-width:1.5} @@ -78,9 +78,11 @@ .st64 {marker-start:url(#mrkr4-405);stroke:#000000;stroke-linecap:round;= stroke-linejoin:round;stroke-width:1.25} .st65 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;strok= e-width:0.3315649867374} .st66 {marker-end:url(#mrkr4-411);stroke:#000000;stroke-linecap:round;st= roke-linejoin:round;stroke-width:1.25} - .st67 {marker-end:url(#mrkr10-430);marker-start:url(#mrkr10-112);stroke:= #000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25} + .st67 {marker-end:url(#mrkr10-425);marker-start:url(#mrkr10-112);stroke:= #000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25} .st68 {stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-= width:1.25} - .st69 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;strok= e-linecap:square;stroke-miterlimit:3} + .st69 {fill:#f59d56;stroke:none;stroke-linecap:butt;stroke-width:0.75} + .st70 {fill:#ffffff;stroke:#ffc000;stroke-linecap:round;stroke-linejoin:= round;stroke-width:2} + .st71 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;strok= e-linecap:square;stroke-miterlimit:3} ]]> =20 @@ -145,7 +147,7 @@ markerUnits=3D"strokeWidth" overflow=3D"visible"> - @@ -177,6 +179,7 @@ Page-2 + Rectangle.52 @@ -544,27 +547,27 @@ Sheet.78 - + - - - - + + + + Folded Corner - + v:shadowScale=3D"1.02" transform=3D"matrix(1.02,0,0,1.02,-3.19213,-9= .45175)" class=3D"st10"> + - + - + Sheet.81 @@ -572,20 +575,20 @@ - + - - + + - + v:shadowScale=3D"1.02" transform=3D"matrix(1.02,0,0,1.02,-0.635046,-= 14.3117)" class=3D"st10"> + - + - + @@ -607,7 +610,7 @@ EDK2 HII Database - + Sheet.84 EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL @@ -619,26 +622,26 @@ EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL - + 1-D double.75 - + - + 1-D double.68 - + v:shadowScale=3D"1.02" transform=3D"matrix(1.02,0,0,1.02,-1.69037,-14= .0418)" class=3D"st10"> + - + Sheet.87 @@ -701,7 +704,7 @@ Script-generated EDK2= Redfish Collection Driver - + Rounded Rectangle.98 EDK2 HII UNI file #string STR_OPTION_A #language x-uefi-redfi...<= /desc> @@ -753,7 +756,7 @@ class=3D"st48"> =E2=80=9C/SCHEMA/PropertyC=E2=80=9D - + Rounded Rectangle.100 EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...<= /desc> @@ -783,7 +786,7 @@ x=3D"24.37" dy=3D"1.6em" class=3D"st53">Option A EnabledOption B DisabledOption C 0x16 - + Rounded Rectangle.101 EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...<= /desc> @@ -813,7 +816,7 @@ x=3D"24.37" dy=3D"1.6em" class=3D"st53">Option A EnabledOption B DisabledOption C 0x16 - + Rounded Rectangle EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...<= /desc> @@ -845,14 +848,15 @@ x=3D"24.4" dy=3D"0.8em" class=3D"st54">Option C 0x16 + transform=3D"translate(732.324,840.498) rotate(-33.0707) scale(1,-1)"> Curve connect 1.110 - + Sheet.122 @@ -889,21 +893,21 @@ [5] - + Sheet.127 [6] [6] - + Sheet.128 [8] [8] - + Sheet.129 [9] @@ -954,7 +958,7 @@ UEFI/EDK2 open source<= /text> - + Configure @@ -998,15 +1002,16 @@ 21.41 683.97 23.76 684.23 Z" class=3D"st63"/> + transform=3D"translate(205.698,1070.76) scale(1,-1)"> Side to top/bottom.145 - + - + Bottom to top fixed 2 @@ -1015,31 +1020,23 @@ - + - - Side to top/bottom - - - - - - - + Sheet.152 [10] [10] - + Sheet.153 EDK2 Build Tool EDK2 Build Tool - Curve connect 2 @@ -1047,22 +1044,98 @@ - + Sheet.154 [7] [7] - + Curve connect 1.155 - + + + + Sheet.294 + Redfish Feature Core DXE + + + + + + + Redfish Feature Core D= XE + + Bottom to top fixed 2.296 + + + + + + + + + + + Forward + + + + + + + + 16-Point Star + Event Trigger + + + + + + + + + + + + + + Event Trigger + + Sheet.304 + [11] + + + + [11] + + Sheet.305 + [12] + + + + [12] + + Forward.307 + + + + + --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78228): https://edk2.groups.io/g/devel/message/78228 Mute This Topic: https://groups.io/mt/84484821/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-