From: "Attar, AbdulLateef (Abdul Lateef) via groups.io" <AbdulLateef.Attar=amd.com@groups.io>
To: "Chang, Abner" <Abner.Chang@amd.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Nickle Wang <nicklew@nvidia.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command
Date: Tue, 10 Oct 2023 15:31:06 +0000 [thread overview]
Message-ID: <IA1PR12MB6458F8245A9826AE02760DC3E0CDA@IA1PR12MB6458.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20231010151639.293-1-abner.chang@amd.com>
[AMD Official Use Only - General]
Looks good.
Reviewed-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
-----Original Message-----
From: Chang, Abner <Abner.Chang@amd.com>
Sent: Tuesday, October 10, 2023 8:47 PM
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Nickle Wang <nicklew@nvidia.com>
Subject: [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command
From: Abner Chang <abner.chang@amd.com>
Implment AppFn, 0x57 command.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
---
.../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 68 +++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
index e580ec2ece..f145e291a9 100644
--- a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
+++ b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
@@ -442,3 +442,71 @@ IpmiGetChannelInfo (
);
return Status;
}
+
+/**
+ This function gets system interface capability
+
+ @param[in] InterfaceCapabilityRequest Get system interface capability request.
+ @param[out] InterfaceCapabilityResponse The response of system interface capability.
+ That is caller's responsibility to allocate
+ memory for the response data.
+
+ @retval EFI_SUCCESS Command is sent successfully.
+ @retval Other Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemInterfaceCapability (
+ IN IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST *InterfaceCapabilityRequest,
+ OUT IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_RESPONSE *InterfaceCapabilityResponse
+ )
+{
+ UINT8 InterfaceType;
+ UINT32 ResponseSize;
+ UINT32 ActualResponseSize;
+ UINT8 *ResponsePtr;
+ EFI_STATUS Status;
+
+ if (InterfaceCapabilityRequest == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ InterfaceType = InterfaceCapabilityRequest->Bits.InterfaceType;
+ if ((InterfaceType != IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF) &&
+ (InterfaceType != IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS) &&
+ (InterfaceType != IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC))
+ {
+ DEBUG ((DEBUG_ERROR, "%a: Unsupported given system interface type = 0x%x.\n", __func__, InterfaceType));
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (InterfaceType == IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF) {
+ ResponseSize = sizeof (IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE);
+ ResponsePtr = (UINT8 *)InterfaceCapabilityResponse->InterfaceSsifCapability;
+ } else {
+ ResponseSize = sizeof (IPMI_GET_SYSTEM_INTERFACE_KCS_SMIC_CAPABILITIES_RESPONSE);
+ ResponsePtr = (UINT8 *)InterfaceCapabilityResponse->InterfaceKcsSmicCapability;
+ }
+
+ ActualResponseSize = ResponseSize;
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_SYSTEM_INTERFACE_CAPABILITIES,
+ (UINT8 *)InterfaceCapabilityRequest,
+ sizeof (IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST),
+ ResponsePtr,
+ &ActualResponseSize
+ );
+ if (ActualResponseSize != ResponseSize) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a: The expected response size 0x%x is not equal to the returned size 0x%x.\n",
+ __func__,
+ ResponseSize,
+ ActualResponseSize
+ ));
+ }
+
+ return Status;
+}
--
2.37.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109500): https://edk2.groups.io/g/devel/message/109500
Mute This Topic: https://groups.io/mt/101877172/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2023-10-10 15:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 15:16 [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command Chang, Abner via groups.io
2023-10-10 15:31 ` Attar, AbdulLateef (Abdul Lateef) via groups.io [this message]
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=IA1PR12MB6458F8245A9826AE02760DC3E0CDA@IA1PR12MB6458.namprd12.prod.outlook.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