From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.6451.1616671923787413241 for ; Thu, 25 Mar 2021 04:32:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=K7ymVDtK; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0718a92a40=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12PBSGKb013431; Thu, 25 Mar 2021 11:31:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pps0720; bh=mwXkZ4L+t3c8/+RKONqoIdUl6+adHmOxV9h6gNrlFW8=; b=K7ymVDtKi9joxLQCRxYGzfpP6OqUXFgOm/8IhUBuKxhXD99bcijtuUIIg1jf7+UIpH26 lsDsYlwSpRWoBh9kVN4sahIMmlsiUAqHid+sqjgrMAMepQkGDY2EHjxVIRbCLAeG4d4Y /CKDshHU8mdFqHjSUI1d28o0mnn5/Lzef4uJ9l8a1i9AxpX5P1jKdqUUE3LJeU9xI3U+ TDijy0AzHnaeqo9dN+nFXwhgy6boPRawXVZrw8vMnhUXwO+ViQCszL3870P7y0nmdCw6 g8upllISmnmxBfnJW+7joPnZC+1U6IPh5hdNtUVLtePEMAR/2uHrrqMoGBVpnAjhwcUR Kg== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 37ggq3kr5e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Mar 2021 11:31:55 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 480B383; Thu, 25 Mar 2021 11:31:55 +0000 (UTC) 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 E185037; Thu, 25 Mar 2021 11:31:53 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Nickle Wang , Peter O'Hanley Subject: [PATCH v4 RESEND 1/2] MdePkg/Include: EFI Redfish Discover protocol Date: Thu, 25 Mar 2021 18:40:42 +0800 Message-Id: <20210325104043.2368-2-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210325104043.2368-1-abner.chang@hpe.com> References: <20210325104043.2368-1-abner.chang@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-25_02:2021-03-24,2021-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103250085 Move GUID definition of EFI Redfish Discover protocol to under MdePkg. With this we don't have dependency of RedfishPkg in ShellPkg. Signed-off-by: Abner Chang Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Nickle Wang Cc: Peter O'Hanley Reviewed-by: Liming Gao --- MdePkg/MdePkg.dec | 5 +- RedfishPkg/RedfishPkg.dec | 3 - .../Include/Protocol/RedfishDiscover.h | 72 +++++++++---------- 3 files changed, 37 insertions(+), 43 deletions(-) rename {RedfishPkg => MdePkg}/Include/Protocol/RedfishDiscover.h (79%) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 1d2637acc2..e667d44db5 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -6,7 +6,7 @@ # # Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP
+# (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -1863,6 +1863,9 @@ ## Include/Protocol/RestJsonStructure.h gEfiRestJsonStructureProtocolGuid = { 0xa9a048f6, 0x48a0, 0x4714, {0xb7, 0xda, 0xa9, 0xad,0x87, 0xd4, 0xda, 0xc9 }} + ## Include/Protocol/RedfishDiscover.h + gEfiRedfishDiscoverProtocolGuid = { 0x5db12509, 0x4550, 0x4347, { 0x96, 0xb3, 0x73, 0xc0, 0xff, 0x6e, 0x86, 0x9f }} + # # Protocols defined in Shell2.0 # diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index b3e25268a0..846c19fd5e 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -67,9 +67,6 @@ RedfishLib|PrivateInclude/Library/RedfishLib.h [Protocols] - ## Include/Protocol/RedfishDiscover.h - gEfiRedfishDiscoverProtocolGuid = { 0x5db12509, 0x4550, 0x4347, { 0x96, 0xb3, 0x73, 0xc0, 0xff, 0x6e, 0x86, 0x9f }} - ## Include/Protocol/EdkIIRedfishCredential.h gEdkIIRedfishCredentialProtocolGuid = { 0x8804377, 0xaf7a, 0x4496, { 0x8a, 0x7b, 0x17, 0x59, 0x0, 0xe9, 0xab, 0x46 } } diff --git a/RedfishPkg/Include/Protocol/RedfishDiscover.h b/MdePkg/Include/Protocol/RedfishDiscover.h similarity index 79% rename from RedfishPkg/Include/Protocol/RedfishDiscover.h rename to MdePkg/Include/Protocol/RedfishDiscover.h index 4c91605c4e..8dbb70b082 100644 --- a/RedfishPkg/Include/Protocol/RedfishDiscover.h +++ b/MdePkg/Include/Protocol/RedfishDiscover.h @@ -1,20 +1,19 @@ /** @file This file defines the EFI Redfish Discover Protocol interface. - (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ (C) Copyright 2021 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent + @par Revision Reference: + - Some corrections and revises are added to UEFI Specification 2.9. + - This Protocol is introduced in UEFI Specification 2.8. + **/ #ifndef EFI_REDFISH_DISCOVER_PROTOCOL_H_ #define EFI_REDFISH_DISCOVER_PROTOCOL_H_ -#include -#include -#include -#include - // // GUID definitions // @@ -40,24 +39,21 @@ typedef UINT32 EFI_REDFISH_DISCOVER_FLAG; ///< 3 to 15. The corresponding duration is 8 to 2^15 seconds. ///< Duration is only valid when EFI_REDFISH_DISCOVER_KEEP_ALIVE ///< is set to 1. -#define EFI_REDFISH_DISCOVER_DURATION_BIT_POS 8 - typedef struct _EFI_REDFISH_DISCOVER_PROTOCOL EFI_REDFISH_DISCOVER_PROTOCOL; -typedef struct _EFI_REDFISH_DISCOVERED_INFORMATION EFI_REDFISH_DISCOVERED_INFORMATION; - -typedef struct _EFI_REDFISH_DISCOVERED_INFORMATION { - EFI_HANDLE RedfishRestExHandle; ///< REST EX EFI handle associated with this Redfish service. - BOOLEAN IsUdp6; ///< Indicates it's IP versino 6. - EFI_IP_ADDRESS RedfishHostIpAddress; ///< IP address of Redfish service. - UINTN RedfishVersion; ///< Redfish service version. - CHAR16 *Location; ///< Redfish service location. - CHAR16 *Uuid; ///< Redfish service UUID. - CHAR16 *Os; ///< Redfish service OS. - CHAR16 *OSVersion; ///< Redfish service OS version. - CHAR16 *Product; ///< Redfish service product name. - CHAR16 *ProductVer; ///< Redfish service product version. - BOOLEAN UseHttps; ///< Using HTTPS. -}; + +typedef struct { + EFI_HANDLE RedfishRestExHandle; ///< REST EX EFI handle associated with this Redfish service. + BOOLEAN IsUdp6; ///< Indicates it's IP versino 6. + EFI_IP_ADDRESS RedfishHostIpAddress; ///< IP address of Redfish service. + UINTN RedfishVersion; ///< Redfish service version. + CHAR16 *Location; ///< Redfish service location. + CHAR16 *Uuid; ///< Redfish service UUID. + CHAR16 *Os; ///< Redfish service OS. + CHAR16 *OsVersion; ///< Redfish service OS version. + CHAR16 *Product; ///< Redfish service product name. + CHAR16 *ProductVer; ///< Redfish service product version. + BOOLEAN UseHttps; ///< Using HTTPS. +} EFI_REDFISH_DISCOVERED_INFORMATION; typedef struct { EFI_STATUS Status; ///< Status of Redfish service discovery. @@ -75,7 +71,7 @@ typedef struct { EFI_IP_ADDRESS SubnetId; ///< Subnet ID. UINT8 SubnetPrefixLength; ///< Subnet prefix-length for IPv4 and IPv6. UINT16 VlanId; ///< VLAN ID. -} EFI_REDFISH_DISCOVER_NETWORK_INSTANCE; +} EFI_REDFISH_DISCOVER_NETWORK_INTERFACE; typedef struct { UINT32 Signature; ///< Token signature. @@ -112,10 +108,10 @@ typedef struct { typedef EFI_STATUS (EFIAPI *EFI_REDFISH_DISCOVER_NETWORK_LIST)( - IN EFI_REDFISH_DISCOVER_PROTOCOL *This, - IN EFI_HANDLE ImageHandle, - OUT UINTN *NumberOfNetworkInterfaces, - OUT EFI_REDFISH_DISCOVER_NETWORK_INSTANCE **NetworkInterfaces + IN EFI_REDFISH_DISCOVER_PROTOCOL *This, + IN EFI_HANDLE ImageHandle, + OUT UINTN *NumberOfNetworkInterfaces, + OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE **NetworkInterfaces ); /** @@ -147,7 +143,7 @@ EFI_STATUS (EFIAPI *EFI_REDFISH_DISCOVER_ACQUIRE_SERVICE)( IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_HANDLE ImageHandle, - IN EFI_REDFISH_DISCOVER_NETWORK_INSTANCE *TargetNetworkInterface, + IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface OPTIONAL, IN EFI_REDFISH_DISCOVER_FLAG Flags, IN EFI_REDFISH_DISCOVERED_TOKEN *Token ); @@ -155,8 +151,8 @@ EFI_STATUS /** This function aborts Redfish service discovery on the given network interface. - @param[in] This EFI_REDFISH_DISCOVER_PROTOCOL instance. - @param[in] TargetNetworkInterface Target NIC to do the discovery. + @param[in] This EFI_REDFISH_DISCOVER_PROTOCOL instance. + @param[in] TargetNetworkInterface Target NIC to do the discovery. @retval EFI_SUCCESS REST EX instance of discovered Redfish services are returned. @retval Others Fail to abort Redfish service discovery. @@ -165,15 +161,15 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_REDFISH_DISCOVER_ABORT_ACQUIRE)( - IN EFI_REDFISH_DISCOVER_PROTOCOL *This, - IN EFI_REDFISH_DISCOVER_NETWORK_INSTANCE *TargetNetworkInterface OPTIONAL + IN EFI_REDFISH_DISCOVER_PROTOCOL *This, + IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface OPTIONAL ); /** This function releases Redfish services found by RedfishServiceAcquire(). @param[in] This EFI_REDFISH_DISCOVER_PROTOCOL instance. - @param[in] InstanceList The Redfish service to release. + @param[in] List The Redfish service to release. @retval EFI_SUCCESS REST EX instances of discovered Redfish are released. @retval Others Fail to remove the entry @@ -183,17 +179,15 @@ typedef EFI_STATUS (EFIAPI *EFI_REDFISH_DISCOVER_RELEASE_SERVICE)( IN EFI_REDFISH_DISCOVER_PROTOCOL *This, - IN EFI_REDFISH_DISCOVERED_LIST *InstanceList + IN EFI_REDFISH_DISCOVERED_LIST *List ); -typedef struct _EFI_REDFISH_DISCOVER_PROTOCOL { +struct _EFI_REDFISH_DISCOVER_PROTOCOL { EFI_REDFISH_DISCOVER_NETWORK_LIST GetNetworkInterfaceList; EFI_REDFISH_DISCOVER_ACQUIRE_SERVICE AcquireRedfishService; EFI_REDFISH_DISCOVER_ABORT_ACQUIRE AbortAcquireRedfishService; EFI_REDFISH_DISCOVER_RELEASE_SERVICE ReleaseRedfishService; -} EFI_REDFISH_DISCOVER_PROTOCOL; +}; -extern EFI_GUID gEfiRestExProtocolGuid; -extern EFI_GUID gEfiRestExServiceBindingProtocolGuid; extern EFI_GUID gEfiRedfishDiscoverProtocolGuid; #endif -- 2.17.1