From nobody Wed May 8 18:29:40 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+66813+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+66813+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054855; cv=none; d=zohomail.com; s=zohoarc; b=LSu9UYrwJvTuu/8TUuNijfL4rvPrJeB4W3O/p+vIlMHy4UIXdqY0fopYxX+b5XZE1IROu9FwDeSPKcFRwoV+TE5lBPPZEDJiroT+Rvz9pblZvMP28f9aEIRoswPhMUaSxrvJkdtaTdBCL3x/aKm3g916Lcp5kD5rCEWSHYrNcp8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054855; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=NC2P6oCkEyGhTilghwedKOyrT+/y+UxpemlL579zAYY=; b=mxBI7aRUkHvtlxFDyvXrv9O2VCVphrBf6fPjshq9bn50Kuk9Jt3zJRPB/c0A5SkfQG5doTLhQOr05WQB4dYxaFWGWSH6OBHN3nOzbVZqfhmxJGh7tIxEsNr42LoXap5q54VhQQbWQ9PELcMIHuFcDKy14+z04L0xMQDSXVtarVI= 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+66813+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 1604054855069412.2012760385401; Fri, 30 Oct 2020 03:47:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id EPW9YY1788612x1HXsDh6w1l; Fri, 30 Oct 2020 03:47:34 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.11619.1604054853961607917 for ; Fri, 30 Oct 2020 03:47:34 -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 09UAjrwO016432; Fri, 30 Oct 2020 10:47:33 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 34g5ac4pwm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:33 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 97617A1; Fri, 30 Oct 2020 10:47:32 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 3F9703A; Fri, 30 Oct 2020 10:47:31 +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 v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Date: Fri, 30 Oct 2020 18:02:04 +0800 Message-Id: <20201030100209.9954-2-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: faCPugJDVGumwM1yu5NLAnd4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054854; bh=oFB3Z6OjyrWostc52ffqHfCZM9eNLSGfECVwbPYC+EA=; h=Cc:Date:From:Reply-To:Subject:To; b=LX7F/Aiaryu12KXbVY4MT5j+fUj+7xw24etTKllAL0BmyNN9IKZqUK7s1XkRM8IReCD ykr8eBS2FLss2Iw7+dT5y6lYMNIQrh00yYjelSnfEyqTOntAmjBFqfg5+eFEqwpABvzd4 nruWgB+sH9kBMyo+PCu+VQnNkqMFFKxSwYg= 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 --- .../IndustryStandard/RedfishHostInterface.h | 169 ++++++++++++++++++ 1 file changed, 169 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..3eec7a0b0e --- /dev/null +++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h @@ -0,0 +1,169 @@ +/** @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; + +/// +/// Define union for the Host Interface Device Descriptor +/// +typedef 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. +} DEVICE_DESCRITOR; /// Device descriptor data formated based on Device Ty= pe. + +/// +/// 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 interfac= e. + DEVICE_DESCRITOR DeviceDescriptor; ///< The Device descriptor. +} 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 + --=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 (#66813): https://edk2.groups.io/g/devel/message/66813 Mute This Topic: https://groups.io/mt/77909062/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 18:29:40 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+66814+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+66814+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054861; cv=none; d=zohomail.com; s=zohoarc; b=M1BZFOwXfjOZ5RgHz+9ZOCK4ehGziZcCAcmPu0M5Dt6ZBHrPqOh5DlU5OS0hyrzk2KygGSuSqXDmdLtkceFR34BNlYMfAN6AJvAyww9Fk38aAFf3u5+cFc8AuXYtApPWyGhecY3zUt8WJ2+Cbby6Y/bV3zpNQUlzXkNQBLXx+FU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054861; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=U81r6T8vqO7xqxNgu6VZiBDop3rJNM7uMQhU9cA7JCs=; b=bAMGXk2VZKtINlEKR+uf0damMnMjnVsbEQxuaIcoUT6dY3uMekIDu2rbVONcKtRYN840CsGMFgzMp10MrZCMM8mrPxJ2jKNUBUZ6d4wBLLKWxdkyvP/yblyq5hNGgfrf2QFlnh8zf8LpDAhhKTu10vv0raG014/uDDzkVi6iARo= 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+66814+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 1604054861478356.5875713907725; Fri, 30 Oct 2020 03:47:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NFKDYY1788612xULLLjEcl8P; Fri, 30 Oct 2020 03:47:41 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.11620.1604054855591784639 for ; Fri, 30 Oct 2020 03:47:35 -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 09UAkqZW005259; Fri, 30 Oct 2020 10:47:35 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 34ftgyapsv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:34 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 4815185; Fri, 30 Oct 2020 10:47:34 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id E616942; Fri, 30 Oct 2020 10:47:32 +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 v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file Date: Fri, 30 Oct 2020 18:02:05 +0800 Message-Id: <20201030100209.9954-3-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: D2Dr3LUjEoGBbsVYscNLtp0Rx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054861; bh=Z9BkU33rmU6Z5bDTpDk+efzAVLWaevkg9Gehicq/pzw=; h=Cc:Date:From:Reply-To:Subject:To; b=w+g5qs/X0GAQYo5Z5ZEOWT86NaQeOuJ620QBzh+yh34u/idgs2BfyRnqhrkzRnL8PVU M1/K0kk7Ii4Cnii1Q4fhvZr09HanSOrOJSriE+6cxl94wi5K7ebJfa1K3+Z6CaEHsCJG3 WSVsk68/V/KvnJk6+Ir+3R4Lh2loWU7K4U8= 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 Reviewed-by: 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..fe37b2739a --- /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[in] 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, + OUT 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 OUT 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 (#66814): https://edk2.groups.io/g/devel/message/66814 Mute This Topic: https://groups.io/mt/77909063/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 18:29:40 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+66815+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+66815+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054863; cv=none; d=zohomail.com; s=zohoarc; b=m3WnoG1qei5Ld1mMEG96yIoorPGrNln9KeKPy6jTdQ2ENBAy964MpYBgXGhNvrCHs8MzUvoCJGpWG8PcEtobQhkccKcaX1OVFUCSKRE8d9tGF2EVRfZug7+sMrMnCON6oGO56YpcB+cmSOc9/U3f7AVrdhzwMZ8StUL6oBk6ucY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054863; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=QBft4ULOa16SRAUL7t3sVPjsjfDzckw2qYwYMUWKRTs=; b=O3+2293VgDgvmpmnP7DrbU18tJ0UhZafqiv1z5wHJjFgJCNidustDeRi7JJt/8ZMydVahTdF0i7ZswmvjQD4wfctJWZda7pQKWIZmD2oSJkNcrS0sNJVcA/AktAezMRcQQZHBUmNcifnE3O1SEp4U3D4ABAIHgH5NY38VcZyRAY= 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+66815+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 1604054863289203.5398607108932; Fri, 30 Oct 2020 03:47:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pVrlYY1788612xKXwx6FVM53; Fri, 30 Oct 2020 03:47:42 -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.11720.1604054857372819067 for ; Fri, 30 Oct 2020 03:47:37 -0700 X-Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09UAkIjS022790; Fri, 30 Oct 2020 10:47:36 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 34ftw52gff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:36 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 057398B; Fri, 30 Oct 2020 10:47:35 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 966243F; Fri, 30 Oct 2020 10:47:34 +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 v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Date: Fri, 30 Oct 2020 18:02:06 +0800 Message-Id: <20201030100209.9954-4-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: KCvJXbZQIgYeQVw8oBSvzHuXx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054862; bh=jZkIHfvjUP+BN+FWx+hqC0xVLYYtd7HPKDAkzgE/+xI=; h=Cc:Date:From:Reply-To:Subject:To; b=n6Qr2PdISqDMhO2BTg2C0k2CLawTgTSUCoXkWlefLdKUta0+ESjXSSTWNPFJHxuUaiB iMbaLyLxgMoMPPTXDZgaQj0M108/6R5R21IqeNp/hXSJG2eWs3d9IHkE6BIg/n8rQMqxC 4bNUi75BwIFZ2rH3CL3pbEKFNvVp/WREJxM= 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 Reviewed-by: Nickle Wang --- .../PlatformHostInterfaceLibNull.c | 52 +++++++++++++++++++ .../PlatformHostInterfaceLibNull.inf | 33 ++++++++++++ 2 files changed, 85 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..5c93a003e3 --- /dev/null +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterface= LibNull.c @@ -0,0 +1,52 @@ +/** @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[in] 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_NOT_FOUND No Redfish host interface descriptor provided on= this platform. + +**/ +EFI_STATUS +RedfishPlatformHostInterfaceDeviceDescriptor ( + IN UINT8 *DeviceType, + OUT 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_NOT_FOUND No more protocol records. + +**/ +EFI_STATUS +RedfishPlatformHostInterfaceProtocolData ( + IN OUT 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..b42e5335ee --- /dev/null +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterface= LibNull.inf @@ -0,0 +1,33 @@ +## @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 RISCV64 +# + +[Sources] + PlatformHostInterfaceLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + +[LibraryClasses] + UefiLib + BaseLib + --=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 (#66815): https://edk2.groups.io/g/devel/message/66815 Mute This Topic: https://groups.io/mt/77909064/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 18:29:40 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+66816+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+66816+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054865; cv=none; d=zohomail.com; s=zohoarc; b=aR9Z4bXHs8H7zeg9kEYH33Q55F1f5L8XdLizGKYksV+FRmAizrbeN/J2VmzccQcdcUFEumYbd2KCZhijGzR4/b57JWrppi9rPH2fBY5U4QKZdc4BptCvMnBKfi1JGCZWHEhTtKDldZ7qLuCRNF4rNondso+PYx7eJB43y0AnYT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054865; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=KDaL/pleUihtTtRwtTFRoibVXEG0M5Og4OkvbRG124s=; b=B9wP8YAVz/Vin4gpmkvtLlSuflJEABc8MyYshpAomK/OkbjZ4IGcZhM0bSPGry/xvHKeWwKHlTFIvmL9YUFOdrIBEc55AYEaBB3ROuhu1g4i4b4Hc2ZWPmCOLLSr7HI/8RjF7nIsueOMbXJvaHQj5L6vI853zxEOTXgwZqEcc94= 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+66816+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 1604054865014296.8095356148365; Fri, 30 Oct 2020 03:47:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id c6G2YY1788612x6tJbvgH06f; Fri, 30 Oct 2020 03:47:44 -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.11926.1604054859023013375 for ; Fri, 30 Oct 2020 03:47:39 -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 09UAh6L5012601; Fri, 30 Oct 2020 10:47:38 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 34esrh9xyk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:38 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 9DE0A91; Fri, 30 Oct 2020 10:47:37 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 48FFE39; Fri, 30 Oct 2020 10:47:36 +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 v2 4/6] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Date: Fri, 30 Oct 2020 18:02:07 +0800 Message-Id: <20201030100209.9954-5-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: 0FAxmlSxGwBJzlEhOal0yZs9x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054864; bh=UP7vxctOqqwZVGiT+mR2ovV5Lmov087GnvxxvW/4+jQ=; h=Cc:Date:From:Reply-To:Subject:To; b=LvA6ZOn6hx8FFkBOm/8L+z+UW/bBT+tXix5GjJ/mOiqSf4Gm7tqfl6wD7pRMJrocMsS i31aEPqRNcVAJDe+Q3wNQ4YpQ+m0CW3vSWsBc+fbZx4wA6HUjOibDwQr7q+EAf4GE7nnG N1uZ7Eu0SFvwsB/k6gh+sOEXzbAxr8+Oqmg= 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 --- .../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..1cdae149aa --- /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 (#66816): https://edk2.groups.io/g/devel/message/66816 Mute This Topic: https://groups.io/mt/77909065/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 18:29:40 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+66817+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+66817+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054866; cv=none; d=zohomail.com; s=zohoarc; b=ZrJ/1I68LfiCShbi1trNaloM56a4h+6cDt+fU2lmGACOUNRhWnE9s1LACOyTpIitCD5k6Zho6PA90NM2yEn/Dv8+sd2hNOXEkHIfvF9UYVQkVyl/JNUXO0A94PmXlEA5GRsDg+wN3LGhGwUvtkAeB6K9yUJ9jky5B2mWrk8ixKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054866; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=KKQtM4/nspNlkjVgHb1njI+bhdc+nF7BpIDS1qLQg74=; b=K0Ms52+pCLK61mEKiRWdgRTyuFXEJTgjRm0Mshy61HmcW7PMYExZqdZENppthiCAYVxhM7jQlmzMXzZmfjkP0y7qWvXtrza2XDDJ3DG0hJXKKtI7+DhMgAG8kiolJS5stfIE29jG3mqZ7ikxdjiG7RJ0q7OtMCFWQ6B007Pxl9I= 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+66817+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 1604054866585529.6524018383232; Fri, 30 Oct 2020 03:47:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fbnEYY1788612xCNJvnOGE8B; Fri, 30 Oct 2020 03:47:46 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.11801.1604054860852130124 for ; Fri, 30 Oct 2020 03:47:40 -0700 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 09UAkjkL021593; Fri, 30 Oct 2020 10:47:40 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 34f5474dtv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:40 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 4EF846D; Fri, 30 Oct 2020 10:47:39 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id ED1CD3A; Fri, 30 Oct 2020 10:47:37 +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 v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Date: Fri, 30 Oct 2020 18:02:08 +0800 Message-Id: <20201030100209.9954-6-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: FSvPBdHyPPkrzRzz5j4aEQMfx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054866; bh=+d8ma00j6CSXTvScZMnGudMI4FuIeacXlz4i4qw44S8=; h=Cc:Date:From:Reply-To:Subject:To; b=na6t7vJjnkTg41DCFVwLL7pN/DIF5eJAlnUO1wN4F+gFJMFC6U5qe+BnZEH8OE3njb7 WYkCxIaZ0WxWRorhA5FZZOS8ZfTfwOShOIaD4OrBrAaC3wwAU79x/lYf1eVgc7WC9xles ACZoqdvaK0Ty43ARH2ASxjl7wNvWOqh0RhY= 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 Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.dec | 5 +++++ RedfishPkg/RedfishPkg.dsc | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index de3611252e..65e21f6bd6 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -16,6 +16,11 @@ [Includes] Include =20 +[LibraryClasses] + ## @libraryclass Platform Redfish Host Interface Library + # Platform implementation-specific Redfish Host Interface. + RedfishPlatformHostInterfaceLib|Include/Library/RedfishHostInterfaceLib.h + [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc index 8acadddefc..cd40812d24 100644 --- a/RedfishPkg/RedfishPkg.dsc +++ b/RedfishPkg/RedfishPkg.dsc @@ -38,3 +38,17 @@ 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 + +[LibraryClasses.ARM, LibraryClasses.AARCH64] + # + # This library provides the instrinsic functions generated by a given co= mpiler. + # + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf + +[Components] + 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 (#66817): https://edk2.groups.io/g/devel/message/66817 Mute This Topic: https://groups.io/mt/77909066/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 18:29:40 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+66818+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+66818+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604054862; cv=none; d=zohomail.com; s=zohoarc; b=Ey9ODZEhCB6AaYXlVnjxLIiVvLYagT2aL5oJF+vbhJFjXsQJLsqEvEGOvCpSQy+xgkMVG38nbwFdiwNYyZc6c+iGPEiCTo6CGIFr4D8HvTMyfHA9P61DoOhzWPJI/gemmbzY7lMmUE3K5HljlefsppKuY66Tidi0tTlArZNYQqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604054862; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=II3Qs6WyXuTqju69ubko8mP8F+dGbsHCJA0gxWeE1Xo=; b=kXJiHFLHA9JF4iXqY5jj0Nal166UmKb3NaUnzC2PH0v0OGCho5/I00cXGRGE+6cbRyHyqAiLo7nsenb8KXLsbilXKQdWHxt3Tj4rcUtV5Dh6Tc+biuZ8C7fCeDCagsJWYY0+7YouO+Hpuo78BtQkEx5Y3ZRB/WTq0F4agccCOUk= 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+66818+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 1604054862855137.8025633320076; Fri, 30 Oct 2020 03:47:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KGLEYY1788612xsrqGZA5Nfu; Fri, 30 Oct 2020 03:47:42 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.11927.1604054862039623648 for ; Fri, 30 Oct 2020 03:47:42 -0700 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 09UAhcqb008838; Fri, 30 Oct 2020 10:47:41 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 34f6vxkpxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 10:47:41 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 0A496AE; Fri, 30 Oct 2020 10:47:41 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 9CF6736; Fri, 30 Oct 2020 10:47:39 +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 v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test Date: Fri, 30 Oct 2020 18:02:09 +0800 Message-Id: <20201030100209.9954-7-abner.chang@hpe.com> In-Reply-To: <20201030100209.9954-1-abner.chang@hpe.com> References: <20201030100209.9954-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: RopYjchQDokcHCGX2AJYydnux1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604054862; bh=AIZoKRgjWkn+vuujzU1Avz6lvnD7p03KuiqCT1MCn4U=; h=Cc:Date:From:Reply-To:Subject:To; b=rYgsHM/odhDjvGFvzWQ2N85RNqSpxFvdQZ0QThL1ZDooE5XcNFP1Ygj5SZj4BF+aZo1 iK8GsMfvlqfBMKH7sr5bp5AuB3iaVkT12VEi56YPoj8uefFn29U8Rot4Xh+s4h8vxudgS eiHwpjXNblXHzskPrUQsAIGyKzkUTy8W0yI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add accepted dependency of RedfishPkg in RedfishPkg CI yaml file. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml index 75c3b6a8ad..bb3b8b6746 100644 --- a/RedfishPkg/RedfishPkg.ci.yaml +++ b/RedfishPkg/RedfishPkg.ci.yaml @@ -29,7 +29,8 @@ "AcceptableDependencies": [ "MdePkg/MdePkg.dec", "MdeModulePkg/MdeModulePkg.dec", - "NetworkPkg/NetworkPkg.dec" + "NetworkPkg/NetworkPkg.dec", + "RedfishPkg/RedfishPkg.dec" ], # For host based unit tests "AcceptableDependencies-HOST_APPLICATION":[], --=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 (#66818): https://edk2.groups.io/g/devel/message/66818 Mute This Topic: https://groups.io/mt/77909067/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-