From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.79]) by mx.groups.io with SMTP id smtpd.web11.8266.1678285038421243364 for ; Wed, 08 Mar 2023 06:17:18 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=m2GUDdfX; 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.220.79, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mSGMcgWTczp31aTDMTR78hL0ZUxs8Wmd3Wr5T1y7FRE93M/69h+Nv0MWtO4OdpD4KEGboBFqVGfyRIbqKXnowwgvcp5RJ1s1nJGEHYnmTsLXnNAxD4RMRZVvdH40qjxHgY+GPKatyZqSbNQp5JNwGX8rnYkHaVN/eWO6vrgzMv/ktyKVCvHiH74QM794PFz6a8hwF9RaHBcLKEDmAq4COXGpqxPA5my5voqyy7y2HO8c1Ji16Jp5/JUZpz8Izb2ES4SFCFY44ETm5C01GtqzA+OHNVFkZBGNo133SmHJ77kXqFaAzqe0kkM2XzAvtOp7GFdr2VgTchKDPhkYn8JNhg== 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=8JByuioA8pu6PV+JFAmF6JSXVz4O4i/5ePzTafTCQ6w=; b=kWpwxIxomfilC/fj2eTOSsFrJgsp12UglQ56e8L9lNjImOrjAW2MVwK+WtifMYSHPRShDsanncogoXHmWSf64kjNZg4nAt4uQLZHL97udTJk0pPAdx8oh/JuUGOQUoOLowa4tMlhE4dOhIt0Oxi5nM7Wwt8tp8XwywDyGRazOIDG+OAe/+GyGPzinUYyDyzwRJcT4CmqbOE1Nlx5V3FQZZCSBD9pQCq5hLShFAcrBX/peDKuT8OfAKv+3LOxz3lkwRrOZ/xrQz8/vFZE+q6LG5SGOJLbsaHID4fMZ9g/DqXybPLzchp7HQqfwv5Mp6nt1OAVEpxS24wekCvbmIwQog== 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=8JByuioA8pu6PV+JFAmF6JSXVz4O4i/5ePzTafTCQ6w=; b=m2GUDdfXSxY1YcPJebbZBJz2p02T2wzCeBCjDhYvwUczzU2llaDqYhDN3hcN9vqtfhZ8vU3nJcYkgK1nA1EADj1kYqkPaBXeewWY1bgU1xlB8W5rIwl+FJpMEBS+qsCA0PWbBtJg+aoaNVaPdFMkzw3v8hR6SH0cVwIgiySHW3U= Received: from CYZPR19CA0011.namprd19.prod.outlook.com (2603:10b6:930:8e::9) by SA1PR12MB6893.namprd12.prod.outlook.com (2603:10b6:806:24c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.25; Wed, 8 Mar 2023 14:17:15 +0000 Received: from CY4PEPF0000C984.namprd02.prod.outlook.com (2603:10b6:930:8e:cafe::42) by CYZPR19CA0011.outlook.office365.com (2603:10b6:930:8e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Wed, 8 Mar 2023 14:17:15 +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 CY4PEPF0000C984.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.15 via Frontend Transport; Wed, 8 Mar 2023 14:17:15 +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; Wed, 8 Mar 2023 08:17:12 -0600 From: "Chang, Abner" To: CC: Liming Gao , Isaac Oram , Nate DeSimone , Nickle Wang , Igor Kulchytskyy , "Abdul Lateef Attar" Subject: [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib Date: Wed, 8 Mar 2023 22:16:42 +0800 Message-ID: <20230308141647.1318-4-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20230308141647.1318-1-abner.chang@amd.com> References: <20230308141647.1318-1-abner.chang@amd.com> 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: CY4PEPF0000C984:EE_|SA1PR12MB6893:EE_ X-MS-Office365-Filtering-Correlation-Id: 55a8aac0-313a-48d8-eb12-08db1fdfd14d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cajoqnAExZqS+yhcIrkMz2S1yaFa9/E9jOxQ2zFDh6RC2s+aYe+wURjzeCo60OJRQfSCXxsICJ0753fVtwnhSSk9q7aT7UJTArn9DrMr6TQnir5U7Yp/fR0P/MF/W+5svGj1wrI5wRrAJ9mLWobGYZ16ZkHQoQ87DeBnsbGmofN4mMdv3WBjzWretdL/n5CWAH3AATS0Kfiso8tGD041HVX10Uba6dOf/jkX9t2fGjJs+8xHy8EJ+sCQCZ7m/3vK0sqIdESjZGL11J8FIdt29fSvQyfKUrA8w0GnWFns5Dp71y9ar5tIsywd7ZchrdETDO69yUzd3lJ4xLPSMKTkkTzWVAo/8ZprWwjBwZOD8xhEcouam9R0Ivh6rI10atLrtrNDFU90t6q35dhpBxesyRVvl8biijqBeqE0xvhZvOQXvp2oYwwYQQNL2dS1lkTGo2DusnqvQpBEUHNFBfpiTjIXisC644MeiFQiXix1ne/s1bvJ/OtD3e/SjpHb3kB6u+FMv9HnTedjDHanCi5pbxjQizAfQUB8KY4xLD3HAqqL9C7n28ZJ7DwmWXGLL8PfwhMzKCaynFChQD7Gmjb+lmNWgRYfKiZGeqayULWkWfhN7ojFjoalkuin5b8DWJVV9F7w21ByWYEw6e3OaB951R5vo38u5FGj/YHZOzJ+IBRQfafoVct6SGoBxagRYyoXeZyZ1+A+RKxJHt95tr+K6eEgqBHuMkIXdDKILT1VrT0= 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)(396003)(39860400002)(376002)(346002)(136003)(451199018)(46966006)(36840700001)(40470700004)(1076003)(186003)(26005)(2906002)(478600001)(356005)(426003)(47076005)(16526019)(40480700001)(7696005)(2616005)(36756003)(2876002)(40460700003)(81166007)(8936002)(82740400003)(30864003)(36860700001)(6666004)(70206006)(82310400005)(336012)(4326008)(316002)(8676002)(41300700001)(83380400001)(6916009)(86362001)(5660300002)(54906003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 14:17:15.1832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55a8aac0-313a-48d8-eb12-08db1fdfd14d 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: CY4PEPF0000C984.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6893 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 --- .../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 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..2093cadbf9 --- /dev/null +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.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 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 + +/// +/// 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