From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.57]) by mx.groups.io with SMTP id smtpd.web10.4743.1679368928793566824 for ; Mon, 20 Mar 2023 20:22:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=O0TqukjR; 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.95.57, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfLL7zGNQInB4GIp8cQk3ssHAgYEL+Z9K9lvU6L8ZGPXSCyCrjZ1bkfr9fpY1Q0GzXa5J2cjj05Ll24VhmrhgtEBJN15Zso1WZhEMallok0TSz5VzZbj8JGQqYyl5oNCG+1aEhsh5Oxyx6uTdz2hI+O3m/LPkqsqZ1U8ueyIZ0HTzTH75fLTL9kIz+p4eQj+Lre7L+I4BJmukcJOzj6Es9dH/VYeyLxkNPE6PLvJZbGuZNPGVVMRHhctA4Md3Hgw+e4sQTVQq68kHKWquoku7Gv3kcS1nRsnLaCNLvGDwOz7jMaXC6/5MyFbvFy1GGgyhAGh3cTr+gIrDe99G6030w== 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=7TuJ0iDP9WSWN+FewU+Pwvi6JjglLxZxHwZ+9oeDvLw=; b=NWjjAq5p03BMQ86jC5qA2M+SNoucXLG2eFtFeMuY6s5ultWhMD4SwXDfDRhZEObrA5Iyu1tj3ro7UUol2DogktljHkl9BbEvOo8z+W8F6w9WYv9e2Z4FYa0uXoEgadVteKC+ALzhCAnW25ZNGCmQNg48H4690AVEq0snID3cmbIf04yTKPN+adCDFXYFwz7C+W173H4f7lmVhYaq3ejCs8DzVaqYivRapfzXD3YD3KugANOqGZSCi/yxWMlaH4Qw3L0HWbeF9I6C19XqMlsjDK4eLv3ihn8wZTauFxZV7dg/5z4iUhNRHtPFiG193E1JEhMedpfiCwSGNrdLCOIXPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=7TuJ0iDP9WSWN+FewU+Pwvi6JjglLxZxHwZ+9oeDvLw=; b=O0TqukjRA3T3zKJn+czocGnbqw8TjUJ9hbFUzwV0IzYf5bBfj8zcEfOfTYrxARJ0eXTFUt+9gNPt6qtTjdykC9WpT8afcDqHChdIW8zOlEEUTZKcQ6dRAFGcZo/oWgV2d3jnsuxm0/VBcLPQ5t15rneWUYtSUoJiGnvDwmwj8MQ= Received: from MW4PR04CA0215.namprd04.prod.outlook.com (2603:10b6:303:87::10) by MN2PR12MB4253.namprd12.prod.outlook.com (2603:10b6:208:1de::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 03:22:06 +0000 Received: from CO1NAM11FT108.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::8c) by MW4PR04CA0215.outlook.office365.com (2603:10b6:303:87::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37 via Frontend Transport; Tue, 21 Mar 2023 03:22:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT108.mail.protection.outlook.com (10.13.175.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.16 via Frontend Transport; Tue, 21 Mar 2023 03:22:05 +0000 Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 20 Mar 2023 22:22:02 -0500 From: "Chang, Abner" To: CC: Liming Gao , Isaac Oram , Nate DeSimone , Nickle Wang , Igor Kulchytskyy , "Abdul Lateef Attar" Subject: [PATCH v3 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib Date: Tue, 21 Mar 2023 11:21:42 +0800 Message-ID: <20230321032147.1616-1-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT108:EE_|MN2PR12MB4253:EE_ X-MS-Office365-Filtering-Correlation-Id: a5ebacfb-eecb-4079-252b-08db29bb727b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AqO97DDFGemThBpPlHJ/CeB+W0wNPAZ9pVeUxZvoC/uG+fq8k3x7F6weQ9C+0UI5xwYTOdQS6sU00D3SWQ31Vxos3vGJwXhpKS8IqsRl3wFt+w/TJSylUOCouSLR4ADmyV7ou+T9klhWoXOiulkOMwiosx/Z6PudYD9Ohpr4RQXn2m40+ixbL6E7qSdWHRN0crFUZTOJHQn2OJoagRgumxyw6dctpPcaKqYutZKO0i8oBw3aDncFgueUJj4lo1vqJJCFXub7kBKEWYzKSfJkA+do9Wn9U7U0RjSXZxHNqXynUiG5vjpZEwAlzHJiUS69pHxzIRIYGqQ9Gy0jrUO1GBo7Exr7j0Nd25OU3TABn6nQNQkYzTi/wCwaskfdKbRamAk/4GKg4JnFCB3ojxIdnet+IgMMuVDNxZGlXzK0d1mzBx9T3Q0f4Q2W2/tzuJ1oZ90Pm9ztYFTHUfW5SlarBV89V+KJAijqtpS4jzVxvWoSEpe7JQ5ZsIBnXOmT3MuJ7T7Oa3pFFveS1JuP/ZE9fZfMdPOqNqkOFDsXm1WPZ2EpAZGjzooRoWMiXoODe8TPkU0xcAMubFssm5RbBe//7jwT6ECZLgg8AGHTeHMGM7I3HMelkJBobonljKKjBVUDAZZnCxUwa+fB7XTGVSOmdeQVc8MRSKwyNEOZbhkh08K7FaIXV1yhAbgv6LKXsAcwAWd8DVgzAUIaoEe4bvei30qmW9PW6bG0sinlXHJPgiY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(396003)(346002)(136003)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(86362001)(356005)(40460700003)(4326008)(36756003)(41300700001)(54906003)(70586007)(316002)(8936002)(8676002)(30864003)(70206006)(478600001)(5660300002)(6916009)(2876002)(82310400005)(426003)(2906002)(36860700001)(83380400001)(82740400003)(6666004)(186003)(26005)(16526019)(47076005)(1076003)(336012)(81166007)(2616005)(7696005)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 03:22:05.7790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5ebacfb-eecb-4079-252b-08db29bb727b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT108.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4253 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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 Reviewed-by: Nickle Wang --- .../ManageabilityPkg/ManageabilityPkg.dec | 9 + .../ManageabilityPkg/ManageabilityPkg.dsc | 4 +- .../BaseManageabilityTransportNull.inf | 28 ++ .../Library/ManageabilityTransportIpmiLib.h | 24 ++ .../Library/ManageabilityTransportLib.h | 336 ++++++++++++++++++ .../BaseManageabilityTransportNull.c | 64 ++++ .../BaseManageabilityTransportNull.uni | 13 + 7 files changed, 477 insertions(+), 1 deletion(-) create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTran= sportNullLib/BaseManageabilityTransportNull.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 @@ =20 [Includes] Include + +[LibraryClasses] + ## @libraryclass Manageability Transport Library + # Manageability Transport Library definitions + ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h + +[Guids] + gManageabilityPkgTokenSpaceGuid =3D { 0xBDEFFF48, 0x1C31, 0x49CD, { 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 =20 -!include Include/Dsc/Manageability.dsc +[LibraryClasses] + ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTran= sportNullLib/BaseManageabilityTransportNull.inf =20 +!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/BaseManageabilityTransportNullLib/B= aseManageabilityTransportNull.inf @@ -0,0 +1,28 @@ +## @file +# Null instance of Manageability Transport Library +# +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# 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/ManageabilityTransportIpmiL= ib.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 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..c022b4ac5c --- /dev/null +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h @@ -0,0 +1,336 @@ +/** @file + + This file defines the manageability transport interface library and func= tions. + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 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 MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR 0 +#define MANAGEABILITY_TRANSPORT_TOKEN_VERSION ((MANAGEABILITY_TRANS= PORT_TOKEN_VERSION_MAJOR << 8) |\ + MANAGEABILITY_TRANSPORT_TO= KEN_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 transport interface. +/// +typedef VOID *MANAGEABILITY_TRANSPORT_HEADER; +typedef VOID *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 0x0000000= 4 +#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NOT_AVAILABLE 0xfffffff= f + +/// +/// 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 +/// introduced to the Manageability transport library in the future. +/// The new added function must has its own MANAGEABILITY_TRANSPORT_FUNCTI= ON +/// structure with the incremental version number. +/// e.g., MANAGEABILITY_TRANSPORT_FUNCTION_V1_1. +/// +/// The new function must be added base on the last version of +/// 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 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 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 managea= bility + 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 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 tra= nsport + interface. The additional information of transport interface could be op= tionally + returned in TransportAdditionalStatus to describes the status that 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 *TransportAdditionalStatu= s OPTIONAL + ); + +/** + This function transmit the request over target transport interface. + The generic EFI_STATUS is returned to caller directly after reseting tra= nsport + interface. The additional information of transport interface could be op= tionally + returned in TransportAdditionalStatus to describes the status that 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/BaseManageabilityTransportNullLib/B= aseManageabilityTransportNull.c @@ -0,0 +1,64 @@ +/** @file + Null instance of Manageability Transport Library + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +/** + This function acquires to create a transport session to transmit managea= bility + 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/BaseManageabilityTransportNullLib/B= aseManageabilityTransportNull.uni @@ -0,0 +1,13 @@ +// /** @file +// Null instance of Manageability Transport Library +// +// Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. +// +// 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." + --=20 2.37.1.windows.1