From nobody Mon Apr 29 07:50:56 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+67044+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+67044+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589873; cv=none; d=zohomail.com; s=zohoarc; b=OZPIzVyB0jEEhRtgI+rtASE4IIs8msdW8npJP4G96oKk50BEwhM+oB20dDc6yDbZ4gurj3bWXRddHziK5RpsncoLVPp8owfFhsEG3p6U9bf6sjW6F5P77u83DszJe4Tb9vBWz8XjIWNrBV3KIi/eIwaknFB8QD0IGF08YGczVT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589873; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=af91URr9j+M6cloxJtCjL5R6/Rd+0fcMin8mIDx3NH4=; b=O4liHSEwsioLG2ApkDggjdsVylHXXH+BMOcjTEX6+WvMrKYUAd7HUxrZXeqsY8arLO9yUBXgzV6qMSpun3lljutIgHK2fpRPbVWfDp0VPshPiUU9+PRrdz66Wt0p0uBMDnPsYaG0jb/WvsSGASpvxALEJadcVqWXxWgf3G8M/Nc= 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+67044+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604589873249358.13906999655467; Thu, 5 Nov 2020 07:24:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id EBSqYY1788612xJZIav9DRzx; Thu, 05 Nov 2020 07:24:32 -0800 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.9015.1604589872057838773 for ; Thu, 05 Nov 2020 07:24:32 -0800 X-Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FDjVk004473 for ; Thu, 5 Nov 2020 15:24:31 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 34kc882j7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 05 Nov 2020 15:24:31 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id BBC225C for ; Thu, 5 Nov 2020 15:24:30 +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 D57754D; Thu, 5 Nov 2020 15:24:29 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 1/6] RedfishPkg: Add PCD definition to RedfishPkg Date: Thu, 5 Nov 2020 22:38:48 +0800 Message-Id: <20201105143853.2180-2-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: 5qciFkz8J12gyi50UkvsL75Ux1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589872; bh=m5V0E21bcwGdjRbB/HdeuJMaB+Gg2N9OcWHg+GoVl/Y=; h=Cc:Date:From:Reply-To:Subject:To; b=fsX1toSdmuDNwnPi4RKdNMJqkDaqFK4DsZZ6VimCrnzG4FOt6CmeNwoZZK2k4f/XJfC +K/zg5cwq/LEwL0AksFouv4G3JyWvksPKQ2pjNt7N1x4VJaB4SYgaiNNmZp7kqnnQ5N3q AQDyzpiMeZaWFP6fp/ckBrCQKFiWl3aeALQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This PCD is the UEFI device path which is used as the Redfish host interface. Signed-off-by: Jiaxin Wu Signed-off-by: Ting Ye Signed-off-by: Siyuan Fu Signed-off-by: Fan Wang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Peter O'Hanley Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.dec | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index f12f83526c..b38e9b4789 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -28,3 +28,25 @@ [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 +[PcdsFixedAtBuild, PcdsPatchableInModule] + # + # This PCD is the UEFI device path which is used as the Redfish host int= erface. + # + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath|{0x0}|RES= T_EX_SERVICE_DEVICE_PATH_DATA|0x00001000 { + + Pcd/RestExServiceDevicePath.h + + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + } + # + # This PCD indicates the EFI REST EX access mode to Redfish service. + # Default is set to out of band access. + # + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|FAL= SE|BOOLEAN|0x00001001 + # + # This PCD indicates the access mode EFI Discover protocol uses to look = for the proper EFI REST EX + # protocol instance. + # + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|FALSE|BO= OLEAN|0x00001002 --=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 (#67044): https://edk2.groups.io/g/devel/message/67044 Mute This Topic: https://groups.io/mt/78053310/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 Mon Apr 29 07:50:56 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+67046+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+67046+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589879; cv=none; d=zohomail.com; s=zohoarc; b=YQEcl+EzQ2+URQ+7M2FiCJ65Cm16abeqESv7cCfprZSQ1QvoSMHlQH1iS6DX4sj0FfOZc9WDAnWKcRuQMEWwaAb1ieysQIldvIIlANyFWw0+Ha6qkG8lUwo+o6+lU7YC3KViljqtjgvTvSHL/FHEtL1eOROkAvnafe1bpghMO6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589879; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=mKitJeoi8Yx4BmLlVx2dsgGqSqx/VRbRCvYRXBWY9Ag=; b=jA7cqmAAaoO+Id+6puvLU5pUaW+JDjIKkpcLO1jykF0IJo/crDfM1gvPixqQLNkRX/TAILCZXbS80A61yrU/7oq5+rFoq3zxYaQuLDskdPZhJ+uEgZQzYxLPWruM2TjbFjd1VfUNF2yuS2MBrvkX5U/2cBOmuHzC+LN6Zp64l1Y= 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+67046+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 160458987924278.22049066645752; Thu, 5 Nov 2020 07:24:39 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id zGatYY1788612xGcZZFMOrRB; Thu, 05 Nov 2020 07:24:38 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.9016.1604589873523209635 for ; Thu, 05 Nov 2020 07:24:33 -0800 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FFJAh008499; Thu, 5 Nov 2020 15:24:33 GMT X-Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 34kb70aax6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 15:24:33 +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 8DA6C5A; Thu, 5 Nov 2020 15:24:32 +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 145AB48; Thu, 5 Nov 2020 15:24:30 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 2/6] RedfishPkg: DSC and FDF include files for enabling EFI Redfish support Date: Thu, 5 Nov 2020 22:38:49 +0800 Message-Id: <20201105143853.2180-3-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: UQ8cExLYMnVDjCyr80iw38ZQx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589878; bh=x8ukicKcxVhE8ePiR/r7TsgYtu47C1pWVl8zWL8ZJ3I=; h=Cc:Date:From:Reply-To:Subject:To; b=HFCdfUSxVHS8SIP3kef+Tydpb4XY0YgmAswgEStqMQyZ1z9/LimFKeGCHvYZjrM5HL6 5B1tjcI/gWyFYKExzHxRJw7Fa8xOkPiQ86AajMIPYGvNI0thB1zv8oLetUON96CMZbOPg F+xdHBCcivBS+FDk5E1u/5kLGaqjdaUy6hY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Nickle Wang Cc: Peter O'Hanley Reviewed-by: Nickle Wang --- RedfishPkg/Redfish.dsc.inc | 21 +++++++++++++++++++++ RedfishPkg/Redfish.fdf.inc | 16 ++++++++++++++++ RedfishPkg/RedfishComponents.dsc.inc | 18 ++++++++++++++++++ RedfishPkg/RedfishDefines.dsc.inc | 27 +++++++++++++++++++++++++++ RedfishPkg/RedfishLibs.dsc.inc | 15 +++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 RedfishPkg/Redfish.dsc.inc create mode 100644 RedfishPkg/Redfish.fdf.inc create mode 100644 RedfishPkg/RedfishComponents.dsc.inc create mode 100644 RedfishPkg/RedfishDefines.dsc.inc create mode 100644 RedfishPkg/RedfishLibs.dsc.inc diff --git a/RedfishPkg/Redfish.dsc.inc b/RedfishPkg/Redfish.dsc.inc new file mode 100644 index 0000000000..ac72909ca2 --- /dev/null +++ b/RedfishPkg/Redfish.dsc.inc @@ -0,0 +1,21 @@ +## @file +# Redfish 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 RedfishPkg/= Redfish.dsc.inc". +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + !include RedfishPkg/RedfishDefines.dsc.inc + +[LibraryClasses] + !include RedfishPkg/RedfishLibs.dsc.inc + +[Components] + !include RedfishPkg/RedfishComponents.dsc.inc + diff --git a/RedfishPkg/Redfish.fdf.inc b/RedfishPkg/Redfish.fdf.inc new file mode 100644 index 0000000000..19de479a80 --- /dev/null +++ b/RedfishPkg/Redfish.fdf.inc @@ -0,0 +1,16 @@ +## @file +# Redfish 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 RedfishPkg/RedfisLibs.fdf.inc" to specify the module = instances +# to be built in the firmware volume. +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +!if $(REDFISH_ENABLE) =3D=3D TRUE + INF RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf + INF RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf +!endif diff --git a/RedfishPkg/RedfishComponents.dsc.inc b/RedfishPkg/RedfishCompo= nents.dsc.inc new file mode 100644 index 0000000000..ac1b57ed8f --- /dev/null +++ b/RedfishPkg/RedfishComponents.dsc.inc @@ -0,0 +1,18 @@ +## @file +# Redfish DSC include file for [Components*] section of all Architectures. +# +# This file can be included to the [Components*] section(s) of a platform = DSC file +# by using "!include RedfishPkg/RedfishComponents.dsc.inc" to specify the = INF files +# of EDKII Redfish drivers according to the value of flags described in +# "RedfishDefines.dsc.inc". +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +!if $(REDFISH_ENABLE) =3D=3D TRUE + RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf + RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf +!endif diff --git a/RedfishPkg/RedfishDefines.dsc.inc b/RedfishPkg/RedfishDefines.= dsc.inc new file mode 100644 index 0000000000..0049f92378 --- /dev/null +++ b/RedfishPkg/RedfishDefines.dsc.inc @@ -0,0 +1,27 @@ +## @file +# RedfishPkg DSC include file for [Defines] section of all Architectures. +# +# This file can be included to the [Defines] section of a platform DSC fil= e by +# using "!include RedfishPkg/RedfishDefines.dsc.inc" to set value 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_ENABLE =3D TRUE +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +!ifndef REDFISH_ENABLE + # + # This flag is to enable or disable the whole Redfish support. + # + DEFINE REDFISH_ENABLE =3D TRUE +!endif + diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.inc new file mode 100644 index 0000000000..e780b5c270 --- /dev/null +++ b/RedfishPkg/RedfishLibs.dsc.inc @@ -0,0 +1,15 @@ +## @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 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +!if $(REDFISH_ENABLE) =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 (#67046): https://edk2.groups.io/g/devel/message/67046 Mute This Topic: https://groups.io/mt/78053313/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 Mon Apr 29 07:50:56 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+67047+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+67047+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589878; cv=none; d=zohomail.com; s=zohoarc; b=eotPAY/Mj3elva91svD/HNKAlZzmdVuax+a4b/hCxN63HfNrdnspEcpZz8uiHleA3ZkGDrkMV9AZCx6f9MCDdfmIJfxaFCM40e/P+w4lthMDyvZWReBKuUCzAwKgP4XRzW8ni3J5Cyg9meH0jgotcSu2QC+sPfdlns8l5gA81Ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589878; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=JF/vTS0jVpReoyaRWi1lmn0pNHxlVPjHnqfe7eBI1hc=; b=DjCXmRBOF5c+iSLD3oc5ubFhJCDSMAyr8xxBYweUdRDfldnebThD/NqMfaNpDY3GHA5iYslDkAogbUhV/Vfnlv4dddEb7OvsWGjgG/osd1y0exyRb8DUYltdPWS4qkixLAeKj0Huft+rQ/BF4z/w4Crtz5Lshqsm3ulMJ5bdVkk= 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+67047+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16045898783471003.1218061809766; Thu, 5 Nov 2020 07:24:38 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id eSBPYY1788612xHMtgkov3hy; Thu, 05 Nov 2020 07:24:37 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.8967.1604589877363133388 for ; Thu, 05 Nov 2020 07:24:37 -0800 X-Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FIJ7V013276; Thu, 5 Nov 2020 15:24:35 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0a-002e3701.pphosted.com with ESMTP id 34kc7v1q87-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 15:24:35 +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 32EADB8; Thu, 5 Nov 2020 15:24:34 +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 C684148; Thu, 5 Nov 2020 15:24:32 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 3/6] EmulatorPkg/RedfishPlatformHostInterfaceLib library Date: Thu, 5 Nov 2020 22:38:50 +0800 Message-Id: <20201105143853.2180-4-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: FthUoQ0IlhrehJgajaA7pL2Vx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589877; bh=BkKPc/7BdEU/TKaPo8ks12R3bri6eSOz2S9VuP2OsRM=; h=Cc:Date:From:Reply-To:Subject:To; b=k74tjQAvml6xoMlnBsqb6zxXBlqlth/yRGZkna6gpw50VH6M4Q1YW+1wfXWdrzIICrb 6mF/Jug8lXFnKZvrYrcAI/Zwiivpp3937oAumQJqhTK4JWmVnFn3J7gsCjqxmg4m29pXE BI7o52JCIDZuJYnnaufsipOgTlfkemu+N4s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Platform specific implementation of providing Redfish host interface information. Signed-off-by: Jiaxin Wu Signed-off-by: Ting Ye Signed-off-by: Siyuan Fu Signed-off-by: Fan Wang Signed-off-by: Abner Chang Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Cc: Nickle Wang Cc: Peter O'Hanley --- EmulatorPkg/EmulatorPkg.dec | 1 + .../RedfishPlatformHostInterfaceLib.c | 528 ++++++++++++++++++ .../RedfishPlatformHostInterfaceLib.inf | 47 ++ 3 files changed, 576 insertions(+) create mode 100644 EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/Red= fishPlatformHostInterfaceLib.c create mode 100644 EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/Red= fishPlatformHostInterfaceLib.inf diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec index 064f963c72..5d7fe6473e 100644 --- a/EmulatorPkg/EmulatorPkg.dec +++ b/EmulatorPkg/EmulatorPkg.dec @@ -46,6 +46,7 @@ gEmuSystemConfigGuid =3D { 0xF8626165, 0x6CEB, 0x924A, { 0xBA, 0xF= C, 0xF1, 0x3A, 0xB9, 0xD6, 0x57, 0x28 } } gEmuVirtualDisksGuid =3D { 0xf2ba331a, 0x8985, 0x11db, { 0xa4, 0x0= 6, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } } gEmuPhysicalDisksGuid =3D { 0xf2bdcc96, 0x8985, 0x11db, { 0x87, 0x1= 9, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } } + gEmuRedfishServiceGuid =3D { 0x3fb208ac, 0x2185, 0x498c, { 0xbf, 0x4= 6, 0xdc, 0x23, 0xda, 0x58, 0x7b, 0x55 } } =20 [PcdsFeatureFlag] ## If TRUE, if symbols only load on breakpoints and gdb entry diff --git a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPla= tformHostInterfaceLib.c b/EmulatorPkg/Library/RedfishPlatformHostInterfaceL= ib/RedfishPlatformHostInterfaceLib.c new file mode 100644 index 0000000000..4e7bb65c06 --- /dev/null +++ b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo= stInterfaceLib.c @@ -0,0 +1,528 @@ +/** @file + PCI/PCIe network interface instace of RedfishPlatformHostInterfaceLib + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define VERBOSE_COLUME_SIZE (16) + +REDFISH_OVER_IP_PROTOCOL_DATA *mRedfishOverIpProtocolData; +UINT8 mRedfishProtocolDataSize; + +/** + Get the MAC address of NIC. + + @param[out] MacAddress Pointer to retrieve MAC address + + @retval EFI_SUCCESS MAC address is returned in MacAddress + +**/ +EFI_STATUS +GetMacAddressInformation ( + OUT EFI_MAC_ADDRESS *MacAddress + ) +{ + MAC_ADDR_DEVICE_PATH *Mac; + REST_EX_SERVICE_DEVICE_PATH_DATA *RestExServiceDevicePathData; + EFI_DEVICE_PATH_PROTOCOL *RestExServiceDevicePath; + MAC_ADDR_DEVICE_PATH *MacAddressDevicePath; + + Mac =3D NULL; + RestExServiceDevicePathData =3D NULL; + RestExServiceDevicePath =3D NULL; + + RestExServiceDevicePathData =3D (REST_EX_SERVICE_DEVICE_PATH_DATA *)PcdG= etPtr(PcdRedfishRestExServiceDevicePath); + if (RestExServiceDevicePathData =3D=3D NULL || + RestExServiceDevicePathData->DevicePathNum =3D=3D 0 || + !IsDevicePathValid (RestExServiceDevicePathData->DevicePath, 0)) { + return EFI_NOT_FOUND; + } + + RestExServiceDevicePath =3D RestExServiceDevicePathData->DevicePath; + if (RestExServiceDevicePathData->DevicePathMatchMode !=3D DEVICE_PATH_MA= TCH_MAC_NODE) { + return EFI_NOT_FOUND; + } + + // + // Find Mac DevicePath Node. + // + while (!IsDevicePathEnd (RestExServiceDevicePath) && + ((DevicePathType (RestExServiceDevicePath) !=3D MESSAGING_DEVICE_= PATH) || + (DevicePathSubType (RestExServiceDevicePath) !=3D MSG_MAC_ADDR_D= P))) { + RestExServiceDevicePath =3D NextDevicePathNode (RestExServiceDevicePat= h); + } + + if (!IsDevicePathEnd (RestExServiceDevicePath)) { + MacAddressDevicePath =3D (MAC_ADDR_DEVICE_PATH *)RestExServiceDevicePa= th; + CopyMem ((VOID *)MacAddress, (VOID *)&MacAddressDevicePath->MacAddress= , sizeof (EFI_MAC_ADDRESS)); + return EFI_SUCCESS; + } + return EFI_NOT_FOUND; +} + +/** + Get platform Redfish host interface device descriptor. + + @param[out] DeviceType Pointer to retrieve device type. + @param[out] DeviceDescriptor Pointer to retrieve REDFISH_INTERFACE_DATA= , caller has to free + this memory using FreePool(). + @retval EFI_SUCCESS Device descriptor is returned successfully in De= viceDescriptor. + @retval EFI_NOT_FOUND No Redfish host interface descriptor provided on= this platform. + @retval Others Fail to get device descriptor. +**/ +EFI_STATUS +RedfishPlatformHostInterfaceDeviceDescriptor ( + OUT UINT8 *DeviceType, + OUT REDFISH_INTERFACE_DATA **DeviceDescriptor +) +{ + EFI_STATUS Status; + EFI_MAC_ADDRESS MacAddress; + REDFISH_INTERFACE_DATA *RedfishInterfaceData; + PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2 *ThisDeviceDescriptor; + + RedfishInterfaceData =3D AllocateZeroPool (sizeof (PCI_OR_PCIE_INTERFACE= _DEVICE_DESCRIPTOR_V2) + 1); + if (RedfishInterfaceData =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + RedfishInterfaceData->DeviceType =3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_= PCI_PCIE_V2; + // + // Fill up device type information. + // + ThisDeviceDescriptor =3D (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2 *)(= (UINT8 *)RedfishInterfaceData + 1); + ThisDeviceDescriptor->Length =3D sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DE= SCRIPTOR_V2) + 1; + Status =3D GetMacAddressInformation (&MacAddress); + if (EFI_ERROR (Status)) { + FreePool (RedfishInterfaceData); + return EFI_NOT_FOUND; + } + CopyMem ((VOID *)&ThisDeviceDescriptor->MacAddress, (VOID *)&MacAddress,= sizeof (ThisDeviceDescriptor->MacAddress)); + *DeviceType =3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2; + *DeviceDescriptor =3D RedfishInterfaceData; + return EFI_SUCCESS; +} +/** + Get platform Redfish host interface protocol data. + Caller should pass NULL in ProtocolRecord to retrive the first protocol = record. + Then continuously pass previous ProtocolRecord for retrieving the next P= rotocolRecord. + + @param[out] ProtocolRecord Pointer to retrieve the protocol record. + caller has to free the new protocol recor= d returned from + this function using FreePool(). + @param[in] IndexOfProtocolData The index of protocol data. + + @retval EFI_SUCCESS Protocol records are all returned. + @retval EFI_NOT_FOUND No more protocol records. + @retval Others Fail to get protocol records. +**/ +EFI_STATUS +RedfishPlatformHostInterfaceProtocolData ( + OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord, + IN UINT8 IndexOfProtocolData +) +{ + MC_HOST_INTERFACE_PROTOCOL_RECORD *ThisProtocolRecord; + + if (mRedfishOverIpProtocolData =3D=3D 0) { + return EFI_NOT_FOUND; + } + if (IndexOfProtocolData =3D=3D 0) { + // + // Return the first Redfish protocol data to caller. We only have + // one protocol data in this case. + // + ThisProtocolRecord =3D (MC_HOST_INTERFACE_PROTOCOL_RECORD *) AllocateP= ool (mRedfishProtocolDataSize + sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) = - 1); + ThisProtocolRecord->ProtocolType =3D MCHostInterfaceProtocolTypeRedfis= hOverIP; + ThisProtocolRecord->ProtocolTypeDataLen =3D mRedfishProtocolDataSize; + CopyMem ((VOID *)&ThisProtocolRecord->ProtocolTypeData, (VOID *)mRedfi= shOverIpProtocolData, mRedfishProtocolDataSize); + *ProtocolRecord =3D ThisProtocolRecord; + return EFI_SUCCESS; + } + return EFI_NOT_FOUND; +} +/** + Dump IPv4 address. + + @param[in] Ip IPv4 address +**/ +VOID +InternalDumpIp4Addr ( + IN EFI_IPv4_ADDRESS *Ip + ) +{ + UINTN Index; + + for (Index =3D 0; Index < 4; Index++) { + DEBUG ((DEBUG_VERBOSE, "%d", Ip->Addr[Index])); + if (Index < 3) { + DEBUG ((DEBUG_VERBOSE, ".")); + } + } + + DEBUG ((DEBUG_VERBOSE, "\n")); +} +/** + Dump IPv6 address. + + @param[in] Ip IPv6 address +**/ +VOID +InternalDumpIp6Addr ( + IN EFI_IPv6_ADDRESS *Ip + ) +{ + UINTN Index; + + for (Index =3D 0; Index < 16; Index++) { + if (Ip->Addr[Index] !=3D 0) { + DEBUG ((DEBUG_VERBOSE, "%x", Ip->Addr[Index])); + } + Index++; + + if (Index > 15) { + return; + } + + if (((Ip->Addr[Index] & 0xf0) =3D=3D 0) && (Ip->Addr[Index - 1] !=3D 0= )) { + DEBUG ((DEBUG_VERBOSE, "0")); + } + DEBUG ((DEBUG_VERBOSE, "%x", Ip->Addr[Index])); + + if (Index < 15) { + DEBUG ((DEBUG_VERBOSE, ":")); + } + } + DEBUG ((DEBUG_VERBOSE, "\n")); +} +/** + Dump data + + @param[in] Data Pointer to data. + @param[in] Size size of data to dump. +**/ +VOID +InternalDumpData ( + IN UINT8 *Data, + IN UINTN Size + ) +{ + UINTN Index; + for (Index =3D 0; Index < Size; Index++) { + DEBUG ((DEBUG_VERBOSE, "%02x ", (UINTN)Data[Index])); + } +} +/** + Dump hex data + + @param[in] Data Pointer to hex data. + @param[in] Size size of hex data to dump. +**/ +VOID +InternalDumpHex ( + IN UINT8 *Data, + IN UINTN Size + ) +{ + UINTN Index; + UINTN Count; + UINTN Left; + + Count =3D Size / VERBOSE_COLUME_SIZE; + Left =3D Size % VERBOSE_COLUME_SIZE; + for (Index =3D 0; Index < Count; Index++) { + InternalDumpData (Data + Index * VERBOSE_COLUME_SIZE, VERBOSE_COLUME_S= IZE); + DEBUG ((DEBUG_VERBOSE, "\n")); + } + + if (Left !=3D 0) { + InternalDumpData (Data + Index * VERBOSE_COLUME_SIZE, Left); + DEBUG ((DEBUG_VERBOSE, "\n")); + } + + DEBUG ((DEBUG_VERBOSE, "\n")); +} +/** + Dump Redfish over IP protocol data + + @param[in] RedfishProtocolData Pointer to REDFISH_OVER_IP_PROTOCOL_D= ATA + @param[in] RedfishProtocolDataSize size of data to dump. +**/ +VOID +DumpRedfishIpProtocolData ( + IN REDFISH_OVER_IP_PROTOCOL_DATA *RedfishProtocolData, + IN UINT8 RedfishProtocolDataSize + ) +{ + CHAR16 Hostname[16]; + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData: \n")); + InternalDumpHex ((UINT8 *) RedfishProtocolData, RedfishProtocolDataSize); + + DEBUG ((DEBUG_VERBOSE, "Parsing as below: \n")); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->ServiceUuid - %g\n", &(Redf= ishProtocolData->ServiceUuid))); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->HostIpAssignmentType - %d\n= ", RedfishProtocolData->HostIpAssignmentType)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->HostIpAddressFormat - %d\n"= , RedfishProtocolData->HostIpAddressFormat)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->HostIpAddress: \n")); + if (RedfishProtocolData->HostIpAddressFormat =3D=3D 0x01) { + InternalDumpIp4Addr ((EFI_IPv4_ADDRESS *) (RedfishProtocolData->HostIp= Address)); + } else { + InternalDumpIp6Addr ((EFI_IPv6_ADDRESS *) (RedfishProtocolData->HostIp= Address)); + } + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->HostIpMask: \n")); + if (RedfishProtocolData->HostIpAddressFormat =3D=3D 0x01) { + InternalDumpIp4Addr ((EFI_IPv4_ADDRESS *) (RedfishProtocolData->HostIp= Mask)); + } else { + InternalDumpIp6Addr ((EFI_IPv6_ADDRESS *) (RedfishProtocolData->HostIp= Mask)); + } + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceIpDiscoveryTy= pe - %d\n", RedfishProtocolData->RedfishServiceIpDiscoveryType)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceIpAddressForm= at - %d\n", RedfishProtocolData->RedfishServiceIpAddressFormat)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceIpAddress: \n= ")); + if (RedfishProtocolData->RedfishServiceIpAddressFormat =3D=3D 0x01) { + InternalDumpIp4Addr ((EFI_IPv4_ADDRESS *) (RedfishProtocolData->Redfis= hServiceIpAddress)); + } else { + InternalDumpIp6Addr ((EFI_IPv6_ADDRESS *) (RedfishProtocolData->Redfis= hServiceIpAddress)); + } + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceIpMask: \n")); + if (RedfishProtocolData->RedfishServiceIpAddressFormat =3D=3D 0x01) { + InternalDumpIp4Addr ((EFI_IPv4_ADDRESS *) (RedfishProtocolData->Redfis= hServiceIpMask)); + } else { + InternalDumpIp6Addr ((EFI_IPv6_ADDRESS *) (RedfishProtocolData->Redfis= hServiceIpMask)); + } + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceIpPort - %d\n= ", RedfishProtocolData->RedfishServiceIpPort)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceVlanId - %d\n= ", RedfishProtocolData->RedfishServiceVlanId)); + + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceHostnameLengt= h - %d\n", RedfishProtocolData->RedfishServiceHostnameLength)); + + AsciiStrToUnicodeStrS((CHAR8 *) RedfishProtocolData->RedfishServiceHostn= ame, Hostname, sizeof (Hostname) / sizeof (Hostname[0])); + DEBUG ((DEBUG_VERBOSE, "RedfishProtocolData->RedfishServiceHostname - %s= \n", Hostname)); +} + +/** + Get Redfish host interface protocol data from variale. + + @param[out] RedfishProtocolData Pointer to retrieve REDFISH_OVER_IP_PRO= TOCOL_DATA. + @param[out] RedfishProtocolDataSize Size of REDFISH_OVER_IP_PROTOCOL_DA= TA. + + @retval EFI_SUCESS REDFISH_OVER_IP_PROTOCOL_DATA is returned successfu= lly. +**/ +EFI_STATUS +GetRedfishRecordFromVariable ( + OUT REDFISH_OVER_IP_PROTOCOL_DATA **RedfishProtocolData, + OUT UINT8 *RedfishProtocolDataSize + ) +{ + EFI_STATUS Status; + UINT8 HostIpAssignmentType; + UINTN HostIpAssignmentTypeSize; + EFI_IPv4_ADDRESS HostIpAddress; + UINTN IPv4DataSize; + EFI_IPv4_ADDRESS HostIpMask; + EFI_IPv4_ADDRESS RedfishServiceIpAddress; + EFI_IPv4_ADDRESS RedfishServiceIpMask; + UINT16 RedfishServiceIpPort; + UINTN IpPortDataSize; + UINT8 HostNameSize; + CHAR8 RedfishHostName[20]; + + if (RedfishProtocolData =3D=3D NULL || RedfishProtocolDataSize =3D=3D NU= LL) { + return EFI_INVALID_PARAMETER; + } + + // + // 1. Retrieve Address Information from variable. + // + Status =3D gRT->GetVariable ( + L"HostIpAssignmentType", + &gEmuRedfishServiceGuid, + NULL, + &HostIpAssignmentTypeSize, + &HostIpAssignmentType + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable HostIpAssignment= Type - %r\n", Status)); + return Status; + } + + IPv4DataSize =3D sizeof (EFI_IPv4_ADDRESS); + if (HostIpAssignmentType =3D=3D 1 ) { + Status =3D gRT->GetVariable ( + L"HostIpAddress", + &gEmuRedfishServiceGuid, + NULL, + &IPv4DataSize, + &HostIpAddress + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable HostIpAddress = - %r\n", Status)); + return Status; + } + + Status =3D gRT->GetVariable ( + L"HostIpMask", + &gEmuRedfishServiceGuid, + NULL, + &IPv4DataSize, + &HostIpMask + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable HostIpMask - %= r\n", Status)); + return Status; + } + } + + Status =3D gRT->GetVariable ( + L"RedfishServiceIpAddress", + &gEmuRedfishServiceGuid, + NULL, + &IPv4DataSize, + &RedfishServiceIpAddress + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable RedfishServiceIp= Address - %r\n", Status)); + return Status; + } + + Status =3D gRT->GetVariable ( + L"RedfishServiceIpMask", + &gEmuRedfishServiceGuid, + NULL, + &IPv4DataSize, + &RedfishServiceIpMask + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable RedfishServiceIp= Mask - %r\n", Status)); + return Status; + } + + Status =3D gRT->GetVariable ( + L"RedfishServiceIpPort", + &gEmuRedfishServiceGuid, + NULL, + &IpPortDataSize, + &RedfishServiceIpPort + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RedfishPlatformDxe: GetVariable RedfishServiceIp= Port - %r\n", Status)); + return Status; + } + + AsciiSPrint ( + RedfishHostName, + sizeof (RedfishHostName), + "%d.%d.%d.%d", + RedfishServiceIpAddress.Addr[0], + RedfishServiceIpAddress.Addr[1], + RedfishServiceIpAddress.Addr[2], + RedfishServiceIpAddress.Addr[3] + ); + + HostNameSize =3D (UINT8) AsciiStrLen (RedfishHostName) + 1; + + // + // 2. Protocol Data Size. + // + *RedfishProtocolDataSize =3D sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1 = + HostNameSize; + + // + // 3. Protocol Data. + // + *RedfishProtocolData =3D (REDFISH_OVER_IP_PROTOCOL_DATA *) AllocateZeroP= ool (*RedfishProtocolDataSize); + if (*RedfishProtocolData =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + + CopyGuid (&(*RedfishProtocolData)->ServiceUuid, &gEmuRedfishServiceGuid); + + (*RedfishProtocolData)->HostIpAssignmentType =3D HostIpAssignmentType; + (*RedfishProtocolData)->HostIpAddressFormat =3D 1; // Only support IPv4 + + if (HostIpAssignmentType =3D=3D 1 ) { + (*RedfishProtocolData)->HostIpAddress[0] =3D HostIpAddress.Addr[0]; + (*RedfishProtocolData)->HostIpAddress[1] =3D HostIpAddress.Addr[1]; + (*RedfishProtocolData)->HostIpAddress[2] =3D HostIpAddress.Addr[2]; + (*RedfishProtocolData)->HostIpAddress[3] =3D HostIpAddress.Addr[3]; + + (*RedfishProtocolData)->HostIpMask[0] =3D HostIpMask.Addr[0]; + (*RedfishProtocolData)->HostIpMask[1] =3D HostIpMask.Addr[1]; + (*RedfishProtocolData)->HostIpMask[2] =3D HostIpMask.Addr[2]; + (*RedfishProtocolData)->HostIpMask[3] =3D HostIpMask.Addr[3]; + } + + (*RedfishProtocolData)->RedfishServiceIpDiscoveryType =3D 1; // Use sta= tic IP address + (*RedfishProtocolData)->RedfishServiceIpAddressFormat =3D 1; // Only su= pport IPv4 + + (*RedfishProtocolData)->RedfishServiceIpAddress[0] =3D RedfishServiceIpA= ddress.Addr[0]; + (*RedfishProtocolData)->RedfishServiceIpAddress[1] =3D RedfishServiceIpA= ddress.Addr[1]; + (*RedfishProtocolData)->RedfishServiceIpAddress[2] =3D RedfishServiceIpA= ddress.Addr[2]; + (*RedfishProtocolData)->RedfishServiceIpAddress[3] =3D RedfishServiceIpA= ddress.Addr[3]; + + (*RedfishProtocolData)->RedfishServiceIpMask[0] =3D RedfishServiceIpMask= .Addr[0]; + (*RedfishProtocolData)->RedfishServiceIpMask[1] =3D RedfishServiceIpMask= .Addr[1]; + (*RedfishProtocolData)->RedfishServiceIpMask[2] =3D RedfishServiceIpMask= .Addr[2]; + (*RedfishProtocolData)->RedfishServiceIpMask[3] =3D RedfishServiceIpMask= .Addr[3]; + + (*RedfishProtocolData)->RedfishServiceIpPort =3D RedfishServiceIpPort; + (*RedfishProtocolData)->RedfishServiceVlanId =3D 0xffffffff; + + (*RedfishProtocolData)->RedfishServiceHostnameLength =3D HostNameSize; + AsciiStrCpyS ((CHAR8 *) ((*RedfishProtocolData)->RedfishServiceHostname)= , HostNameSize, RedfishHostName); + + return Status; +} + +/** + Construct Redfish host interface protocol data. + + @param ImageHandle The image handle. + @param SystemTable The system table. + + @retval EFI_SUCEESS Install Boot manager menu success. + @retval Other Return error status. + +**/ +EFI_STATUS +EFIAPI +RedfishPlatformHostInterfaceConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +{ + EFI_STATUS Status; + + Status =3D GetRedfishRecordFromVariable (&mRedfishOverIpProtocolData, &m= RedfishProtocolDataSize); + DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n", __FUNCT= ION__, Status)); + if (!EFI_ERROR (Status)) { + DumpRedfishIpProtocolData (mRedfishOverIpProtocolData, mRedfishProtoco= lDataSize); + } + return EFI_SUCCESS; +} diff --git a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPla= tformHostInterfaceLib.inf b/EmulatorPkg/Library/RedfishPlatformHostInterfac= eLib/RedfishPlatformHostInterfaceLib.inf new file mode 100644 index 0000000000..6fe5d9b32b --- /dev/null +++ b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo= stInterfaceLib.inf @@ -0,0 +1,47 @@ +## @file +# NULL instance of RedfishPlatformHostInterfaceLib +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001000b + BASE_NAME =3D RedfishPlatformHostInterfaceLib + FILE_GUID =3D D5ECB7F2-4906-94E2-45B1-31BF4FD90122 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RedfishPlatformHostInterfaceLib + CONSTRUCTOR =3D RedfishPlatformHostInterfaceConstruct= or +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + RedfishPlatformHostInterfaceLib.c + +[Packages] + EmulatorPkg/EmulatorPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + +[LibraryClasses] + UefiLib + BaseLib + BaseMemoryLib + DebugLib + PcdLib + MemoryAllocationLib + +[Pcd] + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath #= # CONSUMES + +[Guids] + gEmuRedfishServiceGuid + +[Depex] + gEfiVariableArchProtocolGuid AND + gEfiVariableWriteArchProtocolGuid --=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 (#67047): https://edk2.groups.io/g/devel/message/67047 Mute This Topic: https://groups.io/mt/78053316/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 Mon Apr 29 07:50:56 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+67048+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+67048+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589883; cv=none; d=zohomail.com; s=zohoarc; b=DQFev7APdS324orLBpsdS8F1/1e+jwOZJzoNzF1vmmHsNNhFe351SxyAMkHNoWgtnTucnxjn2A3PQaVgHXZ3J3ylqMQeCS4DEBehShRjc53lRuzWSyt/V9eXaOeUKl9HCtDZlpRGKacIpc5qYipwmR2g1hQ/S6bm/cbHPw1eabc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589883; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=vOVNz/OcOQHXTGmPIUEqust0y1nLX4yDx0pWDd/rhbY=; b=kiR7SSq5hMcCS7xAgY/X3LUEqdeXSpZ67T4qnakbGP8tByYp/cFjkgudUE78nfUCAeqfSjzhJdp9KWb+6lu9wXBmzO9jmzcMyHzmNq1W9ik5Fq2CVSy19QTu7kNdp8aGaK55rM+20ym6IT8ZgDREmbpxxFQJN9ZlvmRMaFQgynU= 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+67048+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604589883672319.6600248639254; Thu, 5 Nov 2020 07:24:43 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9FBKYY1788612xgAHe1ZscRc; Thu, 05 Nov 2020 07:24:43 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.9178.1604589877871034525 for ; Thu, 05 Nov 2020 07:24:37 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FI773008609; Thu, 5 Nov 2020 15:24:36 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0a-002e3701.pphosted.com with ESMTP id 34kr4td010-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 15:24:36 +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 E597F92; Thu, 5 Nov 2020 15:24:35 +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 83B324C; Thu, 5 Nov 2020 15:24:34 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 4/6] EmulatorPkg/Application: Publish Redfish Host Interface Record Date: Thu, 5 Nov 2020 22:38:51 +0800 Message-Id: <20201105143853.2180-5-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: 9xSOcpLjQ3l3HyUCWlZsEHvKx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589883; bh=EQ/opVx0LPebrQyppY2BLBb3lheZDkRCzNxiDg48I3E=; h=Cc:Date:From:Reply-To:Subject:To; b=rn7HGN/NI0uOvQUwBibFpK8EuUHik+kbR91nPSkLHPQxpA+33j+zQ4K+QTZxVJr7bEf pD3HVtkXJiFQJuCE/UFD8OCgSZNTLS2ywV7pp7r7uOxLq/PWF9huHgACegRZIMqAQwdAL QyTeACTGJvQHvDyEuolJ+vYBuMVFC7W9574= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiaxin Wu Signed-off-by: Ting Ye Signed-off-by: Siyuan Fu Signed-off-by: Fan Wang Signed-off-by: Abner Chang Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Cc: Nickle Wang Cc: Peter O'Hanley --- .../RedfishPlatformConfig.c | 298 ++++++++++++++++++ .../RedfishPlatformConfig.inf | 42 +++ 2 files changed, 340 insertions(+) create mode 100644 EmulatorPkg/Application/RedfishPlatformConfig/RedfishPl= atformConfig.c create mode 100644 EmulatorPkg/Application/RedfishPlatformConfig/RedfishPl= atformConfig.inf diff --git a/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformC= onfig.c b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConf= ig.c new file mode 100644 index 0000000000..89d4c760a7 --- /dev/null +++ b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig.c @@ -0,0 +1,298 @@ +/** @file + The implementation for Redfish Platform Configuration application. + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +UINTN Argc; +CHAR16 **Argv; + +/** + + This function parse application ARG. + + @return Status +**/ +EFI_STATUS +GetArg ( + VOID + ) +{ + EFI_STATUS Status; + EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters; + + Status =3D gBS->HandleProtocol ( + gImageHandle, + &gEfiShellParametersProtocolGuid, + (VOID**)&ShellParameters + ); + if (EFI_ERROR(Status)) { + return Status; + } + + Argc =3D ShellParameters->Argc; + Argv =3D ShellParameters->Argv; + return EFI_SUCCESS; +} + +/** + + This function print the help message. + +**/ +VOID +PrintHelp ( + VOID + ) +{ + Print (L"\n"); + Print (L"Format (Only Ipv4 Address is supported):\n"); + Print (L"RedfishPlatformConfig.efi -s HostIpAddress HostIpMask RedfishSe= rviceIpAddress RedfishServiceIpMask RedfishServiceIpPort\n"); + Print (L"OR:\n"); + Print (L"RedfishPlatformConfig.efi -a RedfishServiceIpAddress RedfishSer= viceIpMask RedfishServiceIpPort\n"); + Print (L"\n"); +} + +/** + The user Entry Point for Application. The user code starts with this fun= ction + as the real entry point for the application. + + @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry po= int. + +**/ +EFI_STATUS +EFIAPI +UefiMain ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + RETURN_STATUS ReturnStatus; + + UINT8 HostIpAssignmentType; + EFI_IPv4_ADDRESS HostIpAddress; + EFI_IPv4_ADDRESS HostIpMask; + EFI_IPv4_ADDRESS RedfishServiceIpAddress; + EFI_IPv4_ADDRESS RedfishServiceIpMask; + UINTN RedfishServiceIpPort; + + Status =3D GetArg(); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Format is like : + // RedfishPlatformConfig.efi -s HostIpAddress HostIpMask RedfishServiceI= pAddress RedfishServiceIpMask RedfishServiceIpPort + // RedfishPlatformConfig.efi -a RedfishServiceIpAddress RedfishServiceIp= Mask RedfishServiceIpPort + // + if (Argc !=3D 7 && Argc !=3D 5) { + + PrintHelp(); + return EFI_UNSUPPORTED; + } + + if (StrCmp(Argv[1], L"-s") =3D=3D 0) { + + HostIpAssignmentType =3D 1; + + Status =3D NetLibStrToIp4 (Argv[2], &HostIpAddress); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + Status =3D NetLibStrToIp4 (Argv[3], &HostIpMask); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + Status =3D NetLibStrToIp4 (Argv[4], &RedfishServiceIpAddress); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + Status =3D NetLibStrToIp4 (Argv[5], &RedfishServiceIpMask); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + ReturnStatus =3D StrDecimalToUintnS (Argv[6], NULL, &RedfishServiceIpP= ort); + if (RETURN_ERROR (ReturnStatus)) { + PrintHelp(); + return Status; + } + + Status =3D gRT->SetVariable ( + L"HostIpAssignmentType", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (UINT8), + &HostIpAssignmentType + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"HostIpAddress", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &HostIpAddress + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"HostIpMask", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &HostIpMask + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpAddress", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &RedfishServiceIpAddress + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpMask", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &RedfishServiceIpMask + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpPort", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (UINT16), + &RedfishServiceIpPort + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Print (L"\n"); + Print (L"HostIpAssignmentType is Static!\n"); + Print (L"HostIpAddress: %s has been set Successfully!\n", Argv[2]); + Print (L"HostIpMask: %s has been set Successfully!\n", Argv[3]); + Print (L"RedfishServiceIpAddress: %s has been set Successfully!\n", Ar= gv[4]); + Print (L"RedfishServiceIpMask: %s has been set Successfully!\n", Argv[= 5]); + Print (L"RedfishServiceIpPort: %s has been set Successfully!\n", Argv[= 6]); + Print (L"Please Restart!\n"); + + } else if (StrCmp(Argv[1], L"-a") =3D=3D 0) { + + HostIpAssignmentType =3D 3; + + Status =3D NetLibStrToIp4 (Argv[2], &RedfishServiceIpAddress); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + Status =3D NetLibStrToIp4 (Argv[3], &RedfishServiceIpMask); + if (EFI_ERROR (Status)) { + PrintHelp(); + return Status; + } + ReturnStatus =3D StrDecimalToUintnS (Argv[4], NULL, &RedfishServiceIpP= ort); + if (RETURN_ERROR (ReturnStatus)) { + PrintHelp(); + return Status; + } + + Status =3D gRT->SetVariable ( + L"HostIpAssignmentType", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (UINT8), + &HostIpAssignmentType + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpAddress", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &RedfishServiceIpAddress + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpMask", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (EFI_IPv4_ADDRESS), + &RedfishServiceIpMask + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D gRT->SetVariable ( + L"RedfishServiceIpPort", + &gEmuRedfishServiceGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (UINT16), + &RedfishServiceIpPort + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Print (L"\n"); + Print (L"HostIpAssignmentType is Auto!\n"); + Print (L"RedfishServiceIpAddress: %s has been set Successfully!\n", Ar= gv[2]); + Print (L"RedfishServiceIpMask: %s has been set Successfully!\n", Argv[= 3]); + Print (L"RedfishServiceIpPort: %s has been set Successfully!\n", Argv[= 4]); + Print (L"Please Restart!\n"); + } else if (StrCmp(Argv[1], L"-h") =3D=3D 0 || StrCmp(Argv[1], L"-help") = =3D=3D 0) { + + PrintHelp(); + } else { + + PrintHelp(); + return EFI_UNSUPPORTED; + } + + return EFI_SUCCESS; +} diff --git a/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformC= onfig.inf b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformCo= nfig.inf new file mode 100644 index 0000000000..386c9bdd8c --- /dev/null +++ b/EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig.i= nf @@ -0,0 +1,42 @@ +## @file +# Sample UEFI Application Reference EDKII Module. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x0001000b + BASE_NAME =3D RedfishPlatformConfig + FILE_GUID =3D C02B67BB-3D19-4ACC-A080-1BDB575F8F36 + MODULE_TYPE =3D UEFI_APPLICATION + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D UefiMain + +[Sources] + RedfishPlatformConfig.c + +[Packages] + EmulatorPkg/EmulatorPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + NetworkPkg/NetworkPkg.dec + RedfishPkg/RedfishPkg.dec + +[LibraryClasses] + DebugLib + NetLib + UefiApplicationEntryPoint + UefiLib + UefiBootServicesTableLib + UefiRuntimeServicesTableLib +[Protocols] + gEfiShellParametersProtocolGuid ## CONSUMES + gEfiShellProtocolGuid ## CONSUMES + +[Guids] + gEmuRedfishServiceGuid --=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 (#67048): https://edk2.groups.io/g/devel/message/67048 Mute This Topic: https://groups.io/mt/78053317/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 Mon Apr 29 07:50:56 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+67049+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+67049+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589880; cv=none; d=zohomail.com; s=zohoarc; b=QJzJS0inGfgt3jCkd6/zw5tJqItNaRjkMCZ3F29CjLXJnIxzYXlQaaEf9n/xOD0XP7gquiu0KZdF/IRFCBfQrGQDk5RRZAZhoRbF0W1x9Ru2xnqsvLcgEUx/YA9BvBh3TnIBrxMBkcVf0GLfikdy8RK6jjLD8B4XgUbqk1sftR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589880; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=oL7jklpqNhT+fJwt0CVYMoUNyiB4z+XlspfcfG2itzo=; b=ZQ8Gq8thGUe6vjl8DJcssvv54bOykXhTJhEOd4GXLZNMfrmm6btOqpK3gZOaGc3krbIQ6aIR9hNZuYHkA1tg6ExiIrP1eWp08rePrz7j09cbrtRwxFfTgkaG0pWIaD08bEGURHQ7sVBEhoNHyhYg3SPV2Oj/UQ5pIvPbwGE3/rY= 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+67049+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604589880529583.5925448613076; Thu, 5 Nov 2020 07:24:40 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id kDBAYY1788612xvyKoSOost6; Thu, 05 Nov 2020 07:24:40 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.8969.1604589879247613797 for ; Thu, 05 Nov 2020 07:24:39 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FI6Ac008592; Thu, 5 Nov 2020 15:24:38 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0a-002e3701.pphosted.com with ESMTP id 34kr4td018-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 15:24:38 +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 AC5AE92; Thu, 5 Nov 2020 15:24:37 +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 4273148; Thu, 5 Nov 2020 15:24:36 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 5/6] EmulatorPkg: Add allowable dependency Date: Thu, 5 Nov 2020 22:38:52 +0800 Message-Id: <20201105143853.2180-6-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: plfNO0lq2IcaM8HhHDbYu9clx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589880; bh=1jBYlbT0A3aJSeHLP6dzVsmjGaljldXrHPlDRMoB4nc=; h=Cc:Date:From:Reply-To:Subject:To; b=kCKnwF1uUr6F5+pXl/1AXY7+4jKDoOd85vwdWo4UkbuWbb5oqEQIEbAduPyiw433TsK qjQ/JM9IDS9hxTLLZrol0P5krVKvbBugTmxEzVy8ydJvpiAZmNuKBI2ToS8GfRE3x0sEB HTtRfQOVVcP7ALLdJyGh2xRtznw+fsm4rSE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add RedfishPkg to DependencyCheck section in yaml file. Signed-off-by: Abner Chang Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Cc: Nickle Wang Cc: Peter O'Hanley --- EmulatorPkg/EmulatorPkg.ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/EmulatorPkg/EmulatorPkg.ci.yaml b/EmulatorPkg/EmulatorPkg.ci.y= aml index 980844c1fd..97fdef17ab 100644 --- a/EmulatorPkg/EmulatorPkg.ci.yaml +++ b/EmulatorPkg/EmulatorPkg.ci.yaml @@ -47,6 +47,7 @@ "MdeModulePkg/MdeModulePkg.dec", "EmulatorPkg/EmulatorPkg.dec", "NetworkPkg/NetworkPkg.dec", + "RedfishPkg/RedfishPkg.dec", "EmbeddedPkg/EmbeddedPkg.dec", ## is this one OK?? ], # For host based unit tests --=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 (#67049): https://edk2.groups.io/g/devel/message/67049 Mute This Topic: https://groups.io/mt/78053319/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 Mon Apr 29 07:50:56 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+67050+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+67050+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604589882; cv=none; d=zohomail.com; s=zohoarc; b=ld9XHVSgW/ewVYVKiUptlY6x//+22jdbxVdqbWhslqRWJxULwoOCaab0hvD1OxaZZOX0B8XcYrvimPTbOZuiZykUpsArPXhiekEc5CUJ6Ur/PNZ/Mquf6QthjwCL+QbPNAhK9/WzRLRVYz6XSPZA///11Kh4Dix5M19pllL3zVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604589882; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ixbEOjvl/5b0DaUuM39riFss/mec5tGDbGflkrL+u5g=; b=Z1iT+7ebY2VCu4n8wcVKm51M0Jd/wLSAE6OEgT45ixfrrhSV1mGEKleMv9EQpwo3SaJCPa7l2OrzlndL6h018x1epISdGCnxSpFliaFa5BDJoqgD7gNHuhLQVDKOBNkyluWCjXpZCOHlQ6NwBPCauXzOj3g+MwwEh6q3EhOjepo= 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+67050+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604589882850969.1890439759486; Thu, 5 Nov 2020 07:24:42 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4otpYY1788612xOZrdIvJfKZ; Thu, 05 Nov 2020 07:24:42 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.9181.1604589882088078375 for ; Thu, 05 Nov 2020 07:24:42 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A5FI7GJ008661; Thu, 5 Nov 2020 15:24:40 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0a-002e3701.pphosted.com with ESMTP id 34kr4td01k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Nov 2020 15:24:40 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 6B6B451; Thu, 5 Nov 2020 15:24:39 +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 0921148; Thu, 5 Nov 2020 15:24:37 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Nickle Wang , Peter O'Hanley Subject: [edk2-devel] [Platform Redfish Host Interface PATCH 6/6] EmulatorPkg: Redfish related changes on EmulatorPkg Date: Thu, 5 Nov 2020 22:38:53 +0800 Message-Id: <20201105143853.2180-7-abner.chang@hpe.com> In-Reply-To: <20201105143853.2180-1-abner.chang@hpe.com> References: <20201105143853.2180-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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: qvsu8cBZQn5qk9a2aVCToTt1x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604589882; bh=G+1hBXf7VANZLLVnz2++Mi9IeRM8NEroc5Sv2Srb5Zs=; h=Cc:Date:From:Reply-To:Subject:To; b=ki58MsU/kMBJk8IdIxqkWCz5gDpCz5YZR/4Rrf+Ziv2t3Z04NDjqKexDSXveRcie50O ZwwtrGtLVJYentVPL5ERvgE3M8IgdGokjE8iZfpR2wu+4rbuCIDqaygfEgqKcom9AbIkJ vfTxpYkdfiD+Ye+703Z3iPg7X0iWrrHNduk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" - REDFISH_ENABLE definition to control EFI Redfish support - Add Redfish platform host interface library to EmulatorPkg build. - Set RestExServiceDevicePath PCD value. - Add Redfish host interface config EFI application to EmulatorPkg build. - Use Redfish DSC/FDF include file. Signed-off-by: Abner Chang Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Cc: Nickle Wang Cc: Peter O'Hanley --- EmulatorPkg/EmulatorPkg.dsc | 26 +++++++++++++++++++++++++- EmulatorPkg/EmulatorPkg.fdf | 5 +++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index a27cb1beb0..aa5504c137 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -34,6 +34,11 @@ DEFINE NETWORK_ISCSI_ENABLE =3D FALSE DEFINE SECURE_BOOT_ENABLE =3D FALSE =20 + # + # Redfish definition + # + DEFINE REDFISH_ENABLE =3D FALSE + [SkuIds] 0|DEFAULT =20 @@ -95,7 +100,9 @@ # PlatformBootManagerLib|EmulatorPkg/Library/PlatformBmLib/PlatformBmLib.i= nf KeyMapLib|EmulatorPkg/Library/KeyMapLibNull/KeyMapLibNull.inf - + !if $(REDFISH_ENABLE) =3D=3D TRUE + RedfishPlatformHostInterfaceLib|EmulatorPkg/Library/RedfishPlatformHos= tInterfaceLib/RedfishPlatformHostInterfaceLib.inf + !endif # # Misc # @@ -249,6 +256,18 @@ # 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1 =20 +!if $(REDFISH_ENABLE) =3D=3D TRUE + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePat= hMatchMode|DEVICE_PATH_MATCH_MAC_NODE + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePat= hNum|1 + # + # Below is the MAC address of network adapter on EDK2 Emulator platform. + # You can use ifconfig under EFI shell to get the MAC address of network= adapter on EDK2 Emulator platform. + # + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePat= h|{DEVICE_PATH("MAC(000000000000,0x1)")} + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|Fal= se + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False +!endif + [PcdsDynamicDefault.common.DEFAULT] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0 @@ -447,6 +466,11 @@ =20 !include NetworkPkg/Network.dsc.inc =20 +!if $(REDFISH_ENABLE) =3D=3D TRUE + EmulatorPkg/Application/RedfishPlatformConfig/RedfishPlatformConfig.inf +!endif +!include RedfishPkg/Redfish.dsc.inc + [BuildOptions] # # Disable deprecated APIs. diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf index b256aa9397..5420756eaa 100644 --- a/EmulatorPkg/EmulatorPkg.fdf +++ b/EmulatorPkg/EmulatorPkg.fdf @@ -208,6 +208,11 @@ INF EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf !endif !include NetworkPkg/Network.fdf.inc =20 +# +# EFI Redfish drivers +# +!include RedfishPkg/Redfish.fdf.inc + INF FatPkg/EnhancedFatDxe/Fat.inf =20 !if "XCODE5" not in $(TOOL_CHAIN_TAG) --=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 (#67050): https://edk2.groups.io/g/devel/message/67050 Mute This Topic: https://groups.io/mt/78053322/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-