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.web09.3389.1653456608932570928 for ; Tue, 24 May 2022 22:30:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=fEloxH5M; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=01442dc6a1=abner.chang@hpe.com) Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24P2n5NC018345 for ; Wed, 25 May 2022 05:30:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=LjTKKqQVNRAF06j+efluSCmsvczm1xj0hdsS9Ln688k=; b=fEloxH5MJdkrWnm4bGYkDT+TczLSf7HowyKWtz9mZTtxaoBWO3eIZTIkSDy8m9JzeFLj NCpKBKrT0uY6ZBHjj9C9cYOZidl2AUhT/7yTv5H91B7R9qA0XhXa9XdWVVfHVs5JQju7 RYnMjZMp1DCB8DSKWyRi7FEEJ3Ox/RsBF8HWKMzH5BmE1rHGD+JpyIbvPQc2Yj1fz681 bnEy60hN5XA2aCjOS/aHvVvqgKHDU8n7T92U0AKRpzb+W8N3L5gt0IR6EkS33FKCoOh9 PIznvMwi0ZT3WyrEXh1SGlzr2ddbBl43JnD6yruMCE4UJPEKQjDZnaYqnQvotvEuiEUI pg== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3g9c07h0bf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 May 2022 05:30:07 +0000 Received: from p1wg14923.americas.hpqcorp.net (unknown [10.119.18.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id DD8021304A for ; Wed, 25 May 2022 05:30:06 +0000 (UTC) Received: from p1wg14927.americas.hpqcorp.net (10.119.18.117) by p1wg14923.americas.hpqcorp.net (10.119.18.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 24 May 2022 17:29:40 -1200 Received: from p1wg14919.americas.hpqcorp.net (16.230.19.122) by p1wg14927.americas.hpqcorp.net (10.119.18.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15 via Frontend Transport; Tue, 24 May 2022 17:29:40 -1200 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (192.58.206.38) by edge.it.hpe.com (16.230.19.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 24 May 2022 17:29:39 -1200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JcK/aOWnQHENAFIa8jXNJOzR7rMv1qHBLjbL+73pKhEeKjTpfKk+sDb1Vo2OpAng/v82Yo08iWiHkQ6e3hzdmm76z/73Hue8zqNdWn9AT7bh5CJOmnzQkPVmoxSBU8qYfh/NH6AnDKTwfOnUi7Yc3SskIQ6OXUwsOFzq0hn/s1QqAeKdXYoZn0vOTGFzrN0yB3KRvtNI2cLmrXO/VzXqC9Z32zph5w/TikAqYKB5zI6IwQQQTEnHfW8ef7PcUVMMM2gKfM8XFLwrGI8F/5hFzLqtDgdEfSAXRSucN5q+U0d+Ws0FpUS17fo5NTmlLEoPr0raOM6m/uneR6FcmDcV9Q== 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=RoVAqGfvYKwvcV0IVewCtZygpizw58nGL2l5puawGDQ=; b=AaCc55lHvFf53L5kGJAVpvc0xc13hF2nk2VVVu3WE4XvYjngwxY/9p/Gp38cEX/beMb87L5ytqdlLTd6F3vj/kMjZ7pvKNJeK5DYwz9Yufs2UrffiAUsTWpEStMAfykUNai89iBdud0fgJTbEBFIwXkjX1J7F7ODItjZlL+h/H7rVEEDWFN+BfuZjjXAve1VXQlEEF7c3idlrgOjBXTBPV2spW9LyHYwqmXJs/xXNcT9yDPNN3obVema/ryPl9/LdzulawiUW8R+HSJ54RJfVdCtfc998v3T38IfZYzRHiZoT5WK5DMaj19VOmwTzGjqW0uwFHl6gUWpQ6f7ZTZeWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:173::6) by DM4PR84MB1808.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:4f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.23; Wed, 25 May 2022 05:29:37 +0000 Received: from PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::94de:c9c9:b94f:52a9]) by PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::94de:c9c9:b94f:52a9%7]) with mapi id 15.20.5293.013; Wed, 25 May 2022 05:29:37 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "Wang, Nickle (Server BIOS)" Subject: Re: [edk2-devel] [edk2-staging][PATCH v2 1/3] edk2-staging/RedfishClientPkg: Introduce Redfish event library Thread-Topic: [edk2-devel] [edk2-staging][PATCH v2 1/3] edk2-staging/RedfishClientPkg: Introduce Redfish event library Thread-Index: AQHYb+WJzncdLwYnPk2Pk6CxWZ1q+K0vEPwg Date: Wed, 25 May 2022 05:29:37 +0000 Message-ID: References: <20220525031343.583-1-nickle.wang@hpe.com> In-Reply-To: <20220525031343.583-1-nickle.wang@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: db1cf223-a051-4102-e1a3-08da3e0f8f66 x-ms-traffictypediagnostic: DM4PR84MB1808:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Daf3rHfjBxLBJlx8WrNw0JfkKac2B4yAP1hURcGk4LRraFxeYcgEZNmaxD1lr7VGsGIaAtXuFnJEfjQBGB5+DvceWQXX3GG9NvdR7UwrMK3Hqbk30iTduKlK7XqnZlyYrAbofQlkH+zEgWYKBOD8EwbnjW08FlR0wCd1p716NNt9tq8OaIZ04KymtMZ2E5PQ3dScYGUOs+jtn/3GzVh7JVIryFaPp9cSDsbOGj53GuGlPV85JAnOowXr5WLOYFs0K9uceSqKZzTG1lbijG/EocJUr4b+YDc/gBsQ2vHkjtaLxdR2PVUvpXQd66N6BOqq2yTYgZmj+PoROEvf1G1hwxY/qDUbz7wxyEdFRrotbQ+rAYwXfh5hw9fOSXIPku3/a9VZAtwZkeBBLcdv6SCeACGSR4clh2jLqDcSBcv1ndiLRXdbcS/9IPPMgTDK5+50IdN97zkqIGGdxMbRwMyJMoyk/i0Uw25v62e0BfnQLf+aA4ifhhvOmqvPyi0vXWejPSdo6PwWYXXql+LR8UaLiWMoWzmwaajullyeyldtxjHfavA2F0IVy6ojjgEFPRQ4LNf04GbXSYidkpnDzS+JzWCq5fTMZUq2EUqRHsB+Zyh4InfabHe1xgXT5iLkA79LlYz6igcUxuvnq0lHd8r2I+8uDvuk+//c3STEwMM2KHkCxNh4KJjNzJphhIf6a6DY+/WqxxLp1F9E9wIK2E5F9X+YjfCukoVmXhNqGluZxgEivV/Ia39oJMmSpjOugehLUTFwyIRNDUtqgz1Q+QWGHi0LF5wJxCxfl7kgGeHy5uqII4/8pkCJdBc70mzRnYAlqUjqfva0YmP5UgRK10sEIA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(366004)(9686003)(508600001)(66556008)(6506007)(7696005)(26005)(52536014)(30864003)(53546011)(8936002)(33656002)(8676002)(71200400001)(38070700005)(38100700002)(82960400001)(86362001)(66946007)(66446008)(64756008)(66476007)(110136005)(122000001)(966005)(186003)(2906002)(76116006)(55016003)(6636002)(316002)(83380400001)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nYR+NJVp/2WbMvXOgreFeCbTdZzCosWC57NFCOTp/9mWMR5PpeOwI0aEpj+U?= =?us-ascii?Q?sDyyjP/iRo93FR2HmtZgiMFonEwqglcQRqSATkbNgkOqyY8XisG72tY57ezX?= =?us-ascii?Q?P8PJYvmYAarfSw6eSrKcXX5VCsU6TOHJvWyaNS+GenBj6txWqI6PChcMZxL0?= =?us-ascii?Q?5VhSvHa16SaZ1ITC0HWH3Ohae5kRRX1Owc4Jr5zFxxoSh6e2SfqlSgp53Lzh?= =?us-ascii?Q?2Yi0cwMuXqNOUyp+JWT1+y9PQEbCUVQ1i7QqcZUFMKb76FJqXMYYPBc3n8l8?= =?us-ascii?Q?wJ2uTrcnYs8sxSPtlE71tbUFsypLGvS2Tb7QoMtM4pwZwZJ+uvAoEa1EwU1A?= =?us-ascii?Q?FVuQBCYugEsYDpZQdwArD4kXOy8F6UshBGUVIqN428iVUd1OVBUXhCBejfDc?= =?us-ascii?Q?Dc4Ix5PsDcVZzdQTig+4aQA0GJvcw3voUGyu+ecyFG1sfZwgPl/TZi4jqfrj?= =?us-ascii?Q?+jYBNdin8Vp9Doe11Pjx9570JcfqJFM16TrtNi8n9q0goRmljEAsEdmU5llU?= =?us-ascii?Q?ZmRee5bDwl3oXLMyQDUJKCUqwuzKZEnPshnOPk565Wsti5qrD50Etilpxc5M?= =?us-ascii?Q?TGVi03Sz5u374J3P3EzoRVBybA+ixZChHuVQ/2HaNtervi0F/x445eex3UT3?= =?us-ascii?Q?3AECqQyTTqFs3bz72Z/ZEinpLYU4yLqbx7Y6Dfqzu2sRTfeityLGhKrEf3+8?= =?us-ascii?Q?jNLjZlGQu5Jg2n7F0p1ZCpP3lJ+D6tZv01V0mKoBUAS0rAqmwYB2Vj4kFoJV?= =?us-ascii?Q?YvK5GXnmGKv0YyXwV3zYYBhUfryDv8tWefzks4ThOr5LA4kJHOXvNFxGKQP5?= =?us-ascii?Q?zLQ3OHElrb7DnaXdjlL9IBn8ctPdX/piLMYmK5Iawt4Uu5J5HHx/YHCAO9Sg?= =?us-ascii?Q?PMfmTPiGNvnfwHPkDi3Koe7JqBHKtCJiV1ADKw7q6Lmka45g/dOq2E8yNVSS?= =?us-ascii?Q?ULhxqpwjTFTGmaQh29tZknOSlUi7crGeVv5pylzD7P43tFiN9+z7W/wemfkL?= =?us-ascii?Q?ghY1NovRrkDGMO96wbvewDDCnUscZzCy/+hvsDoHr46N00R7RRr5l6qHNM/q?= =?us-ascii?Q?rVccAyMwrt1NXNUAIHHw+JBAvJs0bgm1ZS8+yP07P1nc1M3kRKjFdQDQ86Sc?= =?us-ascii?Q?f1lm6YsFJLTf/vklGhjzkQ2NCbxN5/Dx9AHnvehB9gXGAs1oP3FiilP+yERm?= =?us-ascii?Q?hlmTZrU3JKX8frlFiGGchYDDnH+r0A/Vyfb0JRmyUJwjtuRgVo+VsYcdyPB1?= =?us-ascii?Q?DRi0JS86qRX91wwcRHKDnm4NCCjsOLQ7zBTM1ILll5Ytc4yJwwEl+2Fpx7qc?= =?us-ascii?Q?u1AH005MfVmchb/zoL0QF9Ec7S66FunEr7KybIXtlsUJwtc2f4IIzj+t1aji?= =?us-ascii?Q?JsyB/PyiQrrSeKE03WSrgbIGWroXARcbgacdvBC+CfVaCLPkrk05K9ASa+ON?= =?us-ascii?Q?efeUyLQVhF7XR5jTqdsbDUcrzmBIHveG5JqaS3jainkMOOGGMT5gcfBZOLrt?= =?us-ascii?Q?jBIZrflmdELO7kI87FcZsQHcw/AVZ0TF9NyFrKaIlCz/GTdJX5H1Oobfx7/E?= =?us-ascii?Q?QOceqQtpt/8kTQtKeKOUtD7emyRk67HP9nM9y0u2sKfIpYYiDNd4cdrTx0e7?= =?us-ascii?Q?qHFbN+3cGWDtL8sOyorDP/txUXyjEkyAArb8y6yFAUl4nuDHfJGlXWts2GtS?= =?us-ascii?Q?iK6mJErK+Wp6qhHOU/H2+sSXbIhnDCA/zqCr+m9xT/hein0thRSRH0eE/ntv?= =?us-ascii?Q?9fbGaRaCUw=3D=3D?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: db1cf223-a051-4102-e1a3-08da3e0f8f66 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2022 05:29:37.7506 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VYuJcsz/dAMSS9yjHTSdR02nyZmf32lns/8feT3EK8+l9vOXGZ7kE0ekNxQ0bt4wIYvIlZN3nPcbUkMICJtLpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR84MB1808 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: O6lDp3OvYt-OU-q5ZPTILyz_XJGquJ7_ X-Proofpoint-GUID: O6lDp3OvYt-OU-q5ZPTILyz_XJGquJ7_ X-Proofpoint-UnRewURL: 2 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-25_01,2022-05-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=966 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205250028 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Abner Chang > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Nickle > Wang > Sent: Wednesday, May 25, 2022 11:14 AM > To: devel@edk2.groups.io > Cc: Wang, Nickle (Server BIOS) ; Chang, Abner (HPS > SW/FW Technologist) > Subject: [edk2-devel] [edk2-staging][PATCH v2 1/3] edk2- > staging/RedfishClientPkg: Introduce Redfish event library >=20 > Add RedfishEventLib to Redfish client package. This library provides > interface for Redfish feature drivers to listen to Redfish event > such as the event before provisioning and the event after > provisioning. Feature driver can perform additional operation before > and after Redfish provisioning. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > --- > .../Include/Guid/RedfishClientEventGroup.h | 27 ++++ > .../Include/Library/RedfishEventLib.h | 77 ++++++++++ > .../Library/RedfishEventLib/RedfishEventLib.c | 139 ++++++++++++++++++ > .../RedfishEventLib/RedfishEventLib.inf | 38 +++++ > RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +- > RedfishClientPkg/RedfishClientPkg.dec | 7 +- > 6 files changed, 288 insertions(+), 2 deletions(-) > create mode 100644 > RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h > create mode 100644 RedfishClientPkg/Include/Library/RedfishEventLib.h > create mode 100644 > RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c > create mode 100644 > RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf >=20 > diff --git a/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h > b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h > new file mode 100644 > index 0000000000..0d88dd4726 > --- /dev/null > +++ b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h > @@ -0,0 +1,27 @@ > +/** @file > + GUID for Redfish Client Event Group GUID > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef REDFISH_CLIENT_EVENT_GROUP_GUID_H_ > +#define REDFISH_CLIENT_EVENT_GROUP_GUID_H_ > + > +#define REDFISH_CLIENT_FEATURE_READY_TO_PROVISIONING_GUID \ > + { \ > + 0x77E4FC1C, 0x2428, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x= 4E, > 0xF0 } \ > + } > + > +extern EFI_GUID gEfiRedfishClientFeatureReadyToProvisioningGuid; > + > +#define REDFISH_CLIENT_FEATURE_AFTER_PROVISIONING_GUID \ > + { \ > + 0xE547CB6F, 0x306F, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x= 2E, > 0xD0 } \ > + } > + > +extern EFI_GUID gEfiRedfishClientFeatureAfterProvisioningGuid; > + > +#endif > diff --git a/RedfishClientPkg/Include/Library/RedfishEventLib.h > b/RedfishClientPkg/Include/Library/RedfishEventLib.h > new file mode 100644 > index 0000000000..9b553f4425 > --- /dev/null > +++ b/RedfishClientPkg/Include/Library/RedfishEventLib.h > @@ -0,0 +1,77 @@ > +/** @file > + This file defines the Redfish event library interface. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef REDFISH_EVENT_LIB_H_ > +#define REDFISH_EVENT_LIB_H_ > + > +#include > + > +/** > + Create an EFI event before Redfish provisioning start. > + > + @param NotifyFunction The notification function to call wh= en the > event is signaled. > + @param NotifyContext The content to pass to NotifyFunctio= n when > the event is signaled. > + @param ReadyToProvisioningEvent Returns the EFI event returned from > gBS->CreateEvent(Ex). > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +EFIAPI > +CreateReadyToProvisioningEvent ( > + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL > + IN VOID *NotifyContext, OPTIONAL > + OUT EFI_EVENT *ReadyToProvisioningEvent > + ); > + > +/** > + Create an EFI event after Redfish provisioning finished. > + > + @param NotifyFunction The notification function to call wh= en the > event is signaled. > + @param NotifyContext The content to pass to NotifyFunctio= n when > the event is signaled. > + @param ReadyToProvisioningEvent Returns the EFI event returned from > gBS->CreateEvent(Ex). > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +EFIAPI > +CreateAfterProvisioningEvent ( > + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL > + IN VOID *NotifyContext, OPTIONAL > + OUT EFI_EVENT *ReadyToProvisioningEvent > + ); > + > +/** > + Signal ready to provisioning event. > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +SignalReadyToProvisioningEvent ( > + VOID > + ); > + > +/** > + Signal after provisioning event. > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +SignalAfterProvisioningEvent ( > + VOID > + ); > + > +#endif > diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c > b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c > new file mode 100644 > index 0000000000..34aa4cac46 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c > @@ -0,0 +1,139 @@ > +/** @file > + Redfish event library implementation. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +/** > + Create an EFI event before Redfish provisioning start. > + > + @param NotifyFunction The notification function to call wh= en the > event is signaled. > + @param NotifyContext The content to pass to NotifyFunctio= n when > the event is signaled. > + @param ReadyToProvisioningEvent Returns the EFI event returned from > gBS->CreateEvent(Ex). > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +EFIAPI > +CreateReadyToProvisioningEvent ( > + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL > + IN VOID *NotifyContext, OPTIONAL > + OUT EFI_EVENT *ReadyToProvisioningEvent > + ) > +{ > + EFI_STATUS Status; > + > + Status =3D gBS->CreateEventEx ( > + EVT_NOTIFY_SIGNAL, > + TPL_CALLBACK, > + (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : > NotifyFunction), > + NotifyContext, > + &gEfiRedfishClientFeatureReadyToProvisioningGuid, > + ReadyToProvisioningEvent > + ); > + > + return Status; > +} > + > +/** > + Create an EFI event after Redfish provisioning finished. > + > + @param NotifyFunction The notification function to call wh= en the > event is signaled. > + @param NotifyContext The content to pass to NotifyFunctio= n when > the event is signaled. > + @param ReadyToProvisioningEvent Returns the EFI event returned from > gBS->CreateEvent(Ex). > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +EFIAPI > +CreateAfterProvisioningEvent ( > + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL > + IN VOID *NotifyContext, OPTIONAL > + OUT EFI_EVENT *ReadyToProvisioningEvent > + ) > +{ > + EFI_STATUS Status; > + > + Status =3D gBS->CreateEventEx ( > + EVT_NOTIFY_SIGNAL, > + TPL_CALLBACK, > + (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : > NotifyFunction), > + NotifyContext, > + &gEfiRedfishClientFeatureAfterProvisioningGuid, > + ReadyToProvisioningEvent > + ); > + > + return Status; > +} > + > +/** > + Signal ready to provisioning event. > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +SignalReadyToProvisioningEvent ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + EFI_EVENT Event; > + > + Status =3D CreateReadyToProvisioningEvent (NULL, NULL, &Event); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\= n", > __FUNCTION__)); > + return Status; > + } > + > + gBS->SignalEvent (Event); > + gBS->CloseEvent (Event); > + > + return EFI_SUCCESS; > +} > + > +/** > + Signal after provisioning event. > + > + @retval EFI_SUCCESS Event was created. > + @retval Other Event was not created. > + > +**/ > +EFI_STATUS > +SignalAfterProvisioningEvent ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + EFI_EVENT Event; > + > + Status =3D CreateAfterProvisioningEvent (NULL, NULL, &Event); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\= n", > __FUNCTION__)); > + return Status; > + } > + > + gBS->SignalEvent (Event); > + gBS->CloseEvent (Event); > + > + return EFI_SUCCESS; > +} > + > diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf > b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf > new file mode 100644 > index 0000000000..edafca0c65 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf > @@ -0,0 +1,38 @@ > +## @file > +# > +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x00010006 > + BASE_NAME =3D RedfishEventLib > + FILE_GUID =3D C4F7E27D-2338-43EA-9D1F-D10960E3652= 1 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D RedfishEventLib| DXE_DRIVER UEFI_DR= IVER > + > +# > +# VALID_ARCHITECTURES =3D IA32 X64 EBC > +# > + > +[Sources] > + RedfishEventLib.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RedfishPkg/RedfishPkg.dec > + RedfishClientPkg/RedfishClientPkg.dec > + > +[LibraryClasses] > + BaseLib > + DebugLib > + UefiBootServicesTableLib > + UefiLib > + > +[Guids] > + gEfiRedfishClientFeatureReadyToProvisioningGuid > + gEfiRedfishClientFeatureAfterProvisioningGuid > diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc > b/RedfishClientPkg/RedfishClientLibs.dsc.inc > index 5467acedd0..91e5de4296 100644 > --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc > +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc > @@ -27,4 +27,4 @@ >=20 > RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red > fishPlatformConfigLib.inf >=20 > RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/ > RedfishContentCodingLibNull.inf >=20 > ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/Converte > rCommonLib/ConverterCommonLib.inf > - > + > RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.= i > nf > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index 09df062dd3..56e542f03c 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -1,7 +1,7 @@ > ## @file > # Redfish Client Package > # > -# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > ## > @@ -21,6 +21,7 @@ >=20 > [LibraryClasses] > RedfishFeatureUtilityLib|Include/Library/RedfishFeatureUtilityLib.h > + RedfishEventLib|Include/Library/RedfishEventLib.h >=20 > [LibraryClasses.Common.Private] > ## @libraryclass Redfish Helper Library > @@ -39,6 +40,10 @@ > ## Include/Guid/RedfishClientPkgTokenSpace.h > gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee= , > { 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } } >=20 > + ## Include/Guid/RedfishClientEventGroup.h > + gEfiRedfishClientFeatureReadyToProvisioningGuid =3D { 0x77E4FC1C, 0x24= 28, > 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E, 0xF0 } } > + gEfiRedfishClientFeatureAfterProvisioningGuid =3D { 0xE547CB6F, 0x30= 6F, > 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E, 0xD0 } } > + > [PcdsFixedAtBuild] >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32| > UINT32|0x10000001 >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8| > UINT32|0x10000002 > -- > 2.32.0.windows.2 >=20 >=20 >=20 >=20 >=20