From nobody Sat Apr 20 09:50:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66155+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66155+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1602564766; cv=none; d=zohomail.com; s=zohoarc; b=VFn0lwq0BZvoxsyF16MEIGO0TkDow5aqe8vc6Q97vu+8jE7dTdNlcioo6WnWQCumfAPxt6CGY/+RmiNnVx9fO+kbtpxARQ2XlHpT7D7NKV9o9wByl3z2DU2mjXFEw7RfRR/ZYgu8kBW3z/Z1ZpDm/ARKkUDSyzf6fvGza7uhiuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602564766; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=zEFnBaIuCKrEFT+ymTCpq/p+B6Rbg6PrI8c4Ft2tomo=; b=dyLO80MXffMYfEl6MP+B19+G7Mc21a71ROvYCQt9/lW/EJ/q2Qld4IQDP7clJHb6OaTdHQiQx30UvaPm85tgyVaR2Dv2/HQE0NoUDLvGTyJH2+I6jMq+lFSUSQXItTkGWUfW9U/vJNwq6+3G85Czh1+v9YCLz8zf2fnVpozO2DQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66155+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1602564766191283.4459685985929; Mon, 12 Oct 2020 21:52:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id OR0UYY1788612x0mPNF3ShHd; Mon, 12 Oct 2020 21:52:45 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.4793.1602564764960523294 for ; Mon, 12 Oct 2020 21:52:45 -0700 X-Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09D4nPLf007515; Tue, 13 Oct 2020 04:52:44 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 343avatu7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 04:52:44 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 8E73D55; Tue, 13 Oct 2020 04:52:43 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 2CBEC46; Tue, 13 Oct 2020 04:52:42 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Date: Tue, 13 Oct 2020 12:08:01 +0800 Message-Id: <20201013040805.20523-2-abner.chang@hpe.com> In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com> References: <20201013040805.20523-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: m2bKL2igfy0eooYmqUq7dGbLx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1602564765; bh=9dysjpv8CoFVWKRW6HoLxJwuHz5gFG7xsaDSLkcpyN8=; h=Cc:Date:From:Reply-To:Subject:To; b=nIYQDWN5qLuEDQADetzw1y2vpeZLetV0nZSuFrQxWq4LQCf6jH1KC9Fw88Pi0KlPELF wf9nhWv+3SXZHCcSbKf1IeIUeFccuFKSmlbZc4oI3+sGCsSY3gXbjtECYDN5EHOmBzn7Z X7H1fm04g0mA1ufrcgQPkBU/nhva4tOdQB8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add definitions of SMBIOS Type 42 Host Interface. Signed-off-by: Jiaxin Wu Signed-off-by: Siyuan Fu Signed-off-by: Fan Wang Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Reviewed-by: Nickle Wang --- .../IndustryStandard/RedfishHostInterface.h | 165 ++++++++++++++++++ RedfishPkg/RedfishPkg.dec | 3 + 2 files changed, 168 insertions(+) create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterfac= e.h diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/R= edfishPkg/Include/IndustryStandard/RedfishHostInterface.h new file mode 100644 index 0000000000..981f8a0cfb --- /dev/null +++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h @@ -0,0 +1,165 @@ +/** @file + This file defines the Redfish Interface Specific Data. + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef REDFISH_HOST_INTERFACE_ +#define REDFISH_HOST_INTERFACE_ + +#include + +#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB 0x02 // We don't su= pport this type of interface. + // Use REDFISH= _HOST_INTERFACE_DEVICE_TYPE_USB_V2 instead. +#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE 0x03 // We don't su= pport this type of interface. + // Use REDFISH= _HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 instead. +#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 0x04 +#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 0x05 + +#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_UNKNOWN = 0x00 +#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_STATIC = 0x01 +#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_DHCP = 0x02 +#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_AUTO_CONFIGURE = 0x03 +#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_HOST_SELECTED = 0x04 + +#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN 0x00 +#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4 0x01 +#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6 0x02 + +#pragma pack(1) +/// +/// Structure definitions of Host Interface device type 04h (USB Network I= nterface V2) +/// +typedef struct { + UINT8 Length; ///< Length of the structure, i= ncluding Device Type + ///< and Length fields. + UINT16 IdVendor; ///< The Vendor ID of the devic= e, as read from the + ///< idVendor field of the USB = descriptor. + UINT16 IdProduct; ///< The Product ID of the devi= ce, as read from the + ///< idProduct field of the USB= descriptor. + UINT8 SecialNumberStr; ///< The string number for the = Serial Number of the + ///< device. The string data is= read from the + ///< iSerialNumber.bDescriptorT= ype field of the USB + ///< descriptor, and is convert= ed from Unicode to ASCII + ///< and is NULL terminated. + UINT8 MacAddress [6]; ///< The MAC address of the PCI= /PCIe network device. +} USB_INTERFACE_DEVICE_DESCRIPTOR_V2; + +// +// Structure definitions of Host Interface device type 05h (PCI/PCIE V2) +// +typedef struct { + UINT8 Length; ///< Length of the structu= re, including Device Type and Length fields. + UINT16 VendorId; ///< The Vendor ID of the = PCI/PCIe device. + UINT16 DeviceId; ///< The Device ID of the = PCI/PCIe device. + UINT16 SubsystemVendorId; ///< The Subsystem Vendor = ID of the PCI/PCIe device. + UINT16 SubsystemId; ///< The Subsystem ID of t= he PCI/PCIe device. + UINT8 MacAddress [6]; ///< The MAC address of th= e PCI/PCIe network device. + UINT16 SegmemtGroupNumber; ///< The Segment Group Num= ber of the PCI/PCIe. + UINT8 BusNumber; ///< The Bus Number of the= PCI/PCIe device. + UINT8 DeviceFunctionNumber; ///< The Device/Function N= umber of the PCI/PCIe. +} PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2; + +/// +/// Structure definitions of Host Interface device type 80-FFh (OEM) +/// +typedef struct { + UINT32 VendorIana; ///< The IANA code for the = vendor (MSB first). + UINT8 OemDefinedData[1]; ///< OEM defined data. +} OEM_DEVICE_DESCRIPTOR; + +/// +/// Interface Specific Data starts at offset 06h of the SMBIOS Type 42 st= ruct. +/// This table defines the Interface Specific data for Interface Type 40h= . There +/// are 3 types of Device Descriptor3 defined , however only 1 may be use= d in +/// specific Tape 42 table. +/// +typedef struct { + UINT8 DeviceType; ///< The Device Type of the interface. + union { + USB_INTERFACE_DEVICE_DESCRIPTOR_V2 UsbDeviceV2; ///< Devi= ce type USB V2 device discriptor. + PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2 PciPcieDeviceV2; ///< Devi= ce type PCI/PCIe V2 device discriptor. + OEM_DEVICE_DESCRIPTOR OemDevice; ///< OEM = type device discriptor. + } DeviceDescriptor; /// Device descriptor data formated based on Device = Type. + +} REDFISH_INTERFACE_DATA; + +// +// the protocol-specific data for the "Redfish Over IP" protocol +// +typedef struct { + EFI_GUID ServiceUuid; //same as Redfish Service UUID in Redf= ish Service Root resource + + // + // Unknown=3D00h, + // Static=3D01h, + // DHCP=3D02h, + // AutoConfigure=3D03h, + // HostSelected=3D04h, + // other values reserved + // + UINT8 HostIpAssignmentType; + + // + // Unknown=3D00h, + // Ipv4=3D01h, + // Ipv6=3D02h, + // other values reserved + // + UINT8 HostIpAddressFormat; + + // + // Used for Static and AutoConfigure. + // For IPV4, use the first 4 Bytes and zero fill the remaining bytes. + // + UINT8 HostIpAddress[16]; + + // + // Used for Static and AutoConfigure. + // For IPV4, use the first 4 Bytes and zero fill the remaining bytes. + // + UINT8 HostIpMask[16]; + + // + // Unknown=3D00h, + // Static=3D01h, + // DHCP=3D02h, + // AutoConfigure=3D03h, + // HostSelected=3D04h, + // other values reserved + // + UINT8 RedfishServiceIpDiscoveryType; + + // + // Unknown=3D00h, + // Ipv4=3D01h, + // Ipv6=3D02h, + // other values reserved + // + UINT8 RedfishServiceIpAddressFormat; + + // + // Used for Static and AutoConfigure. + // For IPV4, use the first 4 Bytes and zero fill the remaining bytes. + // + UINT8 RedfishServiceIpAddress[16]; + + // + // Used for Static and AutoConfigure. + // For IPV4, use the first 4 Bytes and zero fill the remaining bytes. + // + UINT8 RedfishServiceIpMask[16]; + + UINT16 RedfishServiceIpPort; // Used for Static and AutoCo= nfigure. + UINT32 RedfishServiceVlanId; // Used for Static and AutoCo= nfigure. + UINT8 RedfishServiceHostnameLength; // length of the fol= lowing hostname string + UINT8 RedfishServiceHostname[1]; // hostname of Redfish S= ervice +} REDFISH_OVER_IP_PROTOCOL_DATA; + +#pragma pack() + +#endif + diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index e95ec5fe10..de3611252e 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -13,6 +13,9 @@ PACKAGE_GUID =3D c432b76e-5232-11e7-9010-005056c00008 PACKAGE_VERSION =3D 1.0 =20 +[Includes] + Include + [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 --=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 (#66155): https://edk2.groups.io/g/devel/message/66155 Mute This Topic: https://groups.io/mt/77477501/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 Sat Apr 20 09:50:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66156+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66156+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1602564767; cv=none; d=zohomail.com; s=zohoarc; b=D/nqQxul1QqqrDMXrsaNpIDBz2dS2wOGpyVuQDUg21Dj29Cv/vEeaWIwGUy3zaSYxm2LM74SkM3lXmcnJUfJQMMHo92Y9zuT5yJhADFvLFjmmIOdtk8k0p7c3xQGkN8VGmTDpAs9ooAJhkwbLettVvGMoRugG36cgP4q+Nd5rz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602564767; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ANQNPJyKsKVXKCrzSTzUFeu3tSjvktlaD76D1+9Hrg0=; b=MjrGy6VEJ/j4l5pEP09I8rWryXVAOObaH7/KsYvUnzrxU8CP5AfYrNWW/42a9TRFPQvZGeB76rVkUfojiPKdX3tmxg8GOFMbuP1R6+3CUWLgNt6t+hfaaHmN7cfplgR/rPIqJSsTDgsipQKEtTXrbC6MXojk883zHuCancuaBf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66156+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1602564767594474.5546872397989; Mon, 12 Oct 2020 21:52:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ezFOYY1788612xAfq04Mft24; Mon, 12 Oct 2020 21:52:47 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.4794.1602564766632036116 for ; Mon, 12 Oct 2020 21:52:46 -0700 X-Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09D4krCa016170; Tue, 13 Oct 2020 04:52:46 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 344e3btvdq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 04:52:45 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 41B835B; Tue, 13 Oct 2020 04:52:45 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id D762045; Tue, 13 Oct 2020 04:52:43 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [EFI Redfish Host Interface PATCH 2/5] RedfishPkg/Include: PlatformHostInterfaceLib header file Date: Tue, 13 Oct 2020 12:08:02 +0800 Message-Id: <20201013040805.20523-3-abner.chang@hpe.com> In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com> References: <20201013040805.20523-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: ZUnbP6SUf0GAJ1tJQ59oFlmSx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1602564767; bh=Kv53fItkj9/oYzHRQLh96pOscZQSh77rghVDqBDD3Nk=; h=Cc:Date:From:Reply-To:Subject:To; b=RiyeEQhWfyCR2PDqvimvnM9v/e7PhTx4mrEik4F8IhRcn4ul3nZ2oq8LSFC/uADm48Y MJGA+3u7ufhvQogSv96DXCm/eX+1DqYsGdV5UcKEesnYugdJjXZ9VL2ErMggz+oQtWyNX f+c2o1RUW8LOr5xM8pKRp5BVTRiWu6dpMzE= 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: Jiewen Yao Cc: Nickle Wang --- .../Include/Library/RedfishHostInterfaceLib.h | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 RedfishPkg/Include/Library/RedfishHostInterfaceLib.h diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/Redfish= Pkg/Include/Library/RedfishHostInterfaceLib.h new file mode 100644 index 0000000000..870109e09a --- /dev/null +++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h @@ -0,0 +1,52 @@ +/** @file + Definitinos of RedfishHostInterfaceDxe driver. + + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef REDFISH_HOST_INTERFACE_LIB_H_ +#define REDFISH_HOST_INTERFACE_LIB_H_ + +#include +#include +#include + +#include + +/** + 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 ( + IN UINT8 *DeviceType, + IN REDFISH_INTERFACE_DATA **DeviceDescriptor +); +/** + 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[in, out] ProtocolRecord Pointer to retrieve the first or the nex= t protocol record. + caller has to free the new protocol reco= rd returned from + this function using FreePool(). + param[in] IndexOfProtocolData The index of protocol data. + + @retval EFI_SUCESS Protocol records are all returned. + @retval EFI_NOT_FOUND No more protocol records. + @retval Others Fail to get protocol records. +**/ +EFI_STATUS +RedfishPlatformHostInterfaceProtocolData ( + IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord, + IN UINT8 IndexOfProtocolData +); +#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 (#66156): https://edk2.groups.io/g/devel/message/66156 Mute This Topic: https://groups.io/mt/77477503/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 Sat Apr 20 09:50:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66157+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66157+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1602564774; cv=none; d=zohomail.com; s=zohoarc; b=fui2RqHAFa+1NR8UL0f1Ijq9qJREnydOjFtbhPZpTgR1osrqsNPHrkABxZ0qzSY3Gfe0+5k8HTl18UVeyHXeiLn75w757bmsPKZF1g6y3SkJp+fQPRmyAPBUJmtSOBTzP0lYqvB5UGTRlPFcN5VAWBJe4CBsLh3SDWbtoXIYeR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602564774; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=kcWJQr6PmDqhiIXAN1Qqsgy8RsiqLLFTr0wRYXpHaFQ=; b=bhuW9pdOvVi1LFqU6eDycjqUiXGXAZN9izEvxFDkA3Yz2H6nDY1DxgpgseDEgj9xB4SyDwyEAoM8T083ODDZNW3S1KQ6YCsnst9ratkKUznuI4SdgCtzdDdhIGkUX3mw2PkEdu6VNYOyfAFiEw88kaIFpPnsdyc6nau2Sd2ZwZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66157+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1602564774068153.20077865755025; Mon, 12 Oct 2020 21:52:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ji5aYY1788612xMYo2RlwGVF; Mon, 12 Oct 2020 21:52:53 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.4807.1602564768124363871 for ; Mon, 12 Oct 2020 21:52:48 -0700 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 09D4hSnR016329; Tue, 13 Oct 2020 04:52:47 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 343fq0a0cv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 04:52:47 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 0523C92; Tue, 13 Oct 2020 04:52:46 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 8F24F46; Tue, 13 Oct 2020 04:52:45 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Date: Tue, 13 Oct 2020 12:08:03 +0800 Message-Id: <20201013040805.20523-4-abner.chang@hpe.com> In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com> References: <20201013040805.20523-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: MPsUsXPhLWTFbTNILRgksjckx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1602564773; bh=y1sIMTvOBsY7xH32lFARGs4Y5tKAyXu1xNyi7bkkgT8=; h=Cc:Date:From:Reply-To:Subject:To; b=wRDHx2NVpnsoq11aeEAmqGknS61B5PghPYlkU93uknXVOh/94jo4rpJpvZERPNDpTgU 0bHhxhuZ7A4AJOt5vgO9KU/Fn8a2OHMMEDounkl3edIwT2V+wB0+gIKJw6RyeIv+KRXqL 80nCja2qEAGpJtoI3S+rtsAp87LH9hJFy4o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" NULL instance of PlatformHostInterfaceLib. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang --- .../PlatformHostInterfaceLibNull.c | 53 +++++++++++++++++++ .../PlatformHostInterfaceLibNull.inf | 34 ++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/Platfor= mHostInterfaceLibNull.c create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/Platfor= mHostInterfaceLibNull.inf diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostIn= terfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/Platform= HostInterfaceLibNull.c new file mode 100644 index 0000000000..7653f22d25 --- /dev/null +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterface= LibNull.c @@ -0,0 +1,53 @@ +/** @file + NULL instace of RedfishPlatformHostInterfaceLib + + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#include +#include +#include +#include + +/** + 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 ( + IN UINT8 *DeviceType, + IN REDFISH_INTERFACE_DATA **DeviceDescriptor +) +{ + return EFI_NOT_FOUND; +} +/** + 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[in, out] ProtocolRecord Pointer to retrieve the first or the nex= t protocol record. + caller has to free the new protocol reco= rd returned from + this function using FreePool(). + param[in] IndexOfProtocolData The index of protocol data. + + @retval EFI_SUCESS Protocol records are all returned. + @retval EFI_NOT_FOUND No more protocol records. + @retval Others Fail to get protocol records. +**/ +EFI_STATUS +RedfishPlatformHostInterfaceProtocolData ( + IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord, + IN UINT8 IndexOfProtocolData +) +{ + return EFI_NOT_FOUND; +} diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostIn= terfaceLibNull.inf b/RedfishPkg/Library/PlatformHostInterfaceLibNull/Platfo= rmHostInterfaceLibNull.inf new file mode 100644 index 0000000000..bb840ce3cb --- /dev/null +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterface= LibNull.inf @@ -0,0 +1,34 @@ +## @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 RedfishPlatformHostInterfaceLibNull + FILE_GUID =3D 851229BF-4D8B-30F3-DD0D-20AFAF99A77B + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RedfishPlatformHostInterfaceLib + +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 +# + +[Sources] + PlatformHostInterfaceLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + +[LibraryClasses] + UefiLib + BaseLib + DebugLib + --=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 (#66157): https://edk2.groups.io/g/devel/message/66157 Mute This Topic: https://groups.io/mt/77477504/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 Sat Apr 20 09:50:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66159+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66159+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1602564807; cv=none; d=zohomail.com; s=zohoarc; b=Wn7akPXi0kElU62+dUreM0ukW4oF2uIFM8CUn4j7qaurRmc6ja3WBMcDHQpQXMfSD1TYdarEC89a10wMw5kgbHpLGitUCjFNtytwowg3nE4c/8Vi8uZFNqjV2544PX8gdZmUCfbLLOhstpjIpuMiP0glxc1gk1dUMG63lPd33O4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602564807; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=Lsfen0CuFA6UDXi3t7StSudbti2coHhosqrJWcCrpUQ=; b=TOniuV5Rq0A16a8QL5kdIEHyzFobskLSvaWtDALZ8pf7F4rWMcd9nLjodsD0NRQ6HutuB0ukjI9PqMdpR8roNta+hBxaedipY+SEGOljxco8lK4SZ7M1sPyMEwTqKmcMlgMnG3XpY/lXywXRqYMItuOXO75KbJGjD+Fj2h6Oh3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66159+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1602564807248598.8212454809616; Mon, 12 Oct 2020 21:53:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pxK0YY1788612xaLacaIYv1S; Mon, 12 Oct 2020 21:53:26 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.4804.1602564805283850685 for ; Mon, 12 Oct 2020 21:53:25 -0700 X-Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09D4rOqN015429; Tue, 13 Oct 2020 04:53:24 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 343avatu86-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 04:53:24 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id A3A4C5E; Tue, 13 Oct 2020 04:52:48 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 4873445; Tue, 13 Oct 2020 04:52:47 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Date: Tue, 13 Oct 2020 12:08:04 +0800 Message-Id: <20201013040805.20523-5-abner.chang@hpe.com> In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com> References: <20201013040805.20523-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: VfprABmbnDADdYvnSHw2d0WSx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1602564806; bh=PPwydnlwzpFvHGdXWvOTkDzJo90h7HrRX/2KCdjfGO0=; h=Cc:Date:From:Reply-To:Subject:To; b=TEsAQOH9dvlPb8amyQWICgX9s8aXii8lfgmlYEP8D0oxnKCgkB0FYKssTQ1R67RiOK5 RFV8o0VVl858AQP5rbVBZB6XaNseHetX+7rQkYByq1rPP3JvVOLVQKbLTyHb/Sp9xVLCW SWgIlsHZo6385dpoW+KeaFa6vvffD2cmJWQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is the abstract driver to consume the contents of SMBIOS type 42h device descriptor and protocol type data which provided by PlatformHostInterfaceLib, and create SMBIOS type 42 record through EFI SMBIOS protocol. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Reviewed-by: Nickle Wang --- .../RedfishHostInterfaceDxe.c | 243 ++++++++++++++++++ .../RedfishHostInterfaceDxe.inf | 50 ++++ 2 files changed, 293 insertions(+) create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterface= Dxe.c create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterface= Dxe.inf diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b= /RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c new file mode 100644 index 0000000000..ec7faefed7 --- /dev/null +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c @@ -0,0 +1,243 @@ +/** @file + RedfishHostInterfaceDxe builds up SMBIOS Type 42h host interface + record for Redfish service host interface using EFI MBIOS Protocol. + RedfishHostInterfacePlatformLib is the platform-level library which + provides the content of Redfish host interface type 42h record. + + 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 + +/** + Create SMBIOS type 42 record for Redfish host interface. + + @retval EFI_SUCESS SMBIOS type 42 record is created. + @retval Others Fail to create SMBIOS 42 record. + +**/ +EFI_STATUS +RedfishCreateSmbiosTable42 ( + VOID + ) +{ + REDFISH_INTERFACE_DATA *DeviceDescriptor; + UINT8 DeviceDataLength; + UINT8 DeviceType; + EFI_STATUS Status; + MC_HOST_INTERFACE_PROTOCOL_RECORD *ProtocolRecord; + VOID *ProtocolRecords; + VOID *NewProtocolRecords; + UINT8 ProtocolCount; + UINT8 CurrentProtocolsDataLength; + UINT8 NewProtocolsDataLength; + UINT8 ProtocolDataSize; + SMBIOS_TABLE_TYPE42 *Type42Record; + EFI_SMBIOS_PROTOCOL *Smbios; + EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle; + + // + // Get platform Redfish host interface device type descriptor data. + // + Status =3D RedfishPlatformHostInterfaceDeviceDescriptor (&DeviceType, &D= eviceDescriptor); + if (EFI_ERROR (Status)) { + if (Status =3D=3D EFI_NOT_FOUND) { + DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is pr= ovided on this platform.", __FUNCTION__)); + return EFI_NOT_FOUND; + } + DEBUG((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.", __FUNCTI= ON__, Status)); + return Status; + } + if (DeviceType !=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 && + DeviceType !=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 + ) { + DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h= as Redfish host interface.", __FUNCTION__)); + return EFI_UNSUPPORTED; + } + if (DeviceType =3D=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) { + DeviceDataLength =3D DeviceDescriptor->DeviceDescriptor.PciPcieDeviceV= 2.Length; + } else { + DeviceDataLength =3D DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.Le= ngth; + } + // + // Loop to get platform Redfish host interface protocol type data. + // + ProtocolRecord =3D NULL; + ProtocolRecords =3D NULL; + NewProtocolRecords =3D NULL; + Type42Record =3D NULL; + ProtocolCount =3D 0; + CurrentProtocolsDataLength =3D 0; + NewProtocolsDataLength =3D 0; + while (TRUE) { + Status =3D RedfishPlatformHostInterfaceProtocolData (&ProtocolRecord, = ProtocolCount); + if (Status =3D=3D EFI_NOT_FOUND) { + break; + } + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protoco= l type data.", __FUNCTION__)); + if (ProtocolRecords !=3D NULL) { + FreePool (ProtocolRecords); + } + if (ProtocolRecord !=3D NULL) { + FreePool (ProtocolRecord); + } + return Status; + } + ProtocolDataSize =3D sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) - size= of(ProtocolRecord->ProtocolTypeData) + ProtocolRecord->ProtocolTypeDataLen; + NewProtocolsDataLength +=3D ProtocolDataSize; + if (ProtocolRecords =3D=3D NULL) { + ProtocolRecords =3D AllocateZeroPool (NewProtocolsDataLength); + if (ProtocolRecords =3D=3D NULL) { + FreePool (ProtocolRecord); + return EFI_OUT_OF_RESOURCES; + } + CopyMem ((VOID *)ProtocolRecords, (VOID *)ProtocolRecord, ProtocolDa= taSize); + NewProtocolRecords =3D ProtocolRecords; + } else { + NewProtocolRecords =3D ReallocatePool(CurrentProtocolsDataLength, Ne= wProtocolsDataLength, (VOID *)ProtocolRecords); + if (NewProtocolRecords =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host= interface protocol data.")); + FreePool (ProtocolRecords); + FreePool (ProtocolRecord); + return EFI_OUT_OF_RESOURCES; + } + CopyMem ( + (VOID *)((UINT8 *)NewProtocolRecords + CurrentProtocolsDataLength), + (VOID *)ProtocolRecord, + ProtocolDataSize + ); + } + FreePool (ProtocolRecord); + CurrentProtocolsDataLength =3D NewProtocolsDataLength; + ProtocolCount ++; + }; + if (ProtocolCount =3D=3D 0) { + goto ON_EXIT; + } + // + // Construct SMBIOS Type 42h for Redfish host inteface. + // + // SMBIOS type 42 Record for Redfish Interface + // 00h Type BYTE 42 Management Controller Host Interface structure indic= ator + // 01h Length BYTE Varies Length of the structure, a minimum of 09h + // 02h Handle WORD Varies + // 04h Interface Type BYTE Varies Management Controller Interface Type. + // 05h Interface Specific Data Length (n) + // 06h Interface Specific data + // 06h+n number of protocols defined for the host interface (typically 1) + // 07h+n Include a Protocol Record for each protocol supported. + // + Type42Record =3D (SMBIOS_TABLE_TYPE42 *) AllocateZeroPool ( + sizeof (SMBIOS_TABLE_TYPE42) - 4 + + DeviceDataLength + + 1 /// For Protocol Record Cou= nt + + CurrentProtocolsDataLength + + 2 /// Double NULL terminator/ + ); + if (Type42Record =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto ON_EXIT; + } + + Type42Record->Hdr.Type =3D EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_= INTERFACE; + Type42Record->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE42) - 4 + + DeviceDataLength + + 1 + + CurrentProtocolsDataLength; + Type42Record->Hdr.Handle =3D 0; + Type42Record->InterfaceType =3D MCHostInterfaceTypeNetworkHostInterface;= // Network Host Interface + + // + // Fill in InterfaceTypeSpecificDataLength field + // + Type42Record->InterfaceTypeSpecificDataLength =3D DeviceDataLength; + + // + // Fill in InterfaceTypeSpecificData field + // + CopyMem (Type42Record->InterfaceTypeSpecificData, DeviceDescriptor, Devi= ceDataLength); + FreePool (DeviceDescriptor); + DeviceDescriptor =3D NULL; + + // + // Fill in InterfaceTypeSpecificData Protocol Count field + // + *(Type42Record->InterfaceTypeSpecificData + DeviceDataLength) =3D Protoc= olCount; + + // + // Fill in Redfish Protocol Data + // + CopyMem ( + Type42Record->InterfaceTypeSpecificData + DeviceDataLength + 1, + NewProtocolRecords, + CurrentProtocolsDataLength + ); + + // + // 5. Add Redfish interface data record to SMBIOS table 42 + // + Status =3D gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&= Smbios); + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + + MemArrayMappedAddrSmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; + Status =3D Smbios->Add ( + Smbios, + NULL, + &MemArrayMappedAddrSmbiosHandle, + (EFI_SMBIOS_TABLE_HEADER*) Type42Record + ); + DEBUG ((DEBUG_INFO, "RedfishPlatformDxe: Smbios->Add() - %r\n", Status)); + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + Status =3D EFI_SUCCESS; + +ON_EXIT: + if (DeviceDescriptor !=3D NULL) { + FreePool (DeviceDescriptor); + } + if (NewProtocolRecords !=3D NULL) { + FreePool (NewProtocolRecords); + } + if (Type42Record !=3D NULL) { + FreePool (Type42Record); + } + return Status; +} + +/** + 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 +RedfishHostInterfaceDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + // + // Create SMBIOS type 42 record. + // + return RedfishCreateSmbiosTable42 (); +} diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf= b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf new file mode 100644 index 0000000000..6c1f60bca5 --- /dev/null +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf @@ -0,0 +1,50 @@ +## @file +# RedfishHostInterfaceDxe builds up SMBIOS Type 42h host interface +# record for Redfish service host interface using SMBIOS Protocol. +# RedfishHostInterfacePlatformLib is the platform-level library which +# provides the content of Redfish host interface type 42h record. +# +# 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 RedfishHostInterfaceDxe + FILE_GUID =3D 592626DA-4A1E-8B39-28BA-FEAD92C4A0A4 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D RedfishHostInterfaceDxeEntryPoint + +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 RISCV64 +# + +[Sources] + RedfishHostInterfaceDxe.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + PrintLib + RedfishPlatformHostInterfaceLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Protocols] + gEfiSmbiosProtocolGuid ## TO_START + +[Depex] + gEfiSmbiosProtocolGuid + --=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 (#66159): https://edk2.groups.io/g/devel/message/66159 Mute This Topic: https://groups.io/mt/77477512/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 Sat Apr 20 09:50:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66158+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66158+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1602564772; cv=none; d=zohomail.com; s=zohoarc; b=hK2bjBRbKKcb276o/S8Zl531Iffvz22G/ccwsEwKMY8Za/7HU55UuS1+HqSGJTU+iM1uzTKfl6b7/wTJ3FmJhKCjXqc4QCeMegb4OrgBZ8CgO6k1G3ZUioEP+fvIHd1lFn1ayHF8KYM9kvz71ahUhPw/V1smIyjx0CQ6WUebOEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602564772; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=SX5kLEcyyIPh3DYBPyyZtt2tzC8k2B0rBZClzso6DCQ=; b=baffMBaY68PUTmOL5YRtxSG50dzk9fdmKeg1tO+fOdMGBxyVyhX4lTmIpXlGk5sTMw4z0uCjthrlsOfLZDsRKj1rWuOXfjfVBCCUDcDYnp5LuFXYpymO7miWqQBI/QQTVG/vW++AoktG584I+m6OYR6XaeWAkRy2xkw3YvO6RQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66158+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1602564772710732.9274592627341; Mon, 12 Oct 2020 21:52:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zUdsYY1788612xsJkuRihsQA; Mon, 12 Oct 2020 21:52:52 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.4755.1602564771773733941 for ; Mon, 12 Oct 2020 21:52:51 -0700 X-Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09D4o9BX025795; Tue, 13 Oct 2020 04:52:51 GMT X-Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 343d7qtbkc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 04:52:51 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 63DD16B; Tue, 13 Oct 2020 04:52:50 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id F236945; Tue, 13 Oct 2020 04:52:48 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Date: Tue, 13 Oct 2020 12:08:05 +0800 Message-Id: <20201013040805.20523-6-abner.chang@hpe.com> In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com> References: <20201013040805.20523-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: tZHJGaEfDWenu3yVjyHYAGHvx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1602564772; bh=TSbGC6B5cAeUK5K5oRXo4Fa69PKu4NEFoKnbrb9i8dI=; h=Cc:Date:From:Reply-To:Subject:To; b=sx2RvKfWql02BVwH/jmf4hO/ze3G+9o8QrQ6Y9oDundBPVjbpWLXM5DCnEyk9oDrvo/ QYr5fdnBdSiWudXeJH6kFltDvIu8iDGAEPhxrEHDzs650jr3XL6KVKO29hXiToFcasVfT NEeH+D89cwiZgNHLYwkcStyLHQ0RQd9Xjak= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add RedfishHostInterfaceDxe and PlatformHostInterfaceLibNull to Redfish package. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang --- RedfishPkg/RedfishPkg.dsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc index 8acadddefc..be6996b203 100644 --- a/RedfishPkg/RedfishPkg.dsc +++ b/RedfishPkg/RedfishPkg.dsc @@ -38,3 +38,9 @@ DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf + RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterface= LibNull/PlatformHostInterfaceLibNull.inf + +[Components] + RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLib= Null.inf + + RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf --=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 (#66158): https://edk2.groups.io/g/devel/message/66158 Mute This Topic: https://groups.io/mt/77477505/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-