Now the logic of the function is less convoluted, drop some redundant
casts, variable initialisations and move the MiddleCount definition
into the only block where it's used.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
A multi-part request can consist of a Start, zero-to-several Middle,
and an End packet. For what I can only assume was an attempt to
confuse the enemy, SsifWriteRequest () handled this by setting up
three separate loops.
Rewrite this as a single loop in order to reduce confusion for
revewers and compilers.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
From the IPMI v2.0 (April 21, 2015 E7 Markup) specification,
Table 22-12, Get System Interface Capabilities Command:
"Input message size in bytes. (1 based.)"
...
"A BMC that supports multi-part Start and End would return
a value from 33 to 64. A BMC that supports multi-part with Middle
transactions would return a value from 65 to 255."
Yet the comment in the existing code describes this as being a
counter of the number of middle packets, with Start and End packets
counting outside of that. This seems very incorrect to me.
Address this, and simplify the code, by using the already existing
global variable mMaxRequestSize. Update the debug error message
text to reflect the functional change.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
For some reason this module was created "backwards", with .inf files
in subdirectories, as well as identical apart from failes to keep in
sync source files for Dxe and Pei drivers.
Flip the thing the right way around and delete the duplicated files.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
While reviewing PR #12035, I found this function a bit overcomplicated,
with a bunch of live-coded integers, so I reworked it for improved
human and compiler readability.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
In HelperManageabilityPayLoadDebugPrint(), Page256 is only assigned
inside an if block within the while loop but is accessed outside of
it, causing an uninitialized variable warning.
Initialize Page256 to zero before the while loop to fix this.
Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
In SsifWriteRequest(), MiddleCount is only assigned inside an if
block but is accessed in a subsequent loop, causing an uninitialized
variable warning.
Initialize MiddleCount to zero at declaration to fix this.
Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
When building ManageabilityPkg with `-a X64 -t CLANGDWARF`, error
message is throwed:
BaseManageabilityTransportHelper.c:462:3: error:
'__builtin_ms_va_start' used in System V ABI function
462 | VA_START (Marker, Format);
| ^
Functions that call VA_START()/VA_END() must be declared with EFIAPI. The
function HelperManageabilityDebugPrint() should also be declared with
EFIAPI to ensure compliance with Microsoft X64 calling convention for
CLANG.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
Replace the hardcoded IPMI_KCS_TIMEOUT_5_SEC macro in WaitStatusSet() and
WaitStatusClear() with PcdKcsStatusCheckTimeout so platform firmware can
tune the KCS timeout without recompiling the library.
- ManageabilityPkg.dec: declare PcdKcsStatusCheckTimeout (UINT64, 5000000 us)
- KcsCommon.c: use PcdGet64(PcdKcsStatusCheckTimeout); add DEBUG on timeout
- ManageabilityTransportKcs.h: remove now-unused IPMI_KCS_TIMEOUT_5_SEC macro
- BaseManageabilityTransportKcs.inf, Dxe/DxeManageabilityTransportKcs.inf:
add PcdKcsStatusCheckTimeout to [FixedPcd]
Co-authored-by: Abner Chang <abner.chang@amd.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
ManageabilityPkg is migrated from edk2-platform repository.
The last commit ID of ManageabilityPkg on edk2-platform is
<4538a1b94c0e55d58e3841b2d640df7da0a3b149>.
Signed-off-by: Abner Chang <abner.chang@amd.com>