From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.78]) by mx.groups.io with SMTP id smtpd.web11.28557.1681870324822954521 for ; Tue, 18 Apr 2023 19:12:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=R/nTqGQH; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.94.78, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=COQqlaiGQCnmnez+N7sYR6x8IoRu7qj2+n8S4vgaHnRFfKpq7DON7OkzzNvRJRC2rLIp4NtD4clW67xOUOnCVWlNrEGHRNWNlB/YJ0tWAuLrggyxxU7O7mBk4dtybo+4tRTTe5MM1kMV/XLUnUO4N5A3vGerIqeKN3zv8LtMWtxRx2lWjGh6iNZLwaV9wTPkntWnaV0AASGzcP2uFUwZTcIw2WPjra7OgjyLxq5sWAyPOBNhNlXP13qamsxDrgZi4flLLinMsBy0KucqWPWQwzar5oabPi/KmVwVrK9tuYHjhDXv2GRvMRC4uRHM2FG7rvfcJshq2GYG9SeTEx/BgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iYjSWjUlUvWHAT5kfaVI3DSitmQaRDxKoahLnpB7OVA=; b=a8naBGAB0o4TTxEdPq9XhBIryzRxN9bPRLwn3VAPzvc04TgiuFZe4uJD9er63ZK8hnKfKjS9ycDkbjPd5qH5mGGCqSA7FAVXH0OV5HtojnGqcFHTQMg46blhenhb2l15SZ2WPAWjvffEjCQtUUf/uPlRu7PGWJLALzqN/SHrlkjAaTpv7bxNnULL0TedrzOQNIJkhCRvvlBgHVAEHACE+aAms1xo0PODKxHGFSPYKQwGlWhtTk74hqt/omMXBZAMxFy9lQ3I07+dFI9ODt50V9GoG5gqthxXgnYyhEV68xCZE8AS2z1HzhVDK5Dz1y2WAnG3H06dRfc/UFHlstLfLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iYjSWjUlUvWHAT5kfaVI3DSitmQaRDxKoahLnpB7OVA=; b=R/nTqGQHhGEBPH3H5VJ9YIQxcvwB6tJFwVVF0KFp6cdmdnizQLqBksFGPYuOMxdZVPkU7PZBM7zz/vr0iISnJqIc4pcVFNGTCoaUIE6FU35EWZRUWrr0jUCQmhANiwTUj7JXbkzLmD7z+2Uq0lgghUZ/T36TKExCMcJQJ4NJmp7LY30BQqKvwavAlnc941Jv7xSh51aID8Hs+fUj/DW6gGcqixaSIoYBn07aBjKeTXsO1GTNGLmdzKM0stQLsyl5qrzxeDixhup3vmoKj0T095EKNP3oubAmeUkLLo1Rv7DmUiKJgwhzfVyg7sIJUf61Bx77e03tUAxgGro3amYiOQ== Received: from BN9PR03CA0516.namprd03.prod.outlook.com (2603:10b6:408:131::11) by DS0PR12MB8503.namprd12.prod.outlook.com (2603:10b6:8:15a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Wed, 19 Apr 2023 02:12:02 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::e) by BN9PR03CA0516.outlook.office365.com (2603:10b6:408:131::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20 via Frontend Transport; Wed, 19 Apr 2023 02:12:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.21 via Frontend Transport; Wed, 19 Apr 2023 02:12:01 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 18 Apr 2023 19:11:50 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 18 Apr 2023 19:11:49 -0700 Received: from NV-CL38DL3.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 18 Apr 2023 19:11:49 -0700 From: "Nickle Wang" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [PATCH v2 1/5] RedfishPkg: introduce EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL Date: Wed, 19 Apr 2023 10:11:48 +0800 Message-ID: <20230419021148.5874-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT109:EE_|DS0PR12MB8503:EE_ X-MS-Office365-Filtering-Correlation-Id: 29287bc9-ffb5-4341-3c6c-08db407b76d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /FYSRjwGiOLsKFhOAMhWdT3syXZJvfsANAu9prLZ1msrC2xiG8pk/ex3R7tdwvh4xYxkSlLQqvWGEJ8E+CuepEnS3oR9MOoeIL+ZnuMA5cuAsYzeiPLfyuL4GDNcxuqr001p3yFBTG1KdT++9bb7KUs+xq5YV0EAh6Zay6QDkyi2+FMI5sV2SLre5XSrmbJ0k+aGjWyp++4LmXXExabUPSswrv/V5cGnI0y8cF628lY62Y6OO+Cns875QJ6V8DO9HlntSTS2d4/oVzTtaaTQx8QxtV214PUpv48E9j0xTC+9PPfZjfHrkRp6cXAWbk9S9MRE81aj7Y6mbcF3kTkxRYYJL4uE1f7dkN8VTr4KQoLZGxMOXisvQakaPS2dTqeG1ZDXIpZeWmIIDgK7Ugtru0zsWlqA9yImf+Irn6S+Cnq1S6cJDE+kmyp41jJFz133MrjvsYz1HCvFaXk+LkL4FtKGahLzl1vC4Etx7WJOIPnA9J2mdmYck36lIriQ5h+AedshiFgj9zynAWwMDxZfL1E3gF3N6IyxoXNN9ll5L9eddMhQlP+DUQsFjXc2G7NiT7vxlbdEFMmfSZPWaXMhiWjtWm11UEOXKAxAvNlHvJoTASshZWlECiu8oWxGWBp14U0odyJsXN5g/rVgKBqAA81Hm6se5GyuuUsTrJVHbri5HES03AWzJbHhUA9M/d0cuSxf2Yg1AamvyYlu93EATIekqjgbGxSSmUOCVb3xR+fAE+nDdXWv+1+e3hFaqrop1VQ0HrUzmP1K4wCOy9cl7SutfbG1suDnC6r/Vgtbpr4= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(36756003)(6916009)(5660300002)(2906002)(8936002)(40480700001)(70586007)(86362001)(4326008)(70206006)(356005)(82740400003)(41300700001)(82310400005)(8676002)(426003)(34070700002)(19627235002)(83380400001)(336012)(36860700001)(47076005)(186003)(316002)(26005)(1076003)(107886003)(54906003)(478600001)(2616005)(7636003)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 02:12:01.9605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29287bc9-ffb5-4341-3c6c-08db407b76d1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8503 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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: Igor Kulchytskyy Cc: Nick Ramirez --- RedfishPkg/RedfishPkg.dec | 3 + .../Protocol/EdkIIRedfishPlatformConfig.h | 257 ++++++++++++++++++ 2 files changed, 260 insertions(+) create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.= h diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index f171053aec10..904630ae4be6 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -78,6 +78,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 000000000000..e27256bd68df --- /dev/null +++ b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h @@ -0,0 +1,257 @@ +/** @file + This file defines the EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL interface. + + (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. + + 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; + CHAR8 **StringArray; + INT64 *IntegerArray; + BOOLEAN *BooleanArray; +} EDKII_REDFISH_TYPE_VALUE; + +/// +/// Definition of EDKII_REDFISH_VALUE_TYPES +/// +typedef enum { + RedfishValueTypeUnknown =3D 0, + RedfishValueTypeInteger, + RedfishValueTypeBoolean, + RedfishValueTypeString, + RedfishValueTypeStringArray, + RedfishValueTypeIntegerArray, + RedfishValueTypeBooleanArray, + RedfishValueTypeMax +} EDKII_REDFISH_VALUE_TYPES; + +/// +/// Definition of EDKII_REDFISH_ATTRIBUTE_TYPES +/// +typedef enum { + RedfishAttributeTypeUnknown =3D 0, + RedfishAttributeTypeEnumeration, + RedfishAttributeTypeString, + RedfishAttributeTypeInteger, + RedfishAttributeTypeBoolean, + RedfishAttributeTypePassword +} EDKII_REDFISH_ATTRIBUTE_TYPES; + +/// +/// Definition of EDKII_REDFISH_VALUE +/// +typedef struct { + EDKII_REDFISH_VALUE_TYPES Type; + EDKII_REDFISH_TYPE_VALUE Value; + UINTN ArrayCount; +} EDKII_REDFISH_VALUE; + +/// +/// Definition of EDKII_REDFISH_ATTRIBUTE_VALUE +/// +typedef struct { + CHAR8 *ValueName; + CHAR8 *ValueDisplayName; +} EDKII_REDFISH_ATTRIBUTE_VALUE; + +/// +/// Definition of EDKII_REDFISH_POSSIBLE_VALUES +/// +typedef struct { + UINTN ValueCount; + EDKII_REDFISH_ATTRIBUTE_VALUE *ValueArray; +} EDKII_REDFISH_POSSIBLE_VALUES; + +/// +/// Definition of EDKII_REDFISH_ATTRIBUTE +/// +typedef struct { + CHAR8 *AttributeName; + CHAR8 *DisplayName; + CHAR8 *HelpText; + CHAR8 *MenuPath; + EDKII_REDFISH_ATTRIBUTE_TYPES Type; + BOOLEAN ResetRequired; + BOOLEAN ReadOnly; + BOOLEAN GrayedOut; + BOOLEAN Suppress; + UINT64 NumMaximum; + UINT64 NumMinimum; + UINT64 NumStep; + UINT8 StrMaxSize; + UINT8 StrMinSize; + EDKII_REDFISH_POSSIBLE_VALUES Values; +} EDKII_REDFISH_ATTRIBUTE; + +/** + 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 + ); + +// +// Default class standard +// +#define EDKII_REDFISH_DEFAULT_CLASS_STANDARD EFI_HII_DEFAULT_CLASS_STANDA= RD + +/** + Get Redfish default 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] DefaultClass The UEFI defined default class. + Please refer to UEFI spec. 33.2.5.8 "de= faults" for details. + @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_DEFAULT_VALUE)( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + IN UINT16 DefaultClass, + 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 Redfish attribute 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] AttributeValue The attribute value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +typedef + EFI_STATUS +(EFIAPI *EDKII_REDFISH_PLATFORM_CONFIG_GET_ATTRIBUTE)( + IN EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL *This, + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + OUT EDKII_REDFISH_ATTRIBUTE *AttributeValue + ); + +/** + Get the list of Configure Language from platform configuration by the gi= ven Schema and RegexPattern. + + @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] RegexPattern The target Configure Language pattern. = This is used for regular expression matching. + @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 RegexPattern, + OUT EFI_STRING **ConfigureLangList, + OUT UINTN *Count + ); + +/** + Get the list of supported Redfish schema from platform configuration. + + @param[in] This Pointer to EDKII_REDFISH_PLATFORM_CONFI= G_PROTOCOL instance. + @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, + OUT CHAR8 **SupportedSchema + ); + +struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL { + UINT64 Revision; + EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE GetValue; + EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE SetValue; + EDKII_REDFISH_PLATFORM_CONFIG_GET_DEFAULT_VALUE GetDefaultValue; + EDKII_REDFISH_PLATFORM_CONFIG_GET_ATTRIBUTE GetAttribute; + EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG GetConfigureLang; + EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA GetSupportedSchema= ; +}; + +extern EFI_GUID gEdkIIRedfishPlatformConfigProtocolGuid; + +#endif --=20 2.17.1