From: Abner Chang <abner.ch...@amd.com> Add C header file of MCTP manageability transport interface library.
Signed-off-by: Abner Chang <abner.ch...@amd.com> Cc: Isaac Oram <isaac.w.o...@intel.com> Cc: Abdul Lateef Attar <abdat...@amd.com> Cc: Nickle Wang <nick...@nvidia.com> Cc: Igor Kulchytskyy <ig...@ami.com> Reviewed-by: Nickle Wang <nick...@nvidia.com> --- .../Library/ManageabilityTransportMctpLib.h | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h diff --git a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h new file mode 100644 index 0000000000..43bd142f4c --- /dev/null +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h @@ -0,0 +1,54 @@ +/** @file + + This file defines the manageability MCTP protocol specific transport data. + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MANAGEABILITY_TRANSPORT_MCTP_LIB_H_ +#define MANAGEABILITY_TRANSPORT_MCTP_LIB_H_ + +#include <Library/ManageabilityTransportLib.h> + +#define MCTP_KCS_HEADER_VERSION 0x01 + +// According to SMBUS spec, the polynomial is: +// C(x) = X^8 + X^2 + X^1 + 1, which is 0x107, +// just ignore bit8 in definition. +#define MCTP_KCS_PACKET_ERROR_CODE_POLY 0x07 + +/// +/// The MCTP Message header which is apart from +/// the payload. +/// + +typedef struct { + UINT8 IntegrityCheck : 1; ///< Message integrity check. + UINT8 MessageType : 7; ///< Message type. +} MANAGEABILITY_MCTP_MESSAGE_HEADER; + +typedef struct { + UINT8 SourceEndpointId; + UINT8 DestinationEndpointId; + MANAGEABILITY_MCTP_MESSAGE_HEADER MessageHeader; +} MANAGEABILITY_MCTP_TRANSPORT_HEADER; + +typedef struct { + UINT8 NetFunc; ///< Message integrity check. + UINT8 DefiningBody; ///< Message type. + UINT8 ByteCount; ///< Byte count of payload. +} MANAGEABILITY_MCTP_KCS_HEADER; +#define MCTP_KCS_NETFN_LUN 0xb0 +#define DEFINING_BODY_DMTF_PRE_OS_WORKING_GROUP 0x01 + +// This is used to track the response message. This value +// is not defined by the specification. +#define MCTP_MESSAGE_TAG 0x1 + +#define MCTP_MESSAGE_TAG_OWNER_REQUEST 0x01 +#define MCTP_MESSAGE_TAG_OWNER_RESPONSE 0x01 + +#define MCTP_PACKET_SEQUENCE_MASK 0x3 + +#endif // MANAGEABILITY_TRANSPORT_MCTP_LIB_H_ -- 2.37.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103362): https://edk2.groups.io/g/devel/message/103362 Mute This Topic: https://groups.io/mt/98404959/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-