From nobody Mon Feb 9 10:48:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109909+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109909+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698066320; cv=none; d=zohomail.com; s=zohoarc; b=lmfgKQvH/Fo+OYqlP8zc0SgL3avFF4ub5jkHEsjCMOFkq+8WGD0vXqGdChq/5JwWvT8+OAUSAmOeF2HawHtg4WhyTrfNrK2n4v2R4XfeVjIoKNVYTxSU3rRN8pZ4SrzRCumlO/UgOX99SM029U3kkr+e009keuSl33IbCd+Vj5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698066320; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=uqgYQldTxAUY1NpC4PFIM3ImQPXijoSBryR58V9j9rw=; b=B3sJURXYFed17sOJJZJOxTEF72K90vqvh0QD9qyDfR2TCEKp4PXyE1z0Dq9w8erTmyYyOTYDy2N1QUFMiNcngBg/Gp+mCxUqOUnJZzrlaqB2Mh96x3jxhZuVh3ap+iBAMFgttW0kegE4rBrgDGYADX1+xtYEFqGFiq+a8ei4rTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109909+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169806632045773.62401167121686; Mon, 23 Oct 2023 06:05:20 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=8kvTkXJMVgHjWzqAdnK8Yh339FxOTAkiKWS6IDcgHaw=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698066320; v=1; b=Jn/rA8CgSDSFQ9+OhvvlGHXM3FBnOwb+joPQiGfMklgkh1J348LD4HLHP0GKtGOtcZXmOUfn w3Wo95f0U5EJE9/sja1uXoO0hABw9P/hfJvYhspRI191DRd/x5sdopADH4WpMyQKvdPbD9ng+zf D2LmoFi7CwtzAENRE4Icw9rY= X-Received: by 127.0.0.2 with SMTP id kEvLYY1788612xcE6L0v5D7X; Mon, 23 Oct 2023 06:05:20 -0700 X-Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by mx.groups.io with SMTP id smtpd.web10.119841.1698066318779968361 for ; Mon, 23 Oct 2023 06:05:19 -0700 X-Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2c51f5a1ecdso48699301fa.0 for ; Mon, 23 Oct 2023 06:05:18 -0700 (PDT) X-Gm-Message-State: c3ZJPfeR2B3bTSzG1UUoZVRPx1787277AA= X-Google-Smtp-Source: AGHT+IHeDX/0YqDtJg9LZ1ejvWNItMsC0VD+sofvNTifYlahLCfCYARiKTjXqasDsEaxwH+dHCK/TQ== X-Received: by 2002:a2e:a7ca:0:b0:2c0:1b06:c2c7 with SMTP id x10-20020a2ea7ca000000b002c01b06c2c7mr3874614ljp.20.1698066316459; Mon, 23 Oct 2023 06:05:16 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id r11-20020a2e994b000000b002b9e0d19644sm1550081ljj.106.2023.10.23.06.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:16 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms v3 01/16] ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure Date: Mon, 23 Oct 2023 16:04:56 +0300 Message-Id: <20231023130511.4521-2-aladyshev22@gmail.com> In-Reply-To: <20231023130511.4521-1-aladyshev22@gmail.com> References: <20231023130511.4521-1-aladyshev22@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,aladyshev22@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698066320770100003 Content-Type: text/plain; charset="utf-8" Currently there is only a definition for the MCTP KCS HEADER structure. Add definition for the MCTP KCS TRAILER structure as well. Signed-off-by: Konstantin Aladyshev Signed-off-by: Abner Chang Reviewed-by: Attar, AbdulLateef (Abdul Lateef) --- .../Library/ManageabilityTransportMctpLib.h | 5 +++++ .../MctpProtocol/Common/MctpProtocolCommon.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Features/ManageabilityPkg/Include/Library/ManageabilityTranspo= rtMctpLib.h b/Features/ManageabilityPkg/Include/Library/ManageabilityTransp= ortMctpLib.h index 43bd142f4c..462e7436e6 100644 --- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpL= ib.h +++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpL= ib.h @@ -39,6 +39,11 @@ typedef struct { UINT8 DefiningBody; ///< Message type. UINT8 ByteCount; ///< Byte count of payload. } MANAGEABILITY_MCTP_KCS_HEADER; + +typedef struct { + UINT8 Pec; ///< MCTP over KCS Packet Error Code. +} MANAGEABILITY_MCTP_KCS_TRAILER; + #define MCTP_KCS_NETFN_LUN 0xb0 #define DEFINING_BODY_DMTF_PRE_OS_WORKING_GROUP 0x01 =20 diff --git a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpPr= otocolCommon.c b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/Mc= tpProtocolCommon.c index 1ad48efdc7..7576007f77 100644 --- a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolC= ommon.c +++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolC= ommon.c @@ -132,7 +132,7 @@ SetupMctpRequestTransportPacket ( MANAGEABILITY_MCTP_KCS_HEADER *MctpKcsHeader; MCTP_TRANSPORT_HEADER *MctpTransportHeader; MCTP_MESSAGE_HEADER *MctpMessageHeader; - UINT8 *Pec; + MANAGEABILITY_MCTP_KCS_TRAILER *MctpKcsTrailer; UINT8 *ThisPackage; =20 if ((PacketHeader =3D=3D NULL) || (PacketHeaderSize =3D=3D NULL) || @@ -151,8 +151,8 @@ SetupMctpRequestTransportPacket ( return EFI_OUT_OF_RESOURCES; } =20 - Pec =3D (UINT8 *)AllocateZeroPool (sizeof (UINT8)); - if (Pec =3D=3D NULL) { + MctpKcsTrailer =3D (MANAGEABILITY_MCTP_KCS_TRAILER *)AllocateZeroPool = (sizeof (MANAGEABILITY_MCTP_KCS_TRAILER)); + if (MctpKcsTrailer =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: Not enough resource for PEC.\n", __func__)= ); FreePool (MctpKcsHeader); return EFI_OUT_OF_RESOURCES; @@ -167,7 +167,7 @@ SetupMctpRequestTransportPacket ( if (ThisPackage =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: Not enough resource for package.\n", __fun= c__)); FreePool (MctpKcsHeader); - FreePool (Pec); + FreePool (MctpKcsTrailer); return EFI_OUT_OF_RESOURCES; } =20 @@ -193,14 +193,14 @@ SetupMctpRequestTransportPacket ( =20 // // Generate PEC follow SMBUS 2.0 specification. - *Pec =3D HelperManageabilityGenerateCrc8 (MCTP_KCS_PACKET_ERROR_CODE_P= OLY, 0, ThisPackage, MctpKcsHeader->ByteCount); + MctpKcsTrailer->Pec =3D HelperManageabilityGenerateCrc8 (MCTP_KCS_PACK= ET_ERROR_CODE_POLY, 0, ThisPackage, MctpKcsHeader->ByteCount); =20 *PacketBody =3D (UINT8 *)ThisPackage; *PacketBodySize =3D MctpKcsHeader->ByteCount; - *PacketTrailer =3D (MANAGEABILITY_TRANSPORT_TRAILER)Pec; + *PacketTrailer =3D (MANAGEABILITY_TRANSPORT_TRAILER)MctpKcsTrailer; *PacketHeader =3D (MANAGEABILITY_TRANSPORT_HEADER)MctpKcsHeader; *PacketHeaderSize =3D sizeof (MANAGEABILITY_MCTP_KCS_HEADER); - *PacketTrailerSize =3D 1; + *PacketTrailerSize =3D sizeof (MANAGEABILITY_MCTP_KCS_TRAILER); return EFI_SUCCESS; } else { DEBUG ((DEBUG_ERROR, "%a: No implementation of building up packet.", _= _func__)); --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109909): https://edk2.groups.io/g/devel/message/109909 Mute This Topic: https://groups.io/mt/102134647/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-