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.70]) by mx.groups.io with SMTP id smtpd.web10.2186.1681973544704120859 for ; Wed, 19 Apr 2023 23:52:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=OxtQzG3r; 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.243.70, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=csPBNd3KVVFKJX7cE2H7AfYyobweIw25tpEz+n1nYqK98Ioe3LnXGnwqCOOGGEqW5pMnLJ4CsOMCxyWpWnyM+ySKpc8yn9SXCBgq7XinKaHh1M0HYDOTjQ9Pul9L0lbt29KqHlmTxtOqlC3OLB8dBbTLSa0Mesxqpa9cx3tafytVDt8Uu+/LWCX/5TeWT11MiCVeLtZ+T9JZZGvdvAXpaJNst3/34Hyj9uHs6lxI0IhHRXFaY9WsCSKvAYcD8XCMWSJh6W23RuR2pdrpBBYT6ANgWFXX9qY5ZpueucwotZaEqAaI2mksf0/09y/+/2YuuyOg2lQX5rlR6+mmRmPH0w== 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=2yO7n9Jg+dTv0ejSnVzYbf82cSFnvLDQipIqXFXHQDE=; b=lZUJxsWaU8T9+mzKKAZQFF+ZBDrF82DSPoVXA2w0CcH4NGbqm7hWPTCDIVVkzEo1DHtrYRd8cl+sznyQBJID5TTITwLL9Thgt49uUufV7Nu748vkijL3Opv/QyEYaYvp+iD/OByWOkysYQvihM8EH+QnhE9dvEUDOaEA3ie0vnXEBx7gXzNSOXMYOtA7ad7KXqB/Vlgsb8yRKsMXM34UClxKkiT53IK2GAZHDG2/qeInfnJLQ6mXkwll3Q1EUjSJMHOwNOGXejszZfS+SltBkGW4ZUCENHVRZ0IznUClMg/VlsqidD7segeSHUkKNDjnhcMIC3MpW0gAJqIusg6M7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=2yO7n9Jg+dTv0ejSnVzYbf82cSFnvLDQipIqXFXHQDE=; b=OxtQzG3rQEG0EP1WqPL9WsV1a1EZOMuVbVSVBfwvgKyzM6caatEZTgDcStdo+Wobz1p8LvSsafsit2R5SBnsNPNUjVETFsEkyguqpMvGfaBBfFrGMz5DHcHaL854Ol1M0dNEt4oIeyrO5hAFR14a/Ptvl3QwqB6UG1eUIAcZkOsZnYgvs8eSCjMhRgpqffc9qFqnm0A2tBZr6W10gNIyZRmhvLe3eOoxBLcCUY9XAMgvbHbvdLvVMITqyLHN5HSGXD+Ihb5V/gB7BBAn8JfBZiy0+QcZrEak1+NGpLT+9gUVdQT80D+smZIgVRCzp3xHjjd8nQT1CsKAPH2epSjmyA== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by PH7PR12MB7819.namprd12.prod.outlook.com (2603:10b6:510:27f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Thu, 20 Apr 2023 06:52:21 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::d9df:b45b:2cc1:f017]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::d9df:b45b:2cc1:f017%5]) with mapi id 15.20.6319.022; Thu, 20 Apr 2023 06:52:21 +0000 From: "Nickle Wang" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Isaac Oram , Abdul Lateef Attar , Igor Kulchytskyy Subject: Re: [edk2-platforms][PATCH V2 05/14] ManageabilityPkg: Add PldmSmbiosTransferDxe driver Thread-Topic: [edk2-platforms][PATCH V2 05/14] ManageabilityPkg: Add PldmSmbiosTransferDxe driver Thread-Index: AQHZccW2o3Bngb1USEq0qIkYOnFqw68zxa5A Date: Thu, 20 Apr 2023 06:52:21 +0000 Message-ID: References: <20230418071543.1951-1-abner.chang@amd.com> <20230418071543.1951-6-abner.chang@amd.com> In-Reply-To: <20230418071543.1951-6-abner.chang@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|PH7PR12MB7819:EE_ x-ms-office365-filtering-correlation-id: e6426671-9377-41bc-16d9-08db416bca4e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: avJNydA6kL0hubaJ1g7U7U5AgSi3PH+ixfilDHfb7higG9T8KKl98jHk12qHV81ywf7zLLHzfNiALB2HASADnSqnauJhGddXcRnEsCwiQz5Zgi0jITWRsy2dkzXbkaLqr2HtBoBO2XCa4IyXLqa5arn6H2Ex+E6HqsUi3i5s3b7qLmbyylJJ2Y2EmPj8bUS29Mdlvv4t7nxvf0LTiJYucOXVPA9YnI58Iczuy2pjgr1NNk6c3i852G2ZNNn5ybNYVT8+2QUfLBIXmavJE/NM4QFTKfA98l6lFdeDwShsn3kYz/PjpB1QDO7sgsLL3qkWFaBFbjC4CxOzUQQoWz8xlu+N7H+B/pGQc5oRIwQzPxP6hZbCUHhU8F5sS/CahN5AKhbKXOhK2QudbHFBpkb2q4UiwObKEmTsS3J45VTBdPqt87BIZxVzDRvErDDd6xhn3Hks40zK8Piq/WxD6YLMf9GdAWqHoMDH9haSK78qzxJi+VKYD2B6PpgZ1gzo10Jd2IDIzLLz0zDKduMVrzXrwdwZsohqMSB3W0+NJzNP7akYViXJv8trXqBZ2qN7efa2yiGpuHcVsp9ynIpQiLKeNeVjWNtmiIJJuYildSTQLNs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB7031.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(136003)(366004)(39860400002)(451199021)(19627235002)(54906003)(110136005)(4326008)(316002)(64756008)(66476007)(76116006)(66946007)(66556008)(66446008)(966005)(45080400002)(478600001)(7696005)(71200400001)(55016003)(8936002)(5660300002)(41300700001)(8676002)(52536014)(30864003)(122000001)(2906002)(86362001)(38070700005)(33656002)(38100700002)(9686003)(6506007)(26005)(53546011)(186003)(83380400001)(579004)(559001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0RpDYAFwAodxh3UMTm1AYQNdwDFlPycMC6iokBlCGIUt/lXh9kmr5mNmH66A?= =?us-ascii?Q?k0e2dSrsp3B5OuugR2CWA9l9Vyfh3DveYshSQdZWPXLYBkTy45yz/h1hVFus?= =?us-ascii?Q?2XTTH6PRZKa+YgRZ0MJVHO5sQuLKpI/FKBl/MZGcnU2GMKXHBgjTC8FPBTmJ?= =?us-ascii?Q?ft5XwhrB8+mgyhlM/snZZjiiWTNzZI6SD4iNyxn4c2U//8CsbVbohEqS30nP?= =?us-ascii?Q?P5EkCXuHnjQAQm6wpp5ZG6uKnUMSjCbwGbamxTkwgtq6B751Vlg409yWzs7g?= =?us-ascii?Q?VKuJwTbZtcAowTDFSfZiY/k65Y2Fl50jPP3jSypXHX0poCGZv3ocW7Nk+pqP?= =?us-ascii?Q?9Kn7XLMW0OnYXMF+td9i8FcWHeNYFwpWSuJpQVIkkynFDeIjEB4w4RfInTQK?= =?us-ascii?Q?jDjl/lXAFFpn8YFHFn3LF6LBAe1m3lLlbU3lxTdIIwpEhYPLZBtDXJ50VJzv?= =?us-ascii?Q?buLIdsJF3QbTHLVm3Zp5FVe7wAuNPODW/sAyyn8bBfNTEqw1+DFYVRWE1HTX?= =?us-ascii?Q?yuH/o1om4/z+vc1kXBfo4qmNhqN2SJD4W75pMEPnuf3Bv0xJMKte8eie4k+O?= =?us-ascii?Q?KXnUlrD+5nGn6ofgGQOLOHN4sftFVA2PM//cMm9SXol7/QcUbDUovQ46d0tP?= =?us-ascii?Q?6Son9JxVYgqttgsfd0ooXqRru3noa72GQTzMpnFjaf48qFY4KYfR0CuNzy1k?= =?us-ascii?Q?1aD1IeAzRkEAiFHyQvl4RdurWHOOa3U2zf0EMT+apfQS2uHWeiHObktFNZah?= =?us-ascii?Q?oxbrVVQiyJbSPlZuDnKiMqZD9zPbsbO8JXRfFEtLLBLjEXMdREllDEKuo+Zr?= =?us-ascii?Q?7q3JanBZqvBvYK+lwHTs79D4uReN53pGclCxPjYD/+yCVq/6NBs6aDOHYFn/?= =?us-ascii?Q?2HJsVM/leM4lbqXMU1i85QpaEtrG3S6a3O4N2wqlIVJPpNz+zkTZG0C6lppp?= =?us-ascii?Q?TSVpXRsMtMW6ma+u6kwy6QC3LIUqbV/MAhrfRRujpYVmmD7UWR2OeNKF96CV?= =?us-ascii?Q?RuB7vdxT9nY69d+HxP9v4zS64ui0F/Z/yNp/KGDSfUeak7FScvobuIxm45La?= =?us-ascii?Q?cf3kaLxrq5qmA/YWSQq2Z5DBn3Vw8DPSj7OwBVQ5Et4PoYmlYY0nfVVN0AvK?= =?us-ascii?Q?WMSxCgMIPesBCgggjMy83U0S2qd9LM1O6IdjcSASq7+ckwl84Lmb1vVbNooK?= =?us-ascii?Q?XXZxTF7SsFXXk37yEfdHLc/nAS3+LrGXWtnzfrT7ulDuthpwTizfxbpyQDns?= =?us-ascii?Q?XCRtLNh9ksdXDy8HNbMKBuxvku4AhjjZM+2GsS1FlJLlQfx3NlFyDbhRgoMu?= =?us-ascii?Q?GX/Sh239HDFBDKu9ryBHAgYVG7V34om0x2/R/KHAJ3BF7Ygj6MqchKqDdI/c?= =?us-ascii?Q?gm9KuoSGpAfz51PjAAORREBjFnTTcH3m6lMGETtOXvxYWWrUfON8k/yyboBu?= =?us-ascii?Q?9dqz2FvMX7JFgbyhEdVR9le0aUD+HJ27gsUDqvE39Nw/Yrgg+sZ6tiAqcdK2?= =?us-ascii?Q?7P4XISnDEndX+GEKlL8fseMaNf2ASiSc/0cGB6MkmVnhCX5NwK2OKKVdARW6?= =?us-ascii?Q?o0ba8hkQ+sP7seoLK1A=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6426671-9377-41bc-16d9-08db416bca4e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2023 06:52:21.4168 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kjKvX/QaWq0Xekc9kqXZNCvqF7/lk2YqkMwIt7sz/ds1yISA1bGUwBh+SmDnDasSmuQtlo3w+MEdu6kg7nIbHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7819 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nickle Wang Regards, Nickle > -----Original Message----- > From: abner.chang@amd.com > Sent: Tuesday, April 18, 2023 3:16 PM > To: devel@edk2.groups.io > Cc: Isaac Oram ; Abdul Lateef Attar > ; Nickle Wang ; Igor Kulchytskyy > > Subject: [edk2-platforms][PATCH V2 05/14] ManageabilityPkg: Add > PldmSmbiosTransferDxe driver > > External email: Use caution opening links or attachments > > > From: Abner Chang > > Add edk2 driver that supports PLDM SMBIOS Transfer Specification. > https://www.d/ > mtf.org%2Fsites%2Fdefault%2Ffiles%2Fstandards%2Fdocuments%2FDSP0246_1 > .0.1.pdf&data=3D05%7C01%7Cnicklew%40nvidia.com%7Cd7cd94d4a15b448c37d4 > 08db3fdccdc6%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638173 > 989961845778%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj > oiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Da > Ospd%2BAVnKMgIDCoyW5H6N1vNdxz%2FtOkUvnPyuPGgzs%3D&reserved=3D0 > > We currently only support "Push" mode of PLDM SMBIOS transfer. That says > only BIOS to BMC direction is supported. > The functionality is verified by checking the binary debug output of payl= oad. > > Signed-off-by: Abner Chang > Cc: Isaac Oram > Cc: Abdul Lateef Attar > Cc: Nickle Wang > Cc: Igor Kulchytskyy > --- > .../ManageabilityPkg/ManageabilityPkg.dec | 1 + > .../Include/Dsc/Manageability.dsc | 1 + > .../PldmSmbiosTransferDxe.inf | 47 ++ > .../Protocol/PldmSmbiosTransferProtocol.h | 184 ++++++ > .../PldmSmbiosTransferDxe.c | 525 ++++++++++++++++++ > 5 files changed, 758 insertions(+) > create mode 100644 > Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTran > sferDxe.inf > create mode 100644 > Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h > create mode 100644 > Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTran > sferDxe.c > > diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec > b/Features/ManageabilityPkg/ManageabilityPkg.dec > index e4d147fede..9c9f0d8232 100644 > --- a/Features/ManageabilityPkg/ManageabilityPkg.dec > +++ b/Features/ManageabilityPkg/ManageabilityPkg.dec > @@ -51,3 +51,4 @@ > > [Protocols] > gEdkiiPldmProtocolGuid =3D { 0x60997616, 0xDB70, 0x4B5F= , { 0x86, > 0xA4, 0x09, 0x58, 0xA3, 0x71, 0x47, 0xB4 } } > + gEdkiiPldmSmbiosTransferProtocolGuid =3D { 0xFA431C3C, 0x816B, 0x4B32= , > + { 0xA3, 0xE0, 0xAD, 0x9B, 0x7F, 0x64, 0x27, 0x2E } } > diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc > b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc > index eda1a36bb9..2a354ad898 100644 > --- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc > +++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc > @@ -32,4 +32,5 @@ > > [Components.X64] > ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf > + > + ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTransferDxe > + .inf > > diff --git > a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTr > ansferDxe.inf > b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTr > ansferDxe.inf > new file mode 100644 > index 0000000000..da49057982 > --- /dev/null > +++ b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbi > +++ osTransferDxe.inf > @@ -0,0 +1,47 @@ > +## @file > +# PLDM SMBIOS Transfer DXE Driver. > +# > +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights > +reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent ## > + > +[Defines] > + INF_VERSION =3D 0x0001001d > + BASE_NAME =3D PldmSmbiosTransferDxe > + FILE_GUID =3D 71BF5CF0-CE09-4C7C-912B-944BF4E4CBC= 0 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D DxePldmSmbiosTransferEntry > + UNLOAD_IMAGE =3D PldmSmbiosTransferUnloadImage > + > +# > +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 > +# > + > +[Sources] > + PldmSmbiosTransferDxe.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + ManageabilityPkg/ManageabilityPkg.dec > + > +[LibraryClasses] > + BaseMemoryLib > + DebugLib > + ManageabilityTransportLib > + ManageabilityTransportHelperLib > + PldmProtocolLib > + UefiLib > + UefiDriverEntryPoint > + UefiBootServicesTableLib > + > +[Guids] > + gEfiSmbios3TableGuid > + > +[Protocols] > + gEfiSmbiosProtocolGuid > + gEdkiiPldmSmbiosTransferProtocolGuid > + > +[Depex] > + gEdkiiPldmProtocolGuid ## ALWAYS_CONSUMES > diff --git > a/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h > b/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h > new file mode 100644 > index 0000000000..7903e12726 > --- /dev/null > +++ b/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProto > +++ col.h > @@ -0,0 +1,184 @@ > +/** @file > + Protocol of EDKII PLDM SMBIOS Transfer Protocol. > + > + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_H_ > +#define EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_H_ > + > +#include > + > +typedef struct _EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL; > + > +#define EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_GUID \ > + { \ > + 0xFA431C3C, 0x816B, 0x4B32, 0xA3, 0xE0, 0xAD, 0x9B, 0x7F, 0x64, > +0x27, 0x2E \ > + } > + > +#define EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MAJOR 1 > #define > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MINOR 0 > +#define EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION > ((EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MAJOR << 8) |\ > + > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MINOR) > + > +/** > + This function gets SMBIOS table metadata. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instanc= e. > + @param [out] Buffer Buffer to receive the SMBIOS table metadata= . > + > + @retval EFI_SUCCESS Get SMBIOS table metadata Success= fully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to get SMBIOS table metadata= . > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + OUT PLDM_SMBIOS_STRUCTURE_TABLE_METADATA *Buffer > + ); > + > +/** > + This function sets SMBIOS table metadata. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instanc= e. > + @param [in] Buffer Pointer to SMBIOS table metadata. > + > + @retval EFI_SUCCESS Set SMBIOS table metadata Success= fully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to set SMBIOS table metadata= . > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN PLDM_SMBIOS_STRUCTURE_TABLE_METADATA *Buffer > + ); > + > +/** > + This function gets SMBIOS structure table. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance= . > + @param [out] Buffer Pointer to the returned SMBIOS structure tab= le. > + Caller has to free this memory block when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payload in buff= er. > + > + @retval EFI_SUCCESS Gets SMBIOS structure table succe= ssfully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to get SMBIOS structure tabl= e. > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_GET_SMBIOS_STRUCTURE_TABLE)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ); > + > +/** > + This function sets SMBIOS structure table. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance= . > + > + @retval EFI_SUCCESS Successful > + @retval EFI_UNSUPPORTED The function is unsupported by thi= s > + driver instance. > + @retval Other values Fail to set SMBIOS structure table= . > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_SET_SMBIOS_STRUCTURE_TABLE)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This > + ); > + > +/** > + This function gets particular type of SMBIOS structure. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > instance. > + @param [in] TypeId The type of SMBIOS structure. > + @param [in] StructureInstanceId The instance ID of particular type = of > SMBIOS structure. > + @param [out] Buffer Pointer to the returned SMBIOS stru= cture. > + Caller has to free this memory bloc= k when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payloa= d in buffer. > + > + @retval EFI_SUCCESS Gets particular type of SMBIOS stru= cture > successfully. > + @retval EFI_UNSUPPORTED The function is unsupported by this > + driver instance. > + @retval Other values Fail to set SMBIOS structure table. > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN UINT8 TypeId, > + IN UINT16 StructureInstanceId, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ); > + > +/** > + This function gets particular handle of SMBIOS structure. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > instance. > + @param [in] Handle The handle of SMBIOS structure. > + @param [out] Buffer Pointer to the returned SMBIOS stru= cture. > + Caller has to free this memory bloc= k when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payloa= d in buffer. > + > + @retval EFI_SUCCESS Gets particular handle of SMBIOS st= ructure > successfully. > + @retval EFI_UNSUPPORTED The function is unsupported by this > + driver instance. > + @retval Other values Fail to set SMBIOS structure table. > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE)( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN UINT16 Handle, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ); > + > +// > +// EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > +// > +typedef struct { > + PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA > GetSmbiosStructureTableMetaData; > + PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA > SetSmbiosStructureTableMetaData; > + PLDM_GET_SMBIOS_STRUCTURE_TABLE GetSmbiosStructureTable; > + PLDM_SET_SMBIOS_STRUCTURE_TABLE SetSmbiosStructureTable; > + PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE GetSmbiosStructureByType; > + PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE > GetSmbiosStructureByHandle; > +} EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_V1_0; > + > +/// > +/// Definitions of EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL. > +/// This is a union that can accommodate the new functionalities > +defined /// in PLDM SMBIOS Transfer specification in the future. > +/// The new added function must has its own > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > +/// structure with the incremental version number. > +/// e.g., EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_V1_1. > +/// > +/// The new function must be added base on the last version of /// > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL to keep the backward > compatibility. > +/// > +typedef union { > + EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_V1_0 *Version1_0; > +} EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_FUNCTION; > + > +struct _EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL { > + UINT16 ProtocolVersion; > + EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_FUNCTION Functions; > +}; > + > +extern EFI_GUID gEdkiiPldmSmbiosTransferProtocolGuid; > + > +#endif // EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_H_ > diff --git > a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTr > ansferDxe.c > b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTr > ansferDxe.c > new file mode 100644 > index 0000000000..88b190757d > --- /dev/null > +++ b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbi > +++ osTransferDxe.c > @@ -0,0 +1,525 @@ > +/** @file > + This file provides edk2 PLDM SMBIOS Transfer Protocol implementation. > + > + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Revision Reference: > + Platform Level Data Model (PLDM) for SMBIOS Data Transfer Specificati= on > + Version 1.0.1 > + > +https://www/. > d > +mtf.org%2Fsites%2Fdefault%2Ffiles%2Fstandards%2Fdocuments%2FDSP0246_ > 1.0 > +.1.pdf&data=3D05%7C01%7Cnicklew%40nvidia.com%7Cd7cd94d4a15b448c37d4 > 08db3f > +dccdc6%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C63817398996 > 1845778% > +7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB > TiI6Ik1 > +haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DaOspd%2BAVnKMgIDC > oyW5H6N1vNdx > +z%2FtOkUvnPyuPGgzs%3D&reserved=3D0 > +**/ > + > +#include > +#include > +#include > +#include #include > + > +#include > +#include #include > + > +#include > +#include > +#include > +#include > + > +UINT32 SetSmbiosStructureTableHandle; > + > +/** > + Get the full size of SMBIOS structure including optional strings that = follow the > formatted structure. > + > + @param Head Pointer to the beginning of SMBIOS struc= ture. > + @param NumberOfStrings The returned number of optional strings = that > follow the formatted structure. > + > + @return Size The returned size. > +**/ > +UINTN > +GetSmbiosStructureSize ( > + IN EFI_SMBIOS_TABLE_HEADER *Head, > + OUT UINTN *NumberOfStrings > + ) > +{ > + UINTN Size; > + UINTN StrLen; > + CHAR8 *CharInStr; > + UINTN StringsNumber; > + > + CharInStr =3D (CHAR8 *)Head + Head->Length; > + Size =3D Head->Length; > + StringsNumber =3D 0; > + StrLen =3D 0; > + // > + // look for the two consecutive zeros, check the string limit by the w= ay. > + // > + while (*CharInStr !=3D 0 || *(CharInStr+1) !=3D 0) { > + if (*CharInStr =3D=3D 0) { > + Size +=3D 1; > + CharInStr++; > + } > + > + for (StrLen =3D 0; StrLen < SMBIOS_STRING_MAX_LENGTH; StrLen++) { > + if (*(CharInStr+StrLen) =3D=3D 0) { > + break; > + } > + } > + > + if (StrLen =3D=3D SMBIOS_STRING_MAX_LENGTH) { > + return 0; > + } > + > + // > + // forward the pointer > + // > + CharInStr +=3D StrLen; > + Size +=3D StrLen; > + StringsNumber +=3D 1; > + } > + > + // > + // count ending two zeros. > + // > + Size +=3D 2; > + > + if (NumberOfStrings !=3D NULL) { > + *NumberOfStrings =3D StringsNumber; > + } > + > + return Size; > +} > + > +/** > + > + This function returns full SMBIOS table length. > + > + @param TableAddress SMBIOS table based address > + @param TableMaximumSize Maximum size of SMBIOS table > + > + @return SMBIOS table length > + > +**/ > +UINTN > +GetSmbiosTableLength ( > + IN VOID *TableAddress, > + IN UINTN TableMaximumSize > + ) > +{ > + VOID *TableEntry; > + VOID *TableAddressEnd; > + UINTN TableEntryLength; > + > + TableAddressEnd =3D (VOID *)((UINTN)TableAddress + TableMaximumSize); > + TableEntry =3D TableAddress; > + while (TableEntry < TableAddressEnd) { > + TableEntryLength =3D GetSmbiosStructureSize (TableEntry, NULL); > + if (TableEntryLength =3D=3D 0) { > + break; > + } > + > + if (((SMBIOS_STRUCTURE *)TableEntry)->Type =3D=3D 127) { > + TableEntry =3D (VOID *)((UINTN)TableEntry + TableEntryLength); > + break; > + } > + > + TableEntry =3D (VOID *)((UINTN)TableEntry + TableEntryLength); } > + > + return ((UINTN)TableEntry - (UINTN)TableAddress); } > + > +/** > + This function gets SMBIOS table metadata. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instanc= e. > + @param [out] Buffer Buffer to receive the SMBIOS table metadata= . > + > + @retval EFI_SUCCESS Get SMBIOS table metadata Success= fully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to get SMBIOS table metadata= . > +**/ > +EFI_STATUS > +EFIAPI > +GetSmbiosStructureTableMetaData ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + OUT PLDM_SMBIOS_STRUCTURE_TABLE_METADATA *Buffer > + ) > +{ > + EFI_STATUS Status; > + UINT32 ResponseSize; > + > + DEBUG ((DEBUG_INFO, "%a: Set SMBIOS structure table metafile.\n", > + __FUNCTION__)); > + > + ResponseSize =3D sizeof (PLDM_SMBIOS_STRUCTURE_TABLE_METADATA); > + Status =3D PldmSubmitCommand ( > + PLDM_TYPE_SMBIOS, > + > PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE, > + NULL, > + 0, > + (UINT8 *)Buffer, > + &ResponseSize > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Fails to get SMBIOS structure table > + metafile.\n", __FUNCTION__)); } > + > + if (ResponseSize !=3D 0) { > + HelperManageabilityDebugPrint ( > + (VOID *)Buffer, > + ResponseSize, > + "SMBIOS structure table metafile got from BMC.\n" > + ); > + } > + > + return Status; > +} > + > +/** > + This function sets SMBIOS table metadata. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instanc= e. > + > + @retval EFI_SUCCESS Set SMBIOS table metadata Success= fully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to set SMBIOS table metadata= . > +**/ > +EFI_STATUS > +EFIAPI > +SetSmbiosStructureTableMetaData ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN PLDM_SMBIOS_STRUCTURE_TABLE_METADATA *Buffer > + ) > +{ > + EFI_STATUS Status; > + UINT32 ResponseSize; > + UINT32 RequestSize; > + > + DEBUG ((DEBUG_INFO, "%a: Get SMBIOS structure table metafile.\n", > + __FUNCTION__)); > + > + RequestSize =3D sizeof (PLDM_SMBIOS_STRUCTURE_TABLE_METADATA); > + ResponseSize =3D 0; > + > + Status =3D PldmSubmitCommand ( > + PLDM_TYPE_SMBIOS, > + > PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE, > + (UINT8 *)Buffer, > + RequestSize, > + (UINT8 *)NULL, > + &ResponseSize > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Fails to set SMBIOS structure table > + metafile.\n", __FUNCTION__)); } > + > + return Status; > +} > + > +/** > + This function gets SMBIOS structure table. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance= . > + @param [out] Buffer Pointer to the returned SMBIOS structure tab= le. > + Caller has to free this memory block when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payload in buff= er. > + > + @retval EFI_SUCCESS Gets SMBIOS structure table succe= ssfully. > + @retval EFI_UNSUPPORTED The function is unsupported by th= is > + driver instance. > + @retval Other values Fail to get SMBIOS structure tabl= e. > +**/ > +EFI_STATUS > +EFIAPI > +GetSmbiosStructureTable ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a: Unsupported.\n", __FUNCTION__)); > + // Only support PLDM SMBIOS Transfer push mode. > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function sets SMBIOS structure table. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance= . > + > + @retval EFI_SUCCESS Successful > + @retval EFI_NOT_FOUND No SMBIOS record found on system. > + @retval EFI_UNSUPPORTED The function is unsupported by thi= s > + driver instance. > + @retval Other values Fail to set SMBIOS structure table= . > +**/ > +EFI_STATUS > +EFIAPI > +SetSmbiosStructureTable ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This > + ) > +{ > + EFI_STATUS Status; > + SMBIOS_TABLE_3_0_ENTRY_POINT *SmbiosEntry; > + EFI_SMBIOS_HANDLE SmbiosHandle; > + EFI_SMBIOS_PROTOCOL *Smbios; > + UINT32 PaddingSize; > + UINT32 ResponseSize; > + UINT32 RequestSize; > + UINT8 *RequestBuffer; > + UINT8 *DataPointer; > + UINT32 Crc32; > + UINT16 TableLength; > + EFI_SMBIOS_TABLE_HEADER *Record; > + PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST > +*PldmSetSmbiosStructureTable; > + > + DEBUG ((DEBUG_INFO, "%a: Set SMBIOS structure table.\n", > + __FUNCTION__)); > + > + Status =3D gBS->LocateProtocol ( > + &gEfiSmbiosProtocolGuid, > + NULL, > + (VOID **)&Smbios > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: No Efi SMBIOS Protocol installed.\n")); > + return EFI_UNSUPPORTED; > + } > + > + if (Smbios->MajorVersion < 3) { > + DEBUG ((DEBUG_ERROR, "%a: We don't support SMBIOS spec version earli= er > than v3.0.\n")); > + return EFI_UNSUPPORTED; > + } > + > + Status =3D EfiGetSystemConfigurationTable ( > + &gEfiSmbios3TableGuid, > + (VOID **)&SmbiosEntry > + ); > + if (Status !=3D EFI_SUCCESS) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to get system configuration table.\= n")); > + return Status; > + } > + > + // > + // Print out SMBIOS table information. > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "PldmSetSmbiosStructureTable > + SmbiosTable:\n")); DEBUG (( > + DEBUG_MANAGEABILITY_INFO, > + "AnchorString ------ '%c%c%c%c%c'\n", > + SmbiosEntry->AnchorString[0], > + SmbiosEntry->AnchorString[1], > + SmbiosEntry->AnchorString[2], > + SmbiosEntry->AnchorString[3], > + SmbiosEntry->AnchorString[4] > + )); > + > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "EntryPointStructureChecksum ------ > 0x%02x\n", SmbiosEntry->EntryPointStructureChecksum)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "EntryPointLength ------ > 0x%02x\n", SmbiosEntry->EntryPointLength)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "MajorVersion ------ > 0x%02x\n", SmbiosEntry->MajorVersion)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "MinorVersion ------ > 0x%02x\n", SmbiosEntry->MinorVersion)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "DocRev ------ > 0x%02x\n", SmbiosEntry->DocRev)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "MaxStructureSize ------ > 0x%08x\n", SmbiosEntry->TableMaximumSize)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "EntryPointRevision - > 0x%02x\n", SmbiosEntry->EntryPointRevision)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "TableMaximumSize - > 0x%08x\n", SmbiosEntry->TableMaximumSize)); > + DEBUG ((DEBUG_MANAGEABILITY_INFO, "TableAddress - > 0x%016lx\n", SmbiosEntry->TableAddress)); > + > + SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; do { > + Status =3D Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NU= LL); > + if (EFI_ERROR (Status)) { > + break; > + } > + > + DEBUG ((DEBUG_MANAGEABILITY_INFO, " SMBIOS type %d to BMC\n", > + Record->Type)); } while (Status =3D=3D EFI_SUCCESS); > + > + TableLength =3D (UINT16)GetSmbiosTableLength ((VOID > + *)(UINTN)SmbiosEntry->TableAddress, SmbiosEntry->TableMaximumSize); > + > + // Padding requirement (0 ~ 3 bytes) > + PaddingSize =3D (4 - (TableLength % 4)) % 4; > + > + // Total request buffer size =3D > PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST + SMBIOS tables + padding + > checksum > + RequestSize =3D (UINT32)(sizeof > (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST) + TableLength + > PaddingSize + sizeof (Crc32)); > + RequestBuffer =3D (UINT8 *)AllocatePool (RequestSize); if > + (RequestBuffer =3D=3D NULL) { > + DEBUG ((DEBUG_ERROR, "%a: No memory resource for sending > SetSmbiosStructureTable.\n")); > + return EFI_OUT_OF_RESOURCES; > + } > + > + // Fill in smbios tables > + CopyMem ( > + (VOID *)((UINT8 *)RequestBuffer + sizeof > (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST)), > + (VOID *)(UINTN)SmbiosEntry->TableAddress, > + TableLength > + ); > + > + // Fill in padding > + DataPointer =3D RequestBuffer + sizeof > + (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST) + TableLength; > ZeroMem > + ((VOID *)DataPointer, PaddingSize); > + > + // Fill in checksum > + gBS->CalculateCrc32 ( > + (VOID *)(RequestBuffer + sizeof > (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST)), > + TableLength + PaddingSize, > + &Crc32 > + ); > + DataPointer +=3D PaddingSize; > + CopyMem ((VOID *)DataPointer, (VOID *)&Crc32, 4); > + > + PldmSetSmbiosStructureTable =3D > (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST *)RequestBuffer; > + PldmSetSmbiosStructureTable->DataTransferHandle =3D > SetSmbiosStructureTableHandle; > + PldmSetSmbiosStructureTable->TransferFlag =3D > PLDM_TRANSFER_FLAG_START_AND_END; > + ResponseSize =3D sizeof (SetSmbiosS= tructureTableHandle); > + > + Status =3D PldmSubmitCommand ( > + PLDM_TYPE_SMBIOS, > + PLDM_SET_SMBIOS_STRUCTURE_TABLE_COMMAND_CODE, > + RequestBuffer, > + RequestSize, > + (UINT8 *)&SetSmbiosStructureTableHandle, > + &ResponseSize > + ); > + if (RequestBuffer !=3D NULL) { > + FreePool (RequestBuffer); > + } > + > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Set SMBIOS structure table.\n", > + __FUNCTION__)); } > + > + if ((ResponseSize !=3D 0) && (ResponseSize <=3D sizeof > (SetSmbiosStructureTableHandle))) { > + HelperManageabilityDebugPrint ( > + (VOID *)&SetSmbiosStructureTableHandle, > + ResponseSize, > + "Set SMBIOS structure table response got from BMC.\n" > + ); > + } > + > + return Status; > +} > + > +/** > + This function gets particular type of SMBIOS structure. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > instance. > + @param [in] TypeId The type of SMBIOS structure. > + @param [in] StructureInstanceId The instance ID of particular type = of > SMBIOS structure. > + @param [out] Buffer Pointer to the returned SMBIOS stru= cture. > + Caller has to free this memory bloc= k when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payloa= d in buffer. > + > + @retval EFI_SUCCESS Gets particular type of SMBIOS stru= cture > successfully. > + @retval EFI_UNSUPPORTED The function is unsupported by this > + driver instance. > + @retval Other values Fail to set SMBIOS structure table. > +**/ > +EFI_STATUS > +EFIAPI > +GetSmbiosStructureByType ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN UINT8 TypeId, > + IN UINT16 StructureInstanceId, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a: Unsupported.\n", __FUNCTION__)); > + // Only support PLDM SMBIOS Transfer push mode. > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function gets particular handle of SMBIOS structure. > + > + @param [in] This EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL > instance. > + @param [in] Handle The handle of SMBIOS structure. > + @param [out] Buffer Pointer to the returned SMBIOS stru= cture. > + Caller has to free this memory bloc= k when it > + is no longer needed. > + @param [out] BufferSize Size of the returned message payloa= d in buffer. > + > + @retval EFI_SUCCESS Gets particular handle of SMBIOS st= ructure > successfully. > + @retval EFI_UNSUPPORTED The function is unsupported by this > + driver instance. > + @retval Other values Fail to set SMBIOS structure table. > +**/ > +EFI_STATUS > +EFIAPI > +GetSmbiosStructureByHandle ( > + IN EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL *This, > + IN UINT16 Handle, > + OUT UINT8 **Buffer, > + OUT UINT32 *BufferSize > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a: Unsupported.\n", __FUNCTION__)); > + // Only support PLDM SMBIOS Transfer push mode. > + return EFI_UNSUPPORTED; > +} > + > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_V1_0 > +mPldmSmbiosTransferProtocolV10 =3D { > + GetSmbiosStructureTableMetaData, > + SetSmbiosStructureTableMetaData, > + GetSmbiosStructureTable, > + SetSmbiosStructureTable, > + GetSmbiosStructureByType, > + GetSmbiosStructureByHandle > +}; > + > +EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL mPldmSmbiosTransferProtocol; > + > +/** > + The entry point of the PLDM SMBIOS Transfer DXE driver. > + > + @param[in] ImageHandle - Handle of this driver image @param[in] > + SystemTable - Table containing standard EFI services > + > + @retval EFI_SUCCESS - IPMI Protocol is installed successfully. > + @retval Otherwise - Other errors. > +**/ > +EFI_STATUS > +EFIAPI > +DxePldmSmbiosTransferEntry ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_HANDLE Handle; > + EFI_STATUS Status; > + > + DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__)); > + > + SetSmbiosStructureTableHandle =3D 0; > + > + Handle =3D NULL; > + mPldmSmbiosTransferProtocol.ProtocolVersion =3D > EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION; > + mPldmSmbiosTransferProtocol.Functions.Version1_0 =3D > &mPldmSmbiosTransferProtocolV10; > + Status =3D gBS->InstallProto= colInterface ( > + &Handle, > + &gEdkiiPldmS= mbiosTransferProtocolGuid, > + EFI_NATIVE_I= NTERFACE, > + (VOID **)&mP= ldmSmbiosTransferProtocol > + ); if > + (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Fail to install > + EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL.\n", __FUNCTION__)); } > + > + return Status; > +} > + > +/** > + This is the unload handler of PLDM SMBIOS Transfer DXE driver. > + > + @param[in] ImageHandle The driver's image handle. > + > + @retval EFI_SUCCESS The image is unloaded. > + @retval Others Failed to unload the image. > + > +**/ > +EFI_STATUS > +EFIAPI > +PldmSmbiosTransferUnloadImage ( > + IN EFI_HANDLE ImageHandle > + ) > +{ > + return EFI_SUCCESS; > +} > -- > 2.37.1.windows.1