* [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command
@ 2023-10-10 15:16 Chang, Abner via groups.io
2023-10-10 15:31 ` Attar, AbdulLateef (Abdul Lateef) via groups.io
0 siblings, 1 reply; 2+ messages in thread
From: Chang, Abner via groups.io @ 2023-10-10 15:16 UTC (permalink / raw)
To: devel; +Cc: Abdul Lateef Attar, Nickle Wang
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]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command
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
0 siblings, 0 replies; 2+ messages in thread
From: Attar, AbdulLateef (Abdul Lateef) via groups.io @ 2023-10-10 15:31 UTC (permalink / raw)
To: Chang, Abner, devel@edk2.groups.io; +Cc: Nickle Wang
[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]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-10 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox