public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chang, Abner" <abner.chang@amd.com>
To: <devel@edk2.groups.io>
Cc: Isaac Oram <isaac.w.oram@intel.com>,
	Abdul Lateef Attar <abdattar@amd.com>,
	Nickle Wang <nicklew@nvidia.com>,
	Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-platforms][PATCH V2 08/14] ManageabilityPkg: Add MCTP manageability header file
Date: Tue, 18 Apr 2023 15:15:37 +0800	[thread overview]
Message-ID: <20230418071543.1951-9-abner.chang@amd.com> (raw)
In-Reply-To: <20230418071543.1951-1-abner.chang@amd.com>

From: Abner Chang <abner.chang@amd.com>

Add C header file of MCTP manageability transport
interface library.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <abdattar@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.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


  parent reply	other threads:[~2023-04-18  7:16 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  7:15 [edk2-platforms][PATCH V2 00/14] ManageabilityPkg part II Chang, Abner
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 01/14] ManageabilityPkg: Add more helper functions Chang, Abner
2023-04-19  5:29   ` Attar, AbdulLateef (Abdul Lateef)
2023-04-20 15:18     ` Chang, Abner
2023-04-20  6:42   ` Nickle Wang
2023-04-20 15:45     ` Chang, Abner
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 02/14] ManageabilityPkg: Support Maximum Transfer Unit Chang, Abner
2023-04-20  4:28   ` Attar, AbdulLateef (Abdul Lateef)
2023-04-20  6:08   ` [edk2-devel] " Tinh Nguyen
2023-04-21  0:51     ` Chang, Abner
2023-04-21  6:59       ` Tinh Nguyen
2023-04-21  7:09         ` Chang, Abner
     [not found]         ` <1757E190B31AA266.29498@groups.io>
2023-04-24  1:42           ` Chang, Abner
     [not found]     ` <1757CCE5059D419D.29498@groups.io>
2023-04-21  5:26       ` Chang, Abner
2023-04-20  6:44   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 03/14] ManageabilityPkg: Add HeaderSize and TrailerSize Chang, Abner
2023-04-20  6:47   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 04/14] ManageabilityPkg: Add PldmProtocolLib Chang, Abner
2023-04-20  6:50   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 05/14] ManageabilityPkg: Add PldmSmbiosTransferDxe driver Chang, Abner
2023-04-20  6:52   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 06/14] ManageabilityPkg/KCS: KCS transport interface Chang, Abner
2023-04-20  6:53   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 07/14] ManageabilityPkg: Add definitions of MCTP Chang, Abner
2023-04-20  6:54   ` Nickle Wang
2023-04-18  7:15 ` Chang, Abner [this message]
2023-04-20  6:56   ` [edk2-platforms][PATCH V2 08/14] ManageabilityPkg: Add MCTP manageability header file Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 09/14] ManageabilityPkg/MctpProtocol: Add MctpProtocol Chang, Abner
2023-04-20  7:00   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 10/14] ManageabilityPkg: Add MCTP transport interface Chang, Abner
2023-04-20  7:04   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 11/14] ManageabilityPkg/PldmProtocol: Add PLDM protocol Chang, Abner
2023-04-20  7:05   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 12/14] ManageabilityPkg: Add Manageability PCDs Chang, Abner
2023-04-20  5:26   ` Tinh Nguyen
2023-04-20  7:07   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 13/14] ManageabilityPkg: Relocate Manageability.dsc Chang, Abner
2023-04-20  5:28   ` Tinh Nguyen
2023-04-20  7:08   ` Nickle Wang
2023-04-18  7:15 ` [edk2-platforms][PATCH V2 14/14] ManageabilityPkg: Add Manageability FDFs Chang, Abner
2023-04-20  5:29   ` Tinh Nguyen
2023-04-20  7:08   ` Nickle Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230418071543.1951-9-abner.chang@amd.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox