From nobody Tue May 7 15:15:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+82765+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+82765+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1635382828; cv=none; d=zohomail.com; s=zohoarc; b=BdalLXtYVMttZSa/tiX36RtX+mV6EBnim4c3DIhavRfBSI+GYt+KYRJGiErlxDT2NlEYgXHLTY1vptncFGqemOyh+hOGnVLgHxoctbDXFwTZPbPeJxHESXJNcvJy2LyIZ9FIMPmVtEML6t8HC9hRIqi7A/aMNI8TFO5pAfcrxic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635382828; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=caWBrRuuz1t6TJ5M9Nl8mHR3WiZ8XWNKJnQiyyxjSBA=; b=Q+RKvxVLQWHglJWO28Tl4AD1SkV49wAFbX2oS0oZulGeIXO86nhGDSu4lQ7zdztojrGH3cIMENVxNT5vPhW90YtgJpNlP1oQVFzX50CS9Z2WNeVSiE05oOSGPjip7g5oeT6QELYrEHl0GyJf+X3NjG3QIzrK7+DRh7NNyc/NlOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+82765+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1635382828730367.8615438427345; Wed, 27 Oct 2021 18:00:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id CLbQYY1788612xf7jqrzyCRA; Wed, 27 Oct 2021 18:00:28 -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.5205.1635382819553966265 for ; Wed, 27 Oct 2021 18:00:27 -0700 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19RNDZij007787; Thu, 28 Oct 2021 00:59:45 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 3by8j9ve6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 00:59:45 +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 693628B; Thu, 28 Oct 2021 00:59:44 +0000 (UTC) X-Received: from SAC2XFT1JT.asiapacific.hpqcorp.net (unknown [10.43.62.133]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id EFF2C39; Thu, 28 Oct 2021 00:59:42 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: nickle.wang@hpe.com, Liming Gao Subject: [edk2-devel] [PATCH] edk2-staging/RedfishPkg: EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL Date: Thu, 28 Oct 2021 08:59:41 +0800 Message-Id: <20211028005941.34200-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: 8HhotgBKERI22DDyErBHhTtfMfSq0iqi X-Proofpoint-ORIG-GUID: 8HhotgBKERI22DDyErBHhTtfMfSq0iqi X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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: hjeopEt7tzTi8VTw3Bf2sB2Fx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1635382828; bh=H85Em2gDuL72IC37hCiINLM3I4egnKpDj7wrF37zBgo=; h=Cc:Date:From:Reply-To:Subject:To; b=VdA69nb67bvr7RTBVMTgkSezhvrWyJi8H6nASoIbhI5jhzWMu6TagVlOcrYn7AzZg6f lKNqvNlddO91rvSlKiJeuKEKVAAuPrjdM0Dkc0hcQJcAw6EQxsF8ptMF0hbc6tcYGSAuP P8SLrBFpRzBTHsujqJyASqE7WDQRfuKT84g= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1635382829666100002 Content-Type: text/plain; charset="utf-8" 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 =3D { 0xbc0fe6bb, 0x2cc9, 0x463e,= { 0x90, 0x82, 0xfa, 0x11, 0x76, 0xfc, 0x67, 0xde } } =20 + ## Include/Protocol/EdkIIRedfishPlatformConfig.h + gEdkIIRedfishPlatformConfigProtocolGuid =3D { 0X4D94A7C7, 0X4CE4, 0X4A84= , { 0X88, 0XC1, 0X33, 0X0C, 0XD4, 0XA3, 0X47, 0X67 } } + [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h b/Red= fishPkg/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_PLATF= ORM_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 =3D 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_CONFI= G_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 confi= gure 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_CONFI= G_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 confi= gure 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 gi= ven Schema and Pattern. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFI= G_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 Con= figureLangList. + + @retval EFI_SUCCESS ConfigureLangList is returned successfu= lly. + @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_CONFI= G_PROTOCOL instance. + @param[in] HiiHandle The target handle to search. If handle = is NULL, + this function returns all schema from H= II database. + @param[out] SupportedSchema The supported schema list which is sepa= rated 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 usin= g 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, OPTION= AL + 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 --=20 2.21.0.windows.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 (#82765): https://edk2.groups.io/g/devel/message/82765 Mute This Topic: https://groups.io/mt/86642873/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-