From: "Chang, Abner via groups.io" <abner.chang=amd.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>,
Nickle Wang <nicklew@nvidia.com>
Subject: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command
Date: Tue, 10 Oct 2023 23:16:39 +0800 [thread overview]
Message-ID: <20231010151639.293-1-abner.chang@amd.com> (raw)
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 (#109497): https://edk2.groups.io/g/devel/message/109497
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]
-=-=-=-=-=-=-=-=-=-=-=-
next reply other threads:[~2023-10-10 15:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 15:16 Chang, Abner via groups.io [this message]
2023-10-10 15:31 ` [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command Attar, AbdulLateef (Abdul Lateef) via groups.io
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=20231010151639.293-1-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