From nobody Tue May 14 09:01:34 2024 Delivered-To: importer@patchew.org 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+98010+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1672934493737377.23259251972536; Thu, 5 Jan 2023 08:01:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id KvHpYY1788612xcW9Eb3EIEp; Thu, 05 Jan 2023 08:01:33 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.56]) by mx.groups.io with SMTP id smtpd.web11.16446.1672934492752064984 for ; Thu, 05 Jan 2023 08:01:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B4ipTZzj5PiP/gcN84yUNEJH0DzxH1WTHRJPJMOQltEvYaErUTdgyj1A+8ZQFAjZ94FDNh19fFS80d6DwkXcR9nqyT5X4TWipUiAPqR+mms51cNtEj0fw0XM4HmsB5wDS8edyK2IpVmIZXZfQ2K+d16REEzttLwP9dbolr/nGNABLc5+NAM6ZqO0yHNmeUKZIK87f8k5EZLW+aG0KLWU8Rj1Fsec/FDac9TXOhIuFEX2Q74vRn0fNVdIHoB497kW5TEq3sCYwVJZK+HO40lAsGPl3CX98PGfUCiq+r5Qo4vyobAh6s9AZ5HJEc3lF7JWEG7s4EuEFPRYYNc/T2Rz/A== 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=XWivf9cqbzstoexB3Avryy0k5yodwp+v+CsDUb6kR0w=; b=LpHjnzSfWrN8uC2DZcJtxOhUWUpqzpal9PBHDZvJYSc1mtMGaz4C+Pz04W3GZRBlRAuWIUv8DmRiuiuGFYC1TY0L07aWxlODbP6eYMbZ9DP04Q+zITIO7XNbYiPM7EpD36qa8EHIQRlEZBik+Kv1r7EJ5W5WyuqNIQlJo7x/QB8qaQPYtvTpA00CSYTXtH2KPyxF0eCJjmsoigfHDEVAjRf5FO8SeG9cb4Rfr7MkrM4h8mqxXP7k4E5YxiuQNE68MBb4HR2GvTZvxH7X+/mpD1yhgqCFFhSOlhxz4tV7sXqt5zeJA+FynrppwlPw5KV5NxziTadICfwVa/whDMO+ew== 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 X-Received: from DS7PR05CA0053.namprd05.prod.outlook.com (2603:10b6:8:2f::34) by CH3PR12MB7691.namprd12.prod.outlook.com (2603:10b6:610:151::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Thu, 5 Jan 2023 16:01:30 +0000 X-Received: from DS1PEPF0000E63E.namprd02.prod.outlook.com (2603:10b6:8:2f:cafe::31) by DS7PR05CA0053.outlook.office365.com (2603:10b6:8:2f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.6 via Frontend Transport; Thu, 5 Jan 2023 16:01:30 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+98010+1787277+3901457@groups.io; helo=mail02.groups.io; 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 X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E63E.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.15 via Frontend Transport; Thu, 5 Jan 2023 16:01:30 +0000 X-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; Thu, 5 Jan 2023 10:01:27 -0600 From: "Chang, Abner via groups.io" To: CC: Isaac Oram , Nate DeSimone , Liming Gao , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [edk2-platforms][PATCH V2] IpmiFeaturePkg/IpmiCommandLib: Add IPMI functions Date: Fri, 6 Jan 2023 00:00:59 +0800 Message-ID: <20230105160100.772-3-abner.chang@amd.com> In-Reply-To: <20230105160100.772-1-abner.chang@amd.com> References: <20230105160100.772-1-abner.chang@amd.com> MIME-Version: 1.0 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: DS1PEPF0000E63E:EE_|CH3PR12MB7691:EE_ X-MS-Office365-Filtering-Correlation-Id: ab3a88bc-c773-4b57-87bb-08daef361c4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: l/Yn2xfUW97YGYNc9kkXNyPaiPif07VdhbbT1/VGIJhPVp8frD9OUuQf0vF9Kp+CHH7c00aVkF9NddDtMOHFQ1fqLCPxTGfo+JisQJPWEpvCu6X+SCFLLEBVOmwSWTtukMRhYc2BA9c6TSwSw2aPpi33swfyzgVlejg/WujmlKiV+0z2nnHDqRrgQt9jraDBj2/0XQqeJDxp4hhf7Poi3FnvJETCuEHqCA/M2JlELxocUvpJUvdwAWKSksz4ewVqjKXfyOK8QTp8akN363Jqzl1aRqOo9eRmELcnlBQYHOB2Z9sxUpSh4V1Ews6G8vgyNzThRXWAyseloZ+njD/KvTZkJaMC+/H5RHAC4Gu1c8exDbrn9zcPRBT5WhX6ARMsKIYja489EtzPoRD1brOGzWaCtjtZ3eMIk9Q4kjFt+ArBfS0R6wUdMNWXlYtO88lTfz4q5M40Ny88U3Hehmz0qd1OCzmZKwkHaxIsU41DchCApJr1MqB+iGBvPDUPqmCG0VJhpiUS5y5HWbppbn2XYF4xkiw9vUveh1ppVs4XK6k+mxfrHF2QKQEqkTOPIeoANpDxNivbkAyqKFOtOPa5LVOYsbMDxZTLa/GBg10Gv+lOQDMZJTuSUx0MIZWAWCwoVc4jLv0mICCA+0xaVKzWWci3RUI06KGk2khPVVkVJeTs06snuCc9yP2DnZQxohrd2gnIaVEMyoqfVGmy1Kr5CJfGYJUIBZJG63+DC/HnT6c= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2023 16:01:30.7484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab3a88bc-c773-4b57-87bb-08daef361c4a 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: DS1PEPF0000E63E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 Precedence: Bulk List-Unsubscribe: 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,abner.chang@amd.com X-Gm-Message-State: T3vD44D0epCoriJpknu8LWRFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1672934493; bh=rtdyMRgSkTZMLJniTeXEP9r7dGGhIPaZ/fTe03KMYfk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=BPHzJzDffoAOm+TDteCSwD+ALwHdwF0gYjcHybuCuQkI7mo0Zxus+DUda4VrALYvotL aKqft4F6PxeHwkhsdjHZd3F+sSGYNm5GJQvLJaCs1PGd2FNioXSEirB54dkMKXx6kyNIa XeeL4uEUM2cjoO4WBwlsnRcx3Uj765Pc2kU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1672934494796100005 Content-Type: text/plain; charset="utf-8" From: Abner Chang Add functions to get system UUID and LAN configuration parameter. Signed-off-by: Abner Chang Cc: Isaac Oram Cc: Nate DeSimone Cc: Liming Gao Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Isaac Oram --- .../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 88 +++++++++++++++++++ .../IpmiCommandLibNetFnTransport.c | 43 +++++++++ 2 files changed, 131 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnApp.c b/Features/Intel/OutOfBandManagement/Ip= miFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c index addabc554e..2e34909f3e 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommand= Lib/IpmiCommandLibNetFnApp.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommand= Lib/IpmiCommandLibNetFnApp.c @@ -2,6 +2,8 @@ IPMI Command - NetFnApp. =20 Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -245,3 +247,89 @@ IpmiSendMessage ( ); return Status; } + +/** + This function gets the system UUID. + + @param[out] SystemGuid The pointer to retrieve system UUID. + + @retval EFI_SUCCESS UUID is returned. + @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer. + @retval Others Other errors. + +**/ +EFI_STATUS +EFIAPI +IpmiGetSystemUuid ( + OUT EFI_GUID *SystemGuid + ) +{ + EFI_STATUS Status; + UINT32 RequestSize; + UINT32 ResponseSize; + IPMI_GET_SYSTEM_UUID_RESPONSE GetSystemUuidResponse; + + if (SystemGuid =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + RequestSize =3D 0; + ResponseSize =3D sizeof (IPMI_GET_SYSTEM_UUID_RESPONSE); + Status =3D IpmiSubmitCommand ( + IPMI_NETFN_APP, + IPMI_APP_GET_SYSTEM_GUID, + (VOID *)NULL, + RequestSize, + (VOID *)&GetSystemUuidResponse, + &ResponseSize + ); + if (!EFI_ERROR (Status) && GetSystemUuidResponse.CompletionCode =3D=3D I= PMI_COMP_CODE_NORMAL) { + CopyMem ( + (VOID *)SystemGuid, + (VOID *)&GetSystemUuidResponse.SystemUuid, + sizeof (EFI_GUID) + ); + } + return Status; +} + +/** + This function gets the channel information. + + @param[in] GetChannelInfoRequest The get channel information r= equest. + @param[out] GetChannelInfoResponse The get channel information r= esponse. + @param[out] GetChannelInfoResponseSize When input, the expected size= of response. + When output, the exact size o= f the returned + response. + + @retval EFI_SUCCESS Get channel information successfully. + @retval EFI_INVALID_PARAMETER One of the given input parameters is inva= lid. + @retval Others Other errors. + +**/ +EFI_STATUS +EFIAPI +IpmiGetChannelInfo ( + IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest, + OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse, + OUT UINT32 *GetChannelInfoResponseSize + ) +{ + EFI_STATUS Status; + + if (GetChannelInfoRequest =3D=3D NULL || + GetChannelInfoResponse =3D=3D NULL || + GetChannelInfoResponseSize =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + *GetChannelInfoResponseSize =3D sizeof (IPMI_GET_CHANNEL_INFO_RESPONSE); + Status =3D IpmiSubmitCommand ( + IPMI_NETFN_APP, + IPMI_APP_GET_CHANNEL_INFO, + (UINT8 *)GetChannelInfoRequest, + sizeof (IPMI_GET_CHANNEL_INFO_REQUEST), + (UINT8 *)GetChannelInfoResponse, + GetChannelInfoResponseSize + ); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnTransport.c b/Features/Intel/OutOfBandManagem= ent/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c index 7dfcf86126..30ea84c04b 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommand= Lib/IpmiCommandLibNetFnTransport.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommand= Lib/IpmiCommandLibNetFnTransport.c @@ -2,6 +2,8 @@ IPMI Command - NetFnTransport. =20 Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -78,3 +80,44 @@ IpmiGetSolConfigurationParameters ( ); return Status; } + +/** + This function gets the LAN configuration parameter. + + @param[in] GetLanConfigurationParametersRequest Request data + @param[out] GetLanConfigurationParametersResponse Response data + @param[in,out] GetLanConfigurationParametersSize When input, the ex= pected size of response data. + When out, the exac= t size of response data. + + @retval EFI_SUCCESS Lan configuration parameter is returned i= n the response. + @retval EFI_INVALID_PARAMETER One of the given input parameters is inva= lid. + @retval Others Other errors. + +**/ + +EFI_STATUS +EFIAPI +IpmiGetLanConfigurationParameters ( + IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST *GetLanConfigurati= onParametersRequest, + OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE *GetLanConfigurati= onParametersResponse, + IN OUT UINT32 *GetLanConfigurati= onParametersSize + ) +{ + EFI_STATUS Status; + + if (GetLanConfigurationParametersRequest =3D=3D NULL || + GetLanConfigurationParametersResponse =3D=3D NULL || + GetLanConfigurationParametersSize =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + Status =3D IpmiSubmitCommand ( + IPMI_NETFN_TRANSPORT, + IPMI_TRANSPORT_GET_LAN_CONFIG_PARAMETERS, + (UINT8 *)GetLanConfigurationParametersRequest, + sizeof(*GetLanConfigurationParametersRequest), + (UINT8 *)GetLanConfigurationParametersResponse, + GetLanConfigurationParametersSize + ); + return Status; +} --=20 2.37.1.windows.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 (#98010): https://edk2.groups.io/g/devel/message/98010 Mute This Topic: https://groups.io/mt/96074595/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-