From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.76]) by mx.groups.io with SMTP id smtpd.web10.8867.1679300020562859312 for ; Mon, 20 Mar 2023 01:13:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=gJEE/fEV; 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.93.76, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3Xa0haJiwXwEZPzXrg4JHRE5F0K8pHyxeifdvJXGEH8/gD3y5QDc8u7Q5UYJCcEWCWTEXyNUEUl+pUNlVfyZsRzfN+Bay6HH5RVG7BshgbvrwZmkAUWtMgNK0byZjikb/wBiE1WZqPgKzcAoR7lfphcEKu/eITJbLqCIxp69WiMooSHXsq8TCh4mGEmzQpjf9n9IjbJWPuah40w0hgyHiCBEkwQxa/g/Y/o3gltlJfDBOxad2sABBT/AEV95d2p7jTUe9JBRInjfU2DbxbAKPxp7GXXVXTt+U0287ueZHrYnJHDtbfeNEmh+Eej9aT+3BXB0fsEKyE+sUBY9nsUlQ== 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=5imZ7BYmKxW64glWwcZ7tGRgx/jyK+nAGMr8yhZq52w=; b=Bk/Z34RgbG1HJ4dLzYifLyP/BpcFrZaH6Jj+Yni8/1ZKiw8Dorzn9SiYd23J7SWFz/DwkRuIe1R1n3SUiGiZHj8EqSsHeCW+p5LGI2Sb/SUKQPB4WFjvIwURGlHY3rph4eBpAAssIRPUz3yoUpqsTW8lZsfYXXBOigC/vFUkGsMyL17zAMY98d5B2lxFICGiwgAID8Ji4QFzGFUL/KzsF8fP+PJziUToHbS3sYIu29rW4PecaFd7BXs+UVXkQwOsvoIupJo7i2Vx2Kq9Za9pwg91U64csIWfACkfpIqTdIV5Ox3dmk0+E1NyMqneS+M/vERVTUjSfgb9PdYmd1VioQ== 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=5imZ7BYmKxW64glWwcZ7tGRgx/jyK+nAGMr8yhZq52w=; b=gJEE/fEVq02y/OPB61VNvzJydkRSgs0vClX+IlWHdbjDIVAHV9EIRC6G38+OO0JQCcBrbNAvWTQqSH7pluApWhGJBiYe10cubbzMSPl/udPWgtTBuEC830FTDPKN43qyyp5MgNs5499T8SXk8XKSpLS9sBdHgWs/E41wWQ1Cd7B0jNuT9JeIoqEDyXXfX3F7gKMLjEwfOSUiuzgAzc0Cpgoa13eDI3h6CrrHR9qhvjRh3NF12bf6kvuEHF05LTFbERI+K7Az/XiX/L0yW6Jjuh/SzdqFw4SUG9ymVlgq4syJZnYqJUdPTK1y8vWerep93Qi4hMFP2+JLqKB4HFvynQ== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by BY5PR12MB4099.namprd12.prod.outlook.com (2603:10b6:a03:20f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 08:13:35 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266%5]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 08:13:31 +0000 From: "Nickle Wang" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Liming Gao , Isaac Oram , Nate DeSimone , Igor Kulchytskyy , Abdul Lateef Attar Subject: Re: [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib Thread-Topic: [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib Thread-Index: AQHZUciytSfRlNqrX0uL9iUoaNbly68DZBaQ Date: Mon, 20 Mar 2023 08:13:31 +0000 Message-ID: References: <20230308141647.1318-1-abner.chang@amd.com> <20230308141647.1318-4-abner.chang@amd.com> In-Reply-To: <20230308141647.1318-4-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_|BY5PR12MB4099:EE_ x-ms-office365-filtering-correlation-id: 0c499685-f004-40e1-10d7-08db291afe6b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PvZUWLnu5zGznFXsvjUFQqusRsn23JjxDzypW+mCkOWR3ST6b5NdYRyvP31ndC7bUbjYvZVxrGqHBlWFJ7TaVvCT8dJ0RpckWT/pBJ8A6VpE2cuei7C6Rz/rnTSFvz64Cu2v1Wwy/EmpGy/lhTBWveD8vsSk0WoNb5eTFrA7tYJUito/Tb7rfhz1N8sidnQnkbmPnVTR/xEUmCoTI5Qpaww+VFrK+O9aj/TG/Kts6kCtGWIkX0ob/H1YGgg9dKEcUoEv/2Bl+YTm6D6LlW+G/nXpKvw6fwv/ItCGlSFHUzOHNh9VdKAV5ICCFyyltIvyItxL3LVNOtP5wv6x/DvKJdJ+k5izk/FXGvbtMMFa6lfVR7oD8ZNQ5hEZZXaneUy6fJ2dg/U0489cj3u/cwHsE0iFp/j1+t67B38trnSBH9zNRwEYKtftyibttfmLb8vAdqy9Felmc71/8nJsslxy9GAJ2v+nuc71GHYG1BRgPkYLzVHPvhPOaigKy7sfVLmHbtA0QEr7hJqw7EeqGIjXY9yecsmbbZ6Cefk+HE7k/1Pnpu7f8qUuEThjSR0ggygARbq3k0HbuG+ohD8t/6pPb7vjhx5T37FHSHgiWYQBpAYPZTFMhSPPT7CUdCuiVYfB/d0NSGB4ckSq4y4uwImC88EZAcaK24JHlZZWuLJg6xfXaRxOyTX8qNO/jLNhMcf2lI3Dth/noncoQLipPWKt8w== 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:(13230025)(4636009)(376002)(136003)(39850400004)(366004)(396003)(346002)(451199018)(83380400001)(110136005)(316002)(478600001)(54906003)(6506007)(186003)(53546011)(7696005)(26005)(9686003)(33656002)(71200400001)(55016003)(66556008)(38070700005)(38100700002)(122000001)(86362001)(8936002)(2906002)(52536014)(5660300002)(30864003)(66946007)(4326008)(76116006)(64756008)(66476007)(66446008)(8676002)(41300700001)(559001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yjm4p7HL3w89/BUEMsepyhWL210vu65b5hq0OZmbATXo/cqCAL5/JaJwi079?= =?us-ascii?Q?yY7QtmxIY36UyLF+rZHebHrLpDEYK0fti98HutR+DEyt5KSjRIRKHiCWyaj4?= =?us-ascii?Q?jw5XDhG4LF6+1euUVJ9xNJdJ6cX/9xBpMUn7gsVLJmlhAYZ4aeVGQzBKQ+h9?= =?us-ascii?Q?kG/G++6uQepJ4MGRCdpE9vh38ChyU7ImVjlJ8kHuKXCS77xfAu6W7rt+HIWF?= =?us-ascii?Q?TCo+eLUd1Y9M/xzrrml7dm8ZA+HLi/SkesEll01BgQPsoShJ3PezVYGBQvXN?= =?us-ascii?Q?UE7GYFtPasSUKQm+oV8hpp0aWSz3R/meMiaKf8eP+6xg+iVk9Q5zsxkIRcoW?= =?us-ascii?Q?ytBrR+AUMxtJVurJ72oquA/uyubtHT0baoYD1uh7jB2E1CGjvgN3Hn2vfB5X?= =?us-ascii?Q?FScxrPq24Ubju+GeZVACRCOgRdApFdkOWufZAXMwitxJnpIuNpcCNlvNpJJB?= =?us-ascii?Q?BSeFvc+RJsv/xIFgsR59GB/Ni/87CGO1P/N7DFsf33+k1ckSSe48FbuKVTLE?= =?us-ascii?Q?KRpTWh4dUPuXO9H30EdVfx4aRbSv3iYdSbl/pBM53pqjsrzdTqUO1VvbXULW?= =?us-ascii?Q?jYfNZAoOsCvyci9qylsk4guFPb1WVRMUkJc/K5W8UFAMRvQQvx2bDsTACFo+?= =?us-ascii?Q?RmjxrLsY+qHN+wpvHQ/gtVrqmUmYEsk8NcnkCNic5TY951uutpxQjAMeayMC?= =?us-ascii?Q?V6VvPypCd9E7SvogpiclKFnAtXYnP99GEv40u8tCOi6gcdiPJltBV3FL9DxC?= =?us-ascii?Q?qEKbkJLqo/k8Bq/tIEvL80596DfBfrpvOp1u07IbLw8RNBMmC1jGodnSi1wa?= =?us-ascii?Q?Vyg4b9CnvfvwqoLC2LaJ/VcsXHRSkMzNN+2w53nDI8RPPxBOh5plnRW+o/LR?= =?us-ascii?Q?zS+/gBZ1zbSexMgcqjvSSG4wQyECEnN4mExfN376UDsexfbkDDn3Y600x79S?= =?us-ascii?Q?QRkLebbE0j3RbTkFaZ8O/wBwIkYkZDyLqLezQgjaPheT3NizYCxW7vB3AxDX?= =?us-ascii?Q?zbcpMdLEzNs0/9BsyFPZ/HZmu2EwU1WFrXdpsYNNdn965WEYmzMO2bOd/0Ct?= =?us-ascii?Q?G2bgsHUsfxkHQHWu/Dn7BnlWa64zZI1B0vidhScfG+/s4SC7pdc/RpeXVDXc?= =?us-ascii?Q?0Y6tBQjg0vyM2g83ZT6n8Zd5ychtmS43w2rl3kxMOK1NIy6/R5ljbsUdtLeH?= =?us-ascii?Q?kDTO7A0FNwQNLfrV3GKwZz8b3eYRzQZJqAnJHvhBFfhQ7giDXccHyBlj4IeR?= =?us-ascii?Q?km+kIGvWonWaOKhbnwfhrXv3DeyVznOxfjj71CqyeIGGspPnYJTtv8tFiORG?= =?us-ascii?Q?cqA1+wvIhywZhvB8LCnR5kD6HVACytxMBJvuaAR8cvAX+yehKnz3Uxwgno36?= =?us-ascii?Q?gFjJFOEbaFSu5AIskINhdWf6NpoxfnMbguHerXyIb7k/MZiAEB5N/H8ToTxI?= =?us-ascii?Q?9ck03qWMVgO5gPCNRwAJ6vSZP7O/PMJfzxT+CjUuBl96RYXf39Fzl4T8VDJS?= =?us-ascii?Q?au8jlSIwCmj2yl6BfMhQmx4Ks6jMTcChUqd3hQpcMxhn0E0hVs+Ph27U9RKA?= =?us-ascii?Q?DWLSuhAluS3QJaZ1JTCycHCR1/zvRrZKgjbjp6ZN?= 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: 0c499685-f004-40e1-10d7-08db291afe6b X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 08:13:31.7218 (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: l7iniQ1lvgIAUCSk6jq39MzBaHJufDMvGea599vnCmqFsPaCkJezqYdLsIFrqHD2B7kD7kap/qrU1hrLVrmBRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4099 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 =20 Sent: Wednesday, March 8, 2023 10:17 PM To: devel@edk2.groups.io Cc: Liming Gao ; Isaac Oram ; Nate DeSimone ; Nickle Wang ; Igor Kulchytskyy ; Abdul Lateef Attar Subject: [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL Manageab= ilityTransportLib External email: Use caution opening links or attachments From: Abner Chang The NULL instance of ManageabilityTransportLib library. Signed-off-by: Abner Chang Cc: Liming Gao Cc: Isaac Oram Cc: Nate DeSimone Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Abdul Lateef Attar --- .../ManageabilityPkg/ManageabilityPkg.dec | 9 + .../ManageabilityPkg/ManageabilityPkg.dsc | 4 +- .../BaseManageabilityTransportNull.inf | 28 ++ .../Library/ManageabilityTransportIpmiLib.h | 24 ++ .../Library/ManageabilityTransportLib.h | 335 ++++++++++++++++++ .../BaseManageabilityTransportNull.c | 64 ++++ .../BaseManageabilityTransportNull.uni | 13 + 7 files changed, 476 insertions(+), 1 deletion(-) create mode 100644 Feat= ures/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManagea= bilityTransportNull.inf create mode 100644 Features/ManageabilityPkg/Include/Library/Manageability= TransportIpmiLib.h create mode 100644 Features/ManageabilityPkg/Include/Library/Manageability= TransportLib.h create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTran= sportNullLib/BaseManageabilityTransportNull.c create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTran= sportNullLib/BaseManageabilityTransportNull.uni diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec b/Features/Mana= geabilityPkg/ManageabilityPkg.dec index 8a0e28f50b..ebf6e6315e 100644 --- a/Features/ManageabilityPkg/ManageabilityPkg.dec +++ b/Features/ManageabilityPkg/ManageabilityPkg.dec @@ -16,3 +16,12 @@ [Includes] Include + +[LibraryClasses] + ## @libraryclass Manageability Transport Library + # Manageability Transport Library definitions + ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h + +[Guids] + gManageabilityPkgTokenSpaceGuid =3D { 0xBDEFFF48, 0x1C31, 0x49CD, {=20 +0xA7, 0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } } + diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc b/Features/Mana= geabilityPkg/ManageabilityPkg.dsc index 46cc215a0f..0dd0ab41fc 100644 --- a/Features/ManageabilityPkg/ManageabilityPkg.dsc +++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc @@ -36,5 +36,7 @@ !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc -!include Include/Dsc/Manageability.dsc +[LibraryClasses] + =20 +ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTra +nsportNullLib/BaseManageabilityTransportNull.inf +!include Include/Dsc/Manageability.dsc diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNu= llLib/BaseManageabilityTransportNull.inf b/Features/ManageabilityPkg/Librar= y/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf new file mode 100644 index 0000000000..3cb97afb8b --- /dev/null +++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLi +++ b/BaseManageabilityTransportNull.inf @@ -0,0 +1,28 @@ +## @file +# Null instance of Manageability Transport Library # # Copyright (C)=20 +2023 Advanced Micro Devices, Inc. All rights reserved.
#=20 +SPDX-License-Identifier: BSD-2-Clause-Patent # ## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D BaseManageabilityTransportNull + MODULE_UNI_FILE =3D BaseManageabilityTransportNull.uni + FILE_GUID =3D B63DC070-FB44-44F3-8E9A-DA6CC712EF4F + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ManageabilityTransportLib + +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 +# + +[Sources] + BaseManageabilityTransportNull.c + +[Packages] + ManageabilityPkg/ManageabilityPkg.dec + MdePkg/MdePkg.dec + diff --git a/Features/ManageabilityPkg/Include/Library/ManageabilityTranspo= rtIpmiLib.h b/Features/ManageabilityPkg/Include/Library/ManageabilityTransp= ortIpmiLib.h new file mode 100644 index 0000000000..7ca6acf6ef --- /dev/null +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIp +++ miLib.h @@ -0,0 +1,24 @@ +/** @file + + This file defines the manageability IPMI protocol specific transport dat= a. + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights=20 +reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ + +#ifndef MANAGEABILITY_TRANSPORT_IPMI_LIB_H_ +#define MANAGEABILITY_TRANSPORT_IPMI_LIB_H_ + +#include + +/// +/// The IPMI command header which is apart from /// the payload. +/// +typedef struct { + UINT8 NetFn; + UINT8 Lun; + UINT8 Command; +} MANAGEABILITY_IPMI_TRANSPORT_HEADER; + +#endif diff --git a/Features/ManageabilityPkg/Include/Library/ManageabilityTranspo= rtLib.h b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportL= ib.h new file mode 100644 index 0000000000..2093cadbf9 --- /dev/null +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi +++ b.h @@ -0,0 +1,335 @@ +/** @file + + This file defines the manageability transport interface library and func= tions. + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights=20 +reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ + +#ifndef MANAGEABILITY_TRANSPORT_LIB_H_ +#define MANAGEABILITY_TRANSPORT_LIB_H_ + +#define MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MAJOR 1 #define=20 +MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR 0 +#define MANAGEABILITY_TRANSPORT_TOKEN_VERSION ((MANAGEABILITY_TRANS= PORT_TOKEN_VERSION_MAJOR << 8) |\ + =20 +MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR) + +typedef struct _MANAGEABILITY_TRANSPORT_FUNCTION_V1_0 MANAGEABILITY_TRAN= SPORT_FUNCTION_V1_0; +typedef struct _MANAGEABILITY_TRANSPORT MANAGEABILITY_TRAN= SPORT; +typedef struct _MANAGEABILITY_TRANSPORT_TOKEN MANAGEABILITY_TRAN= SPORT_TOKEN; +typedef struct _MANAGEABILITY_TRANSFER_TOKEN MANAGEABILITY_TRAN= SFER_TOKEN; + +/// +/// Optional transport header and trailer required /// for the=20 +transport interface. +/// +typedef VOID *MANAGEABILITY_TRANSPORT_HEADER; typedef VOID =20 +*MANAGEABILITY_TRANSPORT_TRAILER; + +/// +/// The transport interface specific hardware information. +/// + +typedef union { + UINT16 IoAddress16; + UINT32 IoAddress32; +} MANAGEABILITY_TRANSPORT_HARDWARE_IO; + +/// +/// Manageability KCS protocol interface hardware information. +/// +typedef struct { + BOOLEAN MemoryMap; + MANAGEABILITY_TRANSPORT_HARDWARE_IO IoBaseAddress; + MANAGEABILITY_TRANSPORT_HARDWARE_IO IoDataInAddress; + MANAGEABILITY_TRANSPORT_HARDWARE_IO IoDataOutAddress; + MANAGEABILITY_TRANSPORT_HARDWARE_IO IoCommandAddress; + MANAGEABILITY_TRANSPORT_HARDWARE_IO IoStatusAddress; +} MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO; +#define MANAGEABILITY_TRANSPORT_KCS_IO_MAP_IO FALSE +#define MANAGEABILITY_TRANSPORT_KCS_MEMORY_MAP_IO TRUE + +typedef union { + VOID *Pointer; + MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO *Kcs; +} MANAGEABILITY_TRANSPORT_HARDWARE_INFORMATION; + +/// +/// Additional transport interface status. +/// +typedef UINT32 MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS; +#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS 0x0000000= 0 +#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR 0x0000000= 1 +#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_READ 0x0000000= 2 +#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_WRITE =20 +0x00000004 + +/// +/// Additional transport interface features. +/// +typedef UINT32 MANAGEABILITY_TRANSPORT_CAPABILITY; +#define MANAGEABILITY_TRANSPORT_CAPABILITY_MULTIPLE_TRANSFER_TOKENS 0x000= 00001 +#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER 0x000= 00002 + +/// +/// Definitions of Manageability transport interface functions. +/// This is a union that can accommodate the new functions ///=20 +introduced to the Manageability transport library in the future. +/// The new added function must has its own=20 +MANAGEABILITY_TRANSPORT_FUNCTION /// structure with the incremental versio= n number. +/// e.g., MANAGEABILITY_TRANSPORT_FUNCTION_V1_1. +/// +/// The new function must be added base on the last version of ///=20 +MANAGEABILITY_TRANSPORT_FUNCTION to keep the backward compatability. +/// +typedef union { + MANAGEABILITY_TRANSPORT_FUNCTION_V1_0 *Version1_0; +} MANAGEABILITY_TRANSPORT_FUNCTION; + +/// +/// Manageability specification GUID/Name table structure /// typedef=20 +struct { + EFI_GUID *SpecificationGuid; + CHAR16 *SpecificationName; +} MANAGEABILITY_SPECIFICATION_NAME; + +/// +/// Definitions of Transmit/Receive package /// typedef struct { + UINT8 *TransmitPayload; + UINT32 TransmitSizeInByte; + UINT32 TransmitTimeoutInMillisecond; +} MANAGEABILITY_TRANSMIT_PACKAGE; + +typedef struct { + UINT8 *ReceiveBuffer; + UINT32 ReceiveSizeInByte; + UINT32 TransmitTimeoutInMillisecond; +} MANAGEABILITY_RECEIVE_PACKAGE; + +/// +/// Definitions of Manageability transport interface. +/// +struct _MANAGEABILITY_TRANSPORT { + EFI_GUID *ManageabilityTransportSpecification= ; ///< The Manageability Transport Interface spec. + UINT16 TransportVersion; = ///< The version of transport interface + = ///< function that indicates which version + = ///< of MANAGEABILITY_TRANSPORT_FUNCTION + = ///< is unsupported by this library. + CHAR16 *TransportName; = ///< Human readable string of + = ///< this transport interface. + MANAGEABILITY_TRANSPORT_FUNCTION Function; = ///< Transport functions +}; + +/// +/// Definitions of Manageability transport token. +/// +struct _MANAGEABILITY_TRANSPORT_TOKEN { + EFI_GUID *ManageabilityProtocolSpecification; ///< The= Manageability Protocol spec. + MANAGEABILITY_TRANSPORT *Transport; +}; + +#define MANAGEABILITY_TRANSPORT_NO_TIMEOUT 0 + +/// +/// The Manageability transport receive token used to receive /// the=20 +response from transport interface after transmitting the /// request. +/// +struct _MANAGEABILITY_TRANSFER_TOKEN { + EFI_EVENT ReceiveEvent; = ///< The EFI event is created to + = ///< wait the signal for the readiness + = ///< of response data. + = ///< If NULL, transport library should + = ///< just return the response data in + = ///< ReceiveBuffer then the process returns + = ///< to caller. Otherwise the transport + = ///< library can signal event when the + = ///< response is ready for caller. That + = ///< means the transport library can + = ///< optionally implement the asynchronous + = ///< transfer mechanism or when the multiple + = ///< transport sessions are acquired. + MANAGEABILITY_TRANSPORT_HEADER TransmitHeader; = ///< This is the transport-specific header + = ///< which is sent discretely of payload. + = ///< This field can be NULL if the transport + = ///< doesn't require this. + MANAGEABILITY_TRANSPORT_TRAILER TransmitTrailer; = ///< This is the transport-specific trailer + = ///< which is sent discretely of payload. + = ///< This field can be NULL if the transport + = ///< doesn't require this. + MANAGEABILITY_TRANSMIT_PACKAGE TransmitPackage; = ///< The payload sent to transport interface. + MANAGEABILITY_RECEIVE_PACKAGE ReceivePackage; = ///< The buffer to receive the response. + EFI_STATUS TransferStatus; = ///< The EFI Status of the transfer. + MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS TransportAdditionalStatus; = ///< The additional status of transport + = ///< interface. +}; + +/** + This function acquires to create a transport session to transmit=20 +manageability + packet. A transport token is returned to caller for the follow up operat= ions. + + @param [in] ManageabilityProtocolSpec The protocol spec the transport= interface is acquired for. + @param [out] TransportToken The pointer to receive the tran= sport token created by + the target transport interface = library. + @retval EFI_SUCCESS Token is created successfully. + @retval EFI_OUT_OF_RESOURCES Out of resource to create a new= transport session. + @retval EFI_UNSUPPORTED Protocol is not supported on th= is transport interface. + @retval Otherwise Other errors. + +**/ +EFI_STATUS +AcquireTransportSession ( + IN EFI_GUID *ManageabilityProtocolSpec, + OUT MANAGEABILITY_TRANSPORT_TOKEN **TransportToken + ); + +/** + This function returns the transport capabilities. + + @param [out] TransportFeature Pointer to receive transport capab= ilities. + See the definitions of + MANAGEABILITY_TRANSPORT_CAPABILITY= . + +**/ +VOID +GetTransportCapability ( + OUT MANAGEABILITY_TRANSPORT_CAPABILITY *TransportCapability + ); + +/** + This function releases the manageability transport session. + + @param [in] TransportToken The transport token acquired through + AcquireTransportSession. + @retval EFI_SUCCESS Token is released successfully. + @retval EFI_INVALID_PARAMETER Invalid TransportToken. + @retval Otherwise Other errors. + +**/ +EFI_STATUS +ReleaseTransportSession ( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken + ); + +/** + This function initializes the transport interface. + + @param [in] TransportToken The transport token acquired throu= gh + AcquireTransportSession function. + @param [in] HardwareInfo This is the optional hardware info= rmation + assigned to this transport interfa= ce. + + @retval EFI_SUCCESS Transport interface is initialized + successfully. + @retval EFI_INVALID_PARAMETER The invalid transport token. + @retval EFI_NOT_READY The transport interface works fine= but + @retval is not ready. + @retval EFI_DEVICE_ERROR The transport interface has proble= ms. + @retval EFI_ALREADY_STARTED Teh protocol interface has already= initialized. + @retval Otherwise Other errors. + +**/ +typedef +EFI_STATUS +(EFIAPI *MANAGEABILITY_TRANSPORT_INIT)( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken, + IN MANAGEABILITY_TRANSPORT_HARDWARE_INFORMATION HardwareInfo=20 +OPTIONAL + ); + +/** + This function returns the transport interface status. + The generic EFI_STATUS is returned to caller directly, The additional + information of transport interface could be optionally returned in + TransportAdditionalStatus to describes the status that can't be + described obviously through EFI_STATUS. + See the definition of MANAGEABILITY_TRANSPORT_STATUS. + + @param [in] TransportToken The transport token acquired th= rough + AcquireTransportSession functio= n. + @param [out] TransportAdditionalStatus The additional status of transp= ort + interface. + NULL means no additional status= of this + transport interface. + + @retval EFI_SUCCESS Transport interface status is retu= rned. + @retval EFI_INVALID_PARAMETER The invalid transport token. + @retval EFI_DEVICE_ERROR The transport interface has proble= ms to return + @retval status. + Otherwise Other errors. + +**/ +typedef +EFI_STATUS +(EFIAPI *MANAGEABILITY_TRANSPORT_STATUS)( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken, + OUT MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS *TransportAdditionalStat= us OPTIONAL + ); + +/** + This function resets the transport interface. + The generic EFI_STATUS is returned to caller directly after reseting=20 +transport + interface. The additional information of transport interface could be=20 +optionally + returned in TransportAdditionalStatus to describes the status that=20 +can't be + described obviously through EFI_STATUS. + See the definition of MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS. + + @param [in] TransportToken The transport token acquired th= rough + AcquireTransportSession functio= n. + @param [out] TransportAdditionalStatus The additional status of specif= ic transport + interface after the reset. + NULL means no additional status= of this + transport interface. + + @retval EFI_SUCCESS Transport interface status is retu= rned. + @retval EFI_INVALID_PARAMETER The invalid transport token. + @retval EFI_TIMEOUT The reset process is time out. + @retval EFI_DEVICE_ERROR The transport interface has proble= ms to return + status. + Otherwise Other errors. + +**/ +typedef +EFI_STATUS +(EFIAPI *MANAGEABILITY_TRANSPORT_RESET)( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken, + OUT MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS =20 +*TransportAdditionalStatus OPTIONAL + ); + +/** + This function transmit the request over target transport interface. + The generic EFI_STATUS is returned to caller directly after reseting=20 +transport + interface. The additional information of transport interface could be=20 +optionally + returned in TransportAdditionalStatus to describes the status that=20 +can't be + described obviously through EFI_STATUS. + See the definition of MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS. + + @param [in] TransportToken The transport token acquired throu= gh + AcquireTransportSession function. + @param [in] TransferToken The transfer token, see the defini= tion of + MANAGEABILITY_TRANSFER_TOKEN. + + @retval The EFI status is returned in MANAGEABILITY_TRANSFER_TOKEN. + +**/ +typedef +VOID +(EFIAPI *MANAGEABILITY_TRANSPORT_TRANSMIT_RECEIVE)( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken, + IN MANAGEABILITY_TRANSFER_TOKEN *TransferToken + ); + +/// +/// The first version of Manageability transport interface function. +/// +struct _MANAGEABILITY_TRANSPORT_FUNCTION_V1_0 { + MANAGEABILITY_TRANSPORT_INIT TransportInit; //= /< Initial the transport. + MANAGEABILITY_TRANSPORT_STATUS TransportStatus; //= /< Get the transport status. + MANAGEABILITY_TRANSPORT_RESET TransportReset; //= /< Reset the transport. + MANAGEABILITY_TRANSPORT_TRANSMIT_RECEIVE TransportTransmitReceive; //= /< Transmit the packet over + //= /< transport and get the + //= /< response back. +}; + +#endif diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNu= llLib/BaseManageabilityTransportNull.c b/Features/ManageabilityPkg/Library/= BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c new file mode 100644 index 0000000000..49fc8c0f71 --- /dev/null +++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLi +++ b/BaseManageabilityTransportNull.c @@ -0,0 +1,64 @@ +/** @file + Null instance of Manageability Transport Library + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights=20 +reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ + +#include +#include + +/** + This function acquires to create a transport session to transmit=20 +manageability + packet. A transport token is returned to caller for the follow up operat= ions. + + @param [in] ManageabilityProtocolSpec The protocol spec the transport= interface is acquired. + @param [out] TransportToken The pointer to receive the tran= sport token created by + the target transport interface = library. + @retval EFI_SUCCESS Token is created successfully. + @retval EFI_OUT_OF_RESOURCES Out of resource to create a new= transport session. + @retval EFI_UNSUPPORTED Protocol is not supported on th= is transport interface. + @retval Otherwise Other errors. + +**/ +EFI_STATUS +AcquireTransportSession ( + IN EFI_GUID *ManageabilityProtocolSpec, + OUT MANAGEABILITY_TRANSPORT_TOKEN **TransportToken + ) +{ + return EFI_UNSUPPORTED; +} + +/** + This function returns the transport capabilities. + + @param [out] TransportFeature Pointer to receive transport capab= ilities. + See the definitions of + MANAGEABILITY_TRANSPORT_CAPABILITY= . + +**/ +VOID +GetTransportCapability ( + OUT MANAGEABILITY_TRANSPORT_CAPABILITY *TransportCapability + ) +{ + *TransportCapability =3D 0; +} + +/** + This function releases the manageability session. + + @param [in] TransportToken The transport token acquired through + AcquireTransportSession. + @retval EFI_SUCCESS Token is released successfully. + Otherwise Other errors. + +**/ +EFI_STATUS +ReleaseTransportSession ( + IN MANAGEABILITY_TRANSPORT_TOKEN *TransportToken + ) +{ + return EFI_SUCCESS; +} diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNu= llLib/BaseManageabilityTransportNull.uni b/Features/ManageabilityPkg/Librar= y/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni new file mode 100644 index 0000000000..2211037072 --- /dev/null +++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLi +++ b/BaseManageabilityTransportNull.uni @@ -0,0 +1,13 @@ +// /** @file +// Null instance of Manageability Transport Library // // Copyright (C)=20 +2023 Advanced Micro Devices, Inc. All rights reserved.
// //=20 +SPDX-License-Identifier: BSD-2-Clause-Patent // // **/ + +#string STR_MODULE_ABSTRACT #language en-US "Null instance of = Manageability Transport Library" + +#string STR_MODULE_DESCRIPTION #language en-US "Manageability Tra= nsport library implementation for build ManageabilityPkg only." + -- 2.37.1.windows.1