MdeModulePkg/Bus: Fix port multiplier port in AhciPei PEIM

If there is no port multiplier, PortMultiplierPort should be converted
to 0 to follow AHCI spec.
The same logic already applied in AtaAtapiPassThruDxe driver.

Signed-off-by: Neo Hsueh <Hong-Chih.Hsueh@amd.com>
Acked-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Neo Hsueh 2023-06-02 13:05:11 -05:00 committed by mergify[bot]
parent ded0b489af
commit 67fc78d026
1 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@
mode at PEI phase.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@ -92,6 +93,15 @@ AhciPassThruExecute (
{
EFI_STATUS Status;
if (PortMultiplierPort == 0xFFFF) {
//
// If there is no port multiplier, PortMultiplierPort will be 0xFFFF
// according to UEFI spec. Here, we convert its value to 0 to follow
// AHCI spec.
//
PortMultiplierPort = 0;
}
switch (Packet->Protocol) {
case EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA:
Status = AhciNonDataTransfer (