From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.5294.1635383257520428809 for ; Wed, 27 Oct 2021 18:07:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=bDpvxB2d; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=09357d8486=abner.chang@hpe.com) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19RN2dds011086; Thu, 28 Oct 2021 01:07:27 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 : mime-version : content-transfer-encoding; s=pps0720; bh=ttRjHsZw21qIf9iGZgH06I6nsbI6amHbEuYRHbxJRgo=; b=bDpvxB2dx+c8Ip+TiCwoY8J8tdpzDQ7I9mHHhzbh/0os4ehkDSk1LkAuDhkxppzaOupj S1Xd8C/6MaF1dn1WCv19YY+rXXxXutmae5vEyT6nFS3I6QDvFbm+n4Mnr9kQ66g+9chg B+yEwMcrlVk/Sl2QBRUbHrjBhgWXtvaMg430Mwd/+k7LHd1Jwzotm6D6RiDF4DEdXrAO ln7U6xD4AAo4jKDO4XvAzPFCIcINgAzRQcB1DHl0BurZneTZ5tEM52q9UzyHHg2Dr9Zk juHuXDuywB7jBxMLsNO9E7dEr1RUFW1DP+2JoWBibK0kF4Udw+pLioDKtVd1f+Q07zol 5w== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 3by7cud3q7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 01:07:27 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id BE053AE; Thu, 28 Oct 2021 01:07:26 +0000 (UTC) Received: from SAC2XFT1JT.asiapacific.hpqcorp.net (unknown [10.43.62.133]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id E16E736; Thu, 28 Oct 2021 01:07:25 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: nickle.wang@hpe.com, Liming Gao Subject: [PATCH RESEND 1/5] edk2-staging/RedfishPkg: EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL Date: Thu, 28 Oct 2021 09:07:19 +0800 Message-Id: <20211028010723.37316-2-abner.chang@hpe.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211028010723.37316-1-abner.chang@hpe.com> References: <20211028010723.37316-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: V1kp_-G0Na55DscZwqEScWLCK3btTpfA X-Proofpoint-GUID: V1kp_-G0Na55DscZwqEScWLCK3btTpfA X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-27_07,2021-10-26_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2110280005 Content-Transfer-Encoding: 8bit EDKII Redfish Platform Config Protocol defines the protocol interfaces that abstracts the platform configuration format and storage from EDK2 Redfish Feature driver. This protocol provides the interfaces to get and set platform configuration with the format and configuration storage agnostic to the Redfish feature driver. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Liming Gao --- RedfishPkg/RedfishPkg.dec | 3 + .../Protocol/EdkIIRedfishPlatformConfig.h | 147 ++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index 9886502a0db..4d80515fe07 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -73,6 +73,9 @@ ## Include/Protocol/Edk2RedfishConfigHandler.h gEdkIIRedfishConfigHandlerProtocolGuid = { 0xbc0fe6bb, 0x2cc9, 0x463e, { 0x90, 0x82, 0xfa, 0x11, 0x76, 0xfc, 0x67, 0xde } } + ## Include/Protocol/EdkIIRedfishPlatformConfig.h + gEdkIIRedfishPlatformConfigProtocolGuid = { 0X4D94A7C7, 0X4CE4, 0X4A84, { 0X88, 0XC1, 0X33, 0X0C, 0XD4, 0XA3, 0X47, 0X67 } } + [Guids] gEfiRedfishPkgTokenSpaceGuid = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h new file mode 100644 index 00000000000..895b010227f --- /dev/null +++ b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h @@ -0,0 +1,147 @@ +/** @file + This file defines the EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL interface. + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef EDKII_REDFISH_PLATFORM_CONFIG_H_ +#define EDKII_REDFISH_PLATFORM_CONFIG_H_ + +typedef struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL; + +/** + Definition of EDKII_REDFISH_TYPE_VALUE + **/ +typedef union { + INT64 Integer; + BOOLEAN Boolean; + CHAR8 *Buffer; +} EDKII_REDFISH_TYPE_VALUE; + +/** + Definition of EDKII_REDFISH_VALUE_TYPES + **/ +typedef enum { + REDFISH_VALUE_TYPE_UNKNOWN = 0, + REDFISH_VALUE_TYPE_INTEGER, + REDFISH_VALUE_TYPE_BOOLEAN, + REDFISH_VALUE_TYPE_STRING, + REDFISH_VALUE_TYPE_MAX +} EDKII_REDFISH_VALUE_TYPES; + +/** + Definition of EDKII_REDFISH_VALUE + **/ +typedef struct { + EDKII_REDFISH_VALUE_TYPES Type; + EDKII_REDFISH_TYPE_VALUE Value; +} EDKII_REDFISH_VALUE; + +/** + Get Redfish value with the given Schema and Configure Language. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance. + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[out] Value The returned value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE) ( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + OUT EDKII_REDFISH_VALUE *Value + ); + +/** + Set Redfish value with the given Schema and Configure Language. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance. + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[in] Value The value to set. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE) ( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + IN EDKII_REDFISH_VALUE Value + ); + +/** + Get the list of Configure Language from platform configuration by the given Schema and Pattern. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance. + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] Pattern The target Configure Language pattern. + @param[out] ConfigureLangList The list of Configure Language. + @param[out] Count The number of Configure Language in ConfigureLangList. + + @retval EFI_SUCCESS ConfigureLangList is returned successfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG) ( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING Pattern, + OUT EFI_STRING **ConfigureLangList, + OUT UINTN *Count + ); + + +/** + Get the list of supported Redfish schema from platform configuration on the give HII handle. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance. + @param[in] HiiHandle The target handle to search. If handle is NULL, + this function returns all schema from HII database. + @param[out] SupportedSchema The supported schema list which is separated by ';'. + For example: "x-uefi-redfish-Memory.v1_7_1;x-uefi-redfish-Boot.v1_0_1" + The SupportedSchema is allocated by the callee. It's caller's + responsibility to free this buffer using FreePool(). + + @retval EFI_SUCCESS Schema is returned successfully. + @retval Others Some error happened. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA) ( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN EFI_HII_HANDLE HiiHandle, OPTIONAL + OUT CHAR8 **SupportedSchema + ); + +struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL { + EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE GetValue; + EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE SetValue; + EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG GetConfigureLang; + EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA GetSupportedSchema; +}; + +extern EFI_GUID gEdkIIRedfishPlatformConfigProtocolGuid; + +#endif -- 2.21.0.windows.1