From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.73]) by mx.groups.io with SMTP id smtpd.web08.29140.1658760332680604709 for ; Mon, 25 Jul 2022 07:45:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=G/NimZfL; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.73, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dLfcOekoIH0xX4fQ0QO9iPguH6TJIpnkpr7hTw9sq3ONaT9JZquUg7sOHAMuCbnUJ3Q0Vb5L7FB/DZcImuDGkpHCWixlwfcrQ3hXoMpivNORLWbf70br0jenXLvfEnu2P4D9pFVSwa5COB+iN473TTRn7ZDSKsgvzyKEFhGVmqDUkQoDuKmK3Nlf7z6c9cU7ExHIjxcWytAL8UtHKdun+5JkU7D2+hZ1YddBYHSbGmIsXCRY4S9l5w5TEIl0uvkV1IgRZFVQkpfLIElXyiPvYP4MAQ5EvqB0AgX3O+48yAejl0p5BjEJxgCKHozCmU+1JSPe5zkg56p8TN+FXF/lcQ== 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=BdiP2mz2SSpRhG8FciSTCndkxGxxVG7QbWJU6u/yWMM=; b=fvZxU6we1zwoR/4A4Zf2QxNbQaQtQ7b7QXtnYvaFXB3DkyEmjxpfRHNqtFkLJQdptf3tqOLNUBbIWK/nc2mb/k1L31UIUrhKl6ckBgBsYqPIc28FUTM4uVXmViQHKRj1wpLNSSbDkIdpZBZTi/j2rmvosBvdeenEbmPtog7LbfHZ1oa5ayflQEFGzdDQOnlXWmLHaOF7ExdHNla+6vKHybDYx0cf/GCTDgeZxyPlMgGTLXwUOlIXIBzFe+BOIUw787TlESy4HGQ1UTxdsKThQLKyaaoUXOeM6gBk2MNNK/M+mueSxYN7EYPNgljXdY+OOgOT/BmM+x/uUhccGSiJmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BdiP2mz2SSpRhG8FciSTCndkxGxxVG7QbWJU6u/yWMM=; b=G/NimZfLqwyE1awh1GBt91bQC2HE6DjhFyx9aNgZpq3mJ1l6jPZnLTFS/Ke4E/caeek2xRpjaocBu/U+CyYQra/Dz6NhyvH7GPuGL2W/Xkll3xYU1nXseJHXYGR5YcUK2MOeUdtstHGA/Ztl8RUl0dkB37ZK9POwKgCIL2mYD6w= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by SJ0PR12MB6830.namprd12.prod.outlook.com (2603:10b6:a03:47c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Mon, 25 Jul 2022 14:45:30 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06%5]) with mapi id 15.20.5458.024; Mon, 25 Jul 2022 14:45:30 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Andrew Fish , Ray Ni , "Yang, Atom" , Nick Ramirez Subject: Re: [edk2-staging][PATCH v2 2/2] edk2-staging/EmulatorPkg: Introduce Hii2RedfishBiosDxe driver Thread-Topic: [edk2-staging][PATCH v2 2/2] edk2-staging/EmulatorPkg: Introduce Hii2RedfishBiosDxe driver Thread-Index: AQHYn8bfojDyQFVy+kK0H8lXIq0+dK2PKqUg Date: Mon, 25 Jul 2022 14:45:30 +0000 Message-ID: References: <20220725013540.1699-1-nickle.wang@hpe.com> <20220725013540.1699-2-nickle.wang@hpe.com> In-Reply-To: <20220725013540.1699-2-nickle.wang@hpe.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-07-25T14:45:28Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=0f420246-52a7-4b52-9d5e-840ccd476f26; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ee57431-d650-4cea-4f73-08da6e4c5234 x-ms-traffictypediagnostic: SJ0PR12MB6830:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 60NYE4chxv7M+B4UzB/UNt+rRIbhwPy4QQT6egVZIi9XWqoQyZIAt5uqm1ZsvbicMU5/++fSjgcc7EMV328EjYXLEXWRnpRWC64gl6gbjGtciQ7jdtsW6rFLagYFCAk/Wec3XD5RqqLBevyiTo56Bz4K3npCbYYzCyRwGSDmYdiVjzlTWVthQG8dQ4sjqWOJuT8/5np+c2szoDwtfx8KyvcVqklGRKjXyXZJUjiOdjWXwgKC3VwARzEMBdCUqF8Q7U/ZzKkrdbV+LCGWmkb9VQrXHdQP34rguIXOXtI1wrsWYwu7+RvyHDhbMzYZV8f3QcSUZVQiRyhCYjBeQxUNAYkIXcPju917r820yP7heRbW+wWB4P3hByIL6kacPrIyZpb8PgiHvXFOqC92gHQhRi2BqXUYtQVXB6yqMM4aYbs+Gu0wgo9xszGxBySSiLAMzPc5xqTzu7xXR67M6WRXGrTHSeBBM+Tvg+80E0ZdCiIJ7jNZMBEsLpYY17nxUldn++beleW7DLx2wQzGZwAuIY2t55bzwn0J8F+YaWwkxXX+qDHjcon5AQcMsVkPLp3DJtsXwkolyDf+6MA8WKejf2EV1+cae24pqWi9tH/z/2fxJSUEz36YQ7oCpAC7pzUGHHMNKL738dhysF/olz0N9Z/Pq9gjm99fIFgan6WLBA6s/0+g7Ond/P1oA3omzXwqXaf3fDT25XEsQOWqL8oR1P6jRlYJYesWHepOSZ45E+6hWtb/cLA6/k/0GqNc6t454H8FDPOry/PAbZSZBVk/Thhl7me0MPC1U+Tk01YlTzIyDkAOslvvC+5XKuLyp9QQXf8GJOMSnWHlnaGlIdohVQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(376002)(39860400002)(136003)(366004)(396003)(316002)(122000001)(30864003)(5660300002)(52536014)(55016003)(38100700002)(66446008)(8936002)(110136005)(478600001)(71200400001)(2906002)(66556008)(54906003)(9686003)(53546011)(41300700001)(8676002)(26005)(7696005)(83380400001)(33656002)(66476007)(64756008)(6506007)(76116006)(66946007)(4326008)(19627235002)(66574015)(186003)(296002)(38070700005)(86362001)(559001)(579004)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oQksmhbjvTZHeNmxmX9NA/w8EUSppLt8FgArGsd7WBmZUDvHc2XWHZ4leB2T?= =?us-ascii?Q?PBaqle9sKotujRL+fh7Z5w6zPMCCK4MaAZ4Sz4katIRPrjJK8lDSGDmoXthX?= =?us-ascii?Q?n91ItccA9n5QxXDSXz7JPDCH8VtH9yK/7DIR1j5g6w+k1E9bcjGQ6KioGwT0?= =?us-ascii?Q?PEb56OpAqNv1UGdg8Ob7P3AZUdxrQFKyRY3nQFWykLT1LfLhhyAvOdQF3sDr?= =?us-ascii?Q?oX0qpjouxNdF2zbGrFzdsqLEI89Iz+bTvU8XImTj/W+/E2t6LoG3kgWpYHmZ?= =?us-ascii?Q?zBtB+9BjdNTHwIY0P8RFalZep/Dxb6aRdv5QSgN8HXGveFCjsth38sTv6jTd?= =?us-ascii?Q?znRf3v8gQRYzjLtb0zFt2OCQODt9Gfly/I3VTlM7WqkETdJskbfEqe3sWi9j?= =?us-ascii?Q?6wI7Hg/bdYVh8YTyhKGmeNPV7RowkWLoFz3g0XaOmFpa1b+vUU+/XTNtBs0s?= =?us-ascii?Q?H8EL8///RV3BN7UFN27MnwgYhrbvapPYipR1EvPA+PCaV6oA9hPUStmPraD5?= =?us-ascii?Q?MYBeoQ4mUrcJj/PQvnM6GGqQQlrSDwY9Vd5Un5j1hevdhuU4SFxWNap/53h2?= =?us-ascii?Q?vMzUNzw31o55bOQvJ9b6Obo/hX8DRZDdN7f/QtWISrnLEQKg5fkGBrQ0S0EU?= =?us-ascii?Q?7OEwxZe8CaLnOU6f26JqoYwqJSYlrr+aGTKBLrvGzNZhbHjiCAGffea0WQlF?= =?us-ascii?Q?mXIZmnJoORvyO/79yPZGr0T9lHxW14G9Ex2zp/tHoK52PAGdxc6UvAB+VL4b?= =?us-ascii?Q?SVnyx7PWUlWppdKphn5/R9QhlsqdayLZSy+YlFfvoomeSbaqF/0nEZeD9d70?= =?us-ascii?Q?SEs8+lnP+TB44JSjOo0sSqgtGeb7R2FobfH9Dtjb1lstdE0f7jzO6SkHDJsL?= =?us-ascii?Q?IF15/++xscgq9HMrkmcNExtoTTe2MFOakg6mreocAvBkB7edTgn0JMKZGwcN?= =?us-ascii?Q?+8A3Gt6WhCqdDl2bmX9J1PCwsfF8IQM17D0RU1rEiR1XE/CQ0Id/hmJTQjXK?= =?us-ascii?Q?dfdXr2q8lGPVL9/cHyXbPa6aL/zk/RMGdn7xJDJvQHg+OFaBTtzOfFfDVioD?= =?us-ascii?Q?PlEmlZdZHBY9DFSEiRFcGpNDrXgThhSkWU9BJw5iV/kZ96/ZcPrF8s1dT6hI?= =?us-ascii?Q?Un61hqsmXpdT5SizPiXHSjhbI4a4h9irRuwPqdv0RIugAuPO3Eo2gSjKqQOD?= =?us-ascii?Q?YL9JfszFV/A1UOypg21QhQDJHaHYkd4D11OGFjvgs6s5IGvWlMcYZ6DFPxri?= =?us-ascii?Q?R0lFizfa13D/dRPZtNmCFmlG76S3Fc7L+C5wycky4kVFgtYIEzM9eczzzY9+?= =?us-ascii?Q?MjzloMB27VzjQJ2nLvtRcvtu3pGM/UmYnHizWRk3QJYd4MLdZ7+c7gUMFQd9?= =?us-ascii?Q?4P4HZRIm7adtAoVjVDfLnujhIIDb5JL2G52V+7bhRgEnrUj4LOyJiDzYxysl?= =?us-ascii?Q?YF0Zmh1gyufGgZVK73CDn26hP29J/pLehI1qJbRRt9sVEuOxYpOV+7vRq0nf?= =?us-ascii?Q?RqPSv0BEHTz52DbKV4GFHd7QxiV2t8/vnyz5k2NxLAc2+XL4fx49GZJ2mgrG?= =?us-ascii?Q?NQ/KnpTttYkT33kgmMzUIJAcUe9ZFUY8n8XusbSX?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ee57431-d650-4cea-4f73-08da6e4c5234 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2022 14:45:30.1763 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZVguyaLjihxlvWduWu3LcmHkuMqC/g3m7KKCfxY0l8Yj8Ywf7GAsa4SczPy9gR3XJrDke7lElmK4/MffE3BS3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6830 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Monday, July 25, 2022 9:36 AM > To: devel@edk2.groups.io > Cc: Andrew Fish ; Ray Ni ; Chang, > Abner ; Yang, Atom ; > Nick Ramirez > Subject: [edk2-staging][PATCH v2 2/2] edk2-staging/EmulatorPkg: Introduce > Hii2RedfishBiosDxe driver >=20 > [CAUTION: External Email] >=20 > Add Hii2RedfishBiosDxe driver with configure language defined in UNI file= in > order to demonstrate the use of Redfish Platform Config Protocol. Feature > drivers under RedfishClientPkg will work with this driver and provide the > REST data to Redfish service. >=20 > Signed-off-by: Nickle Wang > Cc: Andrew Fish > Cc: Ray Ni > Cc: Abner Chang > Cc: Yang Atom > Cc: Nick Ramirez > --- > EmulatorPkg/EmulatorPkg.dec | 1 + > EmulatorPkg/EmulatorPkg.dsc | 1 + > EmulatorPkg/EmulatorPkg.fdf | 1 + > .../Hii2RedfishBiosDxe/Hii2RedfishBiosData.h | 46 +++ > .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c | 291 ++++++++++++++++++ > .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h | 44 +++ > .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf | 55 ++++ > .../Hii2RedfishBiosDxeMap.uni | 20 ++ > .../Hii2RedfishBiosDxeStrings.uni | 30 ++ > .../Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr | 67 ++++ > 10 files changed, 556 insertions(+) > create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h > create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c > create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h > create mode 100644 > EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > create mode 100644 > EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeMap.uni > create mode 100644 > EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeStrings.uni > create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr >=20 > diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec > index 52a62c09c9..e782b15266 100644 > --- a/EmulatorPkg/EmulatorPkg.dec > +++ b/EmulatorPkg/EmulatorPkg.dec > @@ -49,6 +49,7 @@ > gEmuRedfishServiceGuid =3D { 0x3fb208ac, 0x2185, 0x498c, { 0xbf, 0= x46, > 0xdc, 0x23, 0xda, 0x58, 0x7b, 0x55 } } > gHii2RedfishMemoryFormsetGuid =3D { 0xC2BE579E, 0x3C57, 0x499C, { 0xA= 9, > 0xDF, 0xE6, 0x23, 0x8A, 0x49, 0x64, 0xF8 }} > gHii2RedfishBootFormsetGuid =3D { 0x8399a787, 0x108e, 0x4e53, { 0x9e,= 0xde, > 0x4b, 0x18, 0xcc, 0x9e, 0xab, 0x3b }} > + gHii2RedfishBiosFormsetGuid =3D { 0xC2724AD1, 0x4049, 0x2404, { 0xF8, > + 0xCE, 0x01, 0xA7, 0x9C, 0xEC, 0x16, 0xF6 }} >=20 > [PcdsFeatureFlag] > ## If TRUE, if symbols only load on breakpoints and gdb entry diff --g= it > a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index > 1d59b4a1dd..dd1d9ef9ec 100644 > --- a/EmulatorPkg/EmulatorPkg.dsc > +++ b/EmulatorPkg/EmulatorPkg.dsc > @@ -491,6 +491,7 @@ > !if $(REDFISH_ENABLE) =3D=3D TRUE > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > + EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > !endif > !include RedfishPkg/Redfish.dsc.inc > !include RedfishClientPkg/RedfishClient.dsc.inc > diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf > index f9ff4320d9..9e594533d8 100644 > --- a/EmulatorPkg/EmulatorPkg.fdf > +++ b/EmulatorPkg/EmulatorPkg.fdf > @@ -215,6 +215,7 @@ INF EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf > !if $(REDFISH_ENABLE) =3D=3D TRUE > INF EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > INF EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > + INF EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > !endif > !include RedfishPkg/Redfish.fdf.inc > !include RedfishClientPkg/RedfishClient.fdf.inc > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h > new file mode 100644 > index 0000000000..1b27dfd168 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h > @@ -0,0 +1,46 @@ > +/** @file > + The header file of HII-to-Redfish BIOS example driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_BIOS_DATA_H_ > +#define HII_2_REDFISH_BIOS_DATA_H_ > + > +#include > +#include > + > +#define HII_2_REDFISH_BIOS_FORMSET_GUID \ > + { \ > + 0xC2724AD1, 0x4049, 0x2404, { 0xF8, 0xCE, 0x01, 0xA7, 0x9C, 0xEC, 0x= 16, > 0xF6 } \ > + } > + > +extern EFI_GUID gHii2RedfishBiosFormsetGuid; > + > +#define FORM_ID 0x001 > +#define FROM_ID_BIOS_OPTION_1 0x002 > +#define FROM_ID_BIOS_OPTION_2 0x003 > +#define FROM_ID_BIOS_OPTION_3 0x004 > +#define FROM_ID_BIOS_OPTION_4 0x005 > + > +#define ID_STRING_MIN 0 > +#define ID_STRING_MAX 15 > +#define ID_STRING_MAX_WITH_TERMINATOR 16 > + > +#pragma pack() > + > +// > +// Definiton of HII_2_REDFISH_BIOS_VARSTORE_DATA // typedef struct { > + UINT8 RefishBiosOption1Data; > + CHAR16 RefishBiosOption2Data [ID_STRING_MAX_WITH_TERMINATOR]; > + UINT8 RefishBiosOption3Data; > + UINT8 RefishBiosOption4Data; > + UINT8 Reserved; > +} HII_2_REDFISH_BIOS_EFI_VARSTORE_DATA; > + > +#endif > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c > new file mode 100644 > index 0000000000..0d4c90c335 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c > @@ -0,0 +1,291 @@ > +/** @file > + HII-to-Redfish Bios example driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "Hii2RedfishBiosDxe.h" > + > +EFI_GUID mHii2RedfishBiosGuid =3D > HII_2_REDFISH_BIOS_FORMSET_GUID; > +EFI_HII_HANDLE mHiiHandle; > +EFI_HANDLE DriverHandle; > +CHAR16 Hii2RedfishEfiVar[] =3D L"Hii2RedfishBiosEfiVar"; > + > +/// > +/// HII specific Vendor Device Path definition. > +/// > +HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath =3D { > + { > + { > + HARDWARE_DEVICE_PATH, > + HW_VENDOR_DP, > + { > + (UINT8) (sizeof (VENDOR_DEVICE_PATH)), > + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) > + } > + }, > + HII_2_REDFISH_BIOS_FORMSET_GUID > + }, > + { > + END_DEVICE_PATH_TYPE, > + END_ENTIRE_DEVICE_PATH_SUBTYPE, > + { > + (UINT8) (END_DEVICE_PATH_LENGTH), > + (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) > + } > + } > +}; > + > +/** > + Initial HII variable if it does not exist. > + > + @retval EFI_SUCESS HII variable is initialized. > + > +**/ > +EFI_STATUS > +InitialHiiVairable ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINTN BufferSize; > + HII_2_REDFISH_BIOS_EFI_VARSTORE_DATA Hii2RedfishBiosVar; > + > + // > + // Get Buffer Storage data from EFI variable. > + // Try to get the current setting from variable. > + // > + BufferSize =3D sizeof (HII_2_REDFISH_BIOS_EFI_VARSTORE_DATA); > + Status =3D gRT->GetVariable ( > + Hii2RedfishEfiVar, > + &gHii2RedfishBiosFormsetGuid, > + NULL, > + &BufferSize, > + &Hii2RedfishBiosVar > + ); > + if (!EFI_ERROR (Status)) { > + return EFI_SUCCESS; > + } > + > + // > + // Initialization > + // > + Hii2RedfishBiosVar.RefishBiosOption1Data =3D > STR_BIOS_OPTION_1_ITEM_1; > + StrCpyS (Hii2RedfishBiosVar.RefishBiosOption2Data, > + ID_STRING_MAX_WITH_TERMINATOR, L"Default"); > + Hii2RedfishBiosVar.RefishBiosOption3Data =3D 5; > + Hii2RedfishBiosVar.RefishBiosOption4Data =3D TRUE; > + > + Status =3D gRT->SetVariable ( > + Hii2RedfishEfiVar, > + &gHii2RedfishBiosFormsetGuid, > + VARIABLE_ATTRIBUTE_NV_BS, > + BufferSize, > + &Hii2RedfishBiosVar > + ); > + > + return Status; > +} > + > +/** > + This function allows a caller to extract the current configuration > +for one > + or more named elements from the target driver. > + > + @param[in] This Points to the > EFI_HII_CONFIG_ACCESS_PROTOCOL. > + @param[in] Request A null-terminated Unicode string in > + format. > + @param[out] Progress On return, points to a character in the= Request > + string. Points to the string's null ter= minator if > + request was successful. Points to the m= ost recent > + '&' before the first failing name/value= pair (or > + the beginning of the string if the fail= ure is in > + the first name/value pair) if the reque= st was not > + successful. > + @param[out] Results A null-terminated Unicode string in > + format which has all va= lues filled > + in for the names in the Request string.= String to > + be allocated by the called function. > + > + @retval EFI_SUCCESS The Results is filled with the requeste= d values. > + @retval EFI_OUT_OF_RESOURCES Not enough memory to store the > results. > + @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown > name. > + @retval EFI_NOT_FOUND Routing data doesn't match any storage = in > this > + driver. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishBiosExtractConfig ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN CONST EFI_STRING Request, > + OUT EFI_STRING *Progress, > + OUT EFI_STRING *Results > + ) > +{ > + if (Progress =3D=3D NULL || Results =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + if (Request =3D=3D NULL) { > + return EFI_UNSUPPORTED; > + } > + > + // > + // Check whether request for EFI Varstore. EFI varstore get data // > + through hii database, not support in this path. > + // > + if (HiiIsConfigHdrMatch(Request, &gHii2RedfishBiosFormsetGuid, > L"Hii2RedfishBiosEfiVar")) { > + return EFI_UNSUPPORTED; > + } > + > + return EFI_NOT_FOUND; > +} > + > + > +/** > + This function processes the results of changes in configuration. > + > + @param[in] This Points to the > EFI_HII_CONFIG_ACCESS_PROTOCOL. > + @param[in] Configuration A null-terminated Unicode string in > > + format. > + @param[out] Progress A pointer to a string filled in with th= e offset of > + the most recent '&' before the first fa= iling > + name/value pair (or the beginning of th= e string if > + the failure is in the first name/value = pair) or > + the terminating NULL if all was success= ful. > + > + @retval EFI_SUCCESS The Results is processed successfully. > + @retval EFI_INVALID_PARAMETER Configuration is NULL. > + @retval EFI_NOT_FOUND Routing data doesn't match any storage = in > this > + driver. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishBiosRouteConfig ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN CONST EFI_STRING Configuration, > + OUT EFI_STRING *Progress > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a, unsupported\n", __FUNCTION__)); > + > + return EFI_UNSUPPORTED; > +} > + > + > +/** > + This function processes the results of changes in configuration. > + > + @param[in] This Points to the > EFI_HII_CONFIG_ACCESS_PROTOCOL. > + @param[in] Action Specifies the type of action taken by t= he browser. > + @param[in] QuestionId A unique value which is sent to the ori= ginal > + exporting driver so that it can identif= y the type > + of data to expect. > + @param[in] Type The type of value for the question. > + @param[in] Value A pointer to the data being sent to the= original > + exporting driver. > + @param[out] ActionRequest On return, points to the action request= ed > by the > + callback function. > + > + @retval EFI_SUCCESS The callback successfully handled the a= ction. > + @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold > the > + variable and its data. > + @retval EFI_DEVICE_ERROR The variable could not be saved. > + @retval EFI_UNSUPPORTED The specified Action is not supported b= y > the > + callback. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishBiosDriverCallback ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN EFI_BROWSER_ACTION Action, > + IN EFI_QUESTION_ID QuestionId, > + IN UINT8 Type, > + IN EFI_IFR_TYPE_VALUE *Value, > + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a, action: 0x%x QID: 0x%x\n", __FUNCTION__, > +Action, QuestionId)); > + > + return EFI_UNSUPPORTED; > +} > + > +EFI_HII_CONFIG_ACCESS_PROTOCOL mHii2RedfishConfigAccess =3D { > + Hii2RedfishBiosExtractConfig, > + Hii2RedfishBiosRouteConfig, > + Hii2RedfishBiosDriverCallback > +}; > + > +/** > + Main entry for this driver. > + > + @param[in] ImageHandle Image handle this driver. > + @param[in] SystemTable Pointer to SystemTable. > + > + @retval EFI_SUCESS This function always complete successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishBiosDxeDriverEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + DriverHandle =3D NULL; > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > + &DriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mHiiVendorDevicePath, > + &gEfiHiiConfigAccessProtocolGuid, > + &mHii2RedfishConfigAccess, > + NULL > + ); > + > + // > + // Publish our HII data > + // > + mHiiHandle =3D HiiAddPackages ( > + &mHii2RedfishBiosGuid, > + DriverHandle, > + Hii2RedfishBiosDxeStrings, > + Hii2RedfishBiosVfrBin, > + NULL > + ); > + if (mHiiHandle =3D=3D NULL) { > + return EFI_OUT_OF_RESOURCES; > + } > + > + Status =3D InitialHiiVairable (); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to initial variable: %r\n", > + __FUNCTION__, Status)); } > + > + return EFI_SUCCESS; > +} > + > +/** > + Unloads the application and its installed protocol. > + > + @param[in] ImageHandle Handle that identifies the image to be > unloaded. > + > + @retval EFI_SUCCESS The image has been unloaded. > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishBiosDxeDriverUnload ( > + IN EFI_HANDLE ImageHandle > + ) > +{ > + if (mHiiHandle !=3D NULL) { > + HiiRemovePackages (mHiiHandle); > + } > + > + return EFI_SUCCESS; > +} > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h > new file mode 100644 > index 0000000000..b7f9aceeb0 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h > @@ -0,0 +1,44 @@ > +/** @file > + HII-to-Redfish BIOS example driver header file. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_BIOS_DXE_H_ > +#define HII_2_REDFISH_BIOS_DXE_H_ > + > +#include > +#include > +#include > +#include > +#include > +#include #include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include "Hii2RedfishBiosData.h" > + > +extern UINT8 Hii2RedfishBiosVfrBin[]; > + > +#pragma pack(1) > + > +/// > +/// HII specific Vendor Device Path definition. > +/// > +typedef struct { > + VENDOR_DEVICE_PATH VendorDevicePath; > + EFI_DEVICE_PATH_PROTOCOL End; > +} HII_VENDOR_DEVICE_PATH; > + > +#pragma pack() > + > +#endif > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > new file mode 100644 > index 0000000000..06080113a1 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf > @@ -0,0 +1,55 @@ > +## @file > +# HII-to-Redfish BIOS Example driver. > +# > +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # ## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D Hii2RedfishBiosDxe > + FILE_GUID =3D 9A7FA287-4038-CB66-DC70-92AE8C0FCF7= 3 > + MODULE_TYPE =3D UEFI_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D Hii2RedfishBiosDxeDriverEntryPoint > + UNLOAD_IMAGE =3D Hii2RedfishBiosDxeDriverUnload > + > +[Sources] > + Hii2RedfishBiosDxe.c > + Hii2RedfishBiosDxe.h > + Hii2RedfishBiosData.h > + Hii2RedfishBiosVfr.vfr > + Hii2RedfishBiosDxeStrings.uni > + Hii2RedfishBiosDxeMap.uni > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + EmulatorPkg/EmulatorPkg.dec > + > +[LibraryClasses] > + UefiDriverEntryPoint > + BaseLib > + BaseMemoryLib > + DebugLib > + PcdLib > + MemoryAllocationLib > + UefiBootServicesTableLib > + UefiRuntimeServicesTableLib > + UefiLib > + PrintLib > + HiiLib > + > +[Protocols] > + gEfiDevicePathProtocolGuid > + gEfiHiiConfigAccessProtocolGuid > + > + > +[Guids] > + gHii2RedfishBiosFormsetGuid > + > +[Depex] > + gEfiHiiDatabaseProtocolGuid > + > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeMap.uni > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeMap.uni > new file mode 100644 > index 0000000000..51d6d7ecb8 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeMap.uni > @@ -0,0 +1,20 @@ > +/** @file > + HII-to-Redfish BIOS example driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > +#langdef x-uefi-redfish-Bios.v1_0_9 "Bios.v1_0_9" > + > +#string STR_BIOS_OPTION_1_PROMPT #language x-uefi-redfish- > Bios.v1_0_9 "/Bios/Attributes/BiosOption1" > +#string STR_BIOS_OPTION_2_PROMPT #language x-uefi-redfish- > Bios.v1_0_9 "/Bios/Attributes/BiosOption2" > +#string STR_BIOS_OPTION_3_PROMPT #language x-uefi-redfish- > Bios.v1_0_9 "/Bios/Attributes/BiosOption3" > +#string STR_BIOS_OPTION_4_PROMPT #language x-uefi-redfish- > Bios.v1_0_9 "/Bios/Attributes/BiosOption4" > + > +#string STR_BIOS_OPTION_1_ITEM_1 #language x-uefi-redfish- > Bios.v1_0_9 "Item #1" > +#string STR_BIOS_OPTION_1_ITEM_2 #language x-uefi-redfish- > Bios.v1_0_9 "Item #2" > +#string STR_BIOS_OPTION_1_ITEM_3 #language x-uefi-redfish- > Bios.v1_0_9 "Item #3" > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeStrings.uni > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeStrings.uni > new file mode 100644 > index 0000000000..84311e72a4 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeStrings.uni > @@ -0,0 +1,30 @@ > +#string /** @file > + HII-to-Redfish BIOS example driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > +#langdef en-US "English" > + > +#string STR_FORM_SET_TITLE #language en-US "HII t= o Redfish > (BIOS)" > +#string STR_FORM_SET_TITLE_HELP #language en-US "HII t= o > Redfish (BIOS)" > +#string STR_FORM_TITLE #language en-US "HII t= o Redfish > BIOS properties" > + > +#string STR_BIOS_OPTION_1_PROMPT #language en-US "HII > Redfish BIOS Option 1" > +#string STR_BIOS_OPTION_2_PROMPT #language en-US "HII > Redfish BIOS Option 2" > +#string STR_BIOS_OPTION_3_PROMPT #language en-US "HII > Redfish BIOS Option 3" > +#string STR_BIOS_OPTION_4_PROMPT #language en-US "HII > Redfish BIOS Option 4" > + > +#string STR_BIOS_OPTION_1_HELP #language en-US "HII R= edfish > BIOS Option 1" > +#string STR_BIOS_OPTION_2_HELP #language en-US "HII R= edfish > BIOS Option 2" > +#string STR_BIOS_OPTION_3_HELP #language en-US "HII R= edfish > BIOS Option 3" > +#string STR_BIOS_OPTION_4_HELP #language en-US "HII R= edfish > BIOS Option 4" > + > +#string STR_BIOS_OPTION_1_ITEM_1 #language en-US "Item = #1" > +#string STR_BIOS_OPTION_1_ITEM_2 #language en-US "Item = #2" > +#string STR_BIOS_OPTION_1_ITEM_3 #language en-US "Item = #3" > + > diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr > b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr > new file mode 100644 > index 0000000000..896feda541 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr > @@ -0,0 +1,67 @@ > +/** @file > + HII-to-Redfish BIOS example driver VFR file. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > + > +#include "Hii2RedfishBiosData.h" > + > +formset > + guid =3D HII_2_REDFISH_BIOS_FORMSET_GUID, > + title =3D STRING_TOKEN(STR_FORM_SET_TITLE), > + help =3D STRING_TOKEN(STR_FORM_SET_TITLE_HELP), > + classguid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID, > + > + // > + // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI) // > + efivarstore HII_2_REDFISH_BIOS_EFI_VARSTORE_DATA, > + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures > + name =3D Hii2RedfishBiosEfiVar, > + guid =3D HII_2_REDFISH_BIOS_FORMSET_GUID; > + > + // > + // Define a Form (EFI_IFR_FORM) > + // > + form formid =3D FORM_ID, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE); // Form title > + > + oneof varid =3D Hii2RedfishBiosEfiVar.RefishBiosOption1Data, > + questionid =3D FROM_ID_BIOS_OPTION_1, > + prompt =3D STRING_TOKEN(STR_BIOS_OPTION_1_PROMPT), > + help =3D STRING_TOKEN(STR_BIOS_OPTION_1_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_BIOS_OPTION_1_ITEM_1), = value > =3D STR_BIOS_OPTION_1_ITEM_1, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_BIOS_OPTION_1_ITEM_2), = value > =3D STR_BIOS_OPTION_1_ITEM_2, flags =3D 0; > + option text =3D STRING_TOKEN(STR_BIOS_OPTION_1_ITEM_3), = value > =3D STR_BIOS_OPTION_1_ITEM_3, flags =3D 0; > + endoneof; > + > + string varid =3D Hii2RedfishBiosEfiVar.RefishBiosOption2Data, > + prompt =3D STRING_TOKEN(STR_BIOS_OPTION_2_PROMPT), > + help =3D STRING_TOKEN(STR_BIOS_OPTION_2_HELP), > + flags =3D READ_ONLY, > + minsize =3D ID_STRING_MIN, > + maxsize =3D ID_STRING_MAX, > + endstring; > + > + numeric varid =3D Hii2RedfishBiosEfiVar.RefishBiosOption3Data, > + prompt =3D STRING_TOKEN(STR_BIOS_OPTION_3_PROMPT), > + help =3D STRING_TOKEN(STR_BIOS_OPTION_3_HELP), > + minimum =3D 0, > + maximum =3D 0xff, > + step =3D 1, > + default =3D 20, > + endnumeric; > + > + checkbox varid =3D Hii2RedfishBiosEfiVar.RefishBiosOption4Data, > + prompt =3D STRING_TOKEN(STR_BIOS_OPTION_4_PROMPT), > + help =3D STRING_TOKEN(STR_BIOS_OPTION_4_PROMPT), > + flags =3D CHECKBOX_DEFAULT, > + default =3D TRUE, > + endcheckbox; > + endform; > +endformset; > -- > 2.32.0.windows.2