summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c')
-rw-r--r--MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
index bf0489fa6b..42e4203a22 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
@@ -28,19 +28,19 @@
**/
UINT8
AhciS3GetEumeratePorts (
- IN EFI_DEVICE_PATH_PROTOCOL *HcDevicePath,
- IN UINTN HcDevicePathLength,
- OUT UINT32 *PortBitMap
+ IN EFI_DEVICE_PATH_PROTOCOL *HcDevicePath,
+ IN UINTN HcDevicePathLength,
+ OUT UINT32 *PortBitMap
)
{
- EFI_STATUS Status;
- UINT8 DummyData;
- UINTN S3InitDevicesLength;
- EFI_DEVICE_PATH_PROTOCOL *S3InitDevices;
- EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
- UINTN DevicePathInstLength;
- BOOLEAN EntireEnd;
- SATA_DEVICE_PATH *SataDeviceNode;
+ EFI_STATUS Status;
+ UINT8 DummyData;
+ UINTN S3InitDevicesLength;
+ EFI_DEVICE_PATH_PROTOCOL *S3InitDevices;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
+ UINTN DevicePathInstLength;
+ BOOLEAN EntireEnd;
+ SATA_DEVICE_PATH *SataDeviceNode;
*PortBitMap = 0;
@@ -51,7 +51,7 @@ AhciS3GetEumeratePorts (
S3InitDevices = NULL;
S3InitDevicesLength = sizeof (DummyData);
EntireEnd = FALSE;
- Status = RestoreLockBox (&gS3StorageDeviceInitListGuid, &DummyData, &S3InitDevicesLength);
+ Status = RestoreLockBox (&gS3StorageDeviceInitListGuid, &DummyData, &S3InitDevicesLength);
if (Status != EFI_BUFFER_TOO_SMALL) {
return 0;
} else {
@@ -87,7 +87,7 @@ AhciS3GetEumeratePorts (
}
DevicePathInst = S3InitDevices;
- S3InitDevices = (EFI_DEVICE_PATH_PROTOCOL *)((UINTN) S3InitDevices + DevicePathInstLength);
+ S3InitDevices = (EFI_DEVICE_PATH_PROTOCOL *)((UINTN)S3InitDevices + DevicePathInstLength);
if (HcDevicePathLength >= DevicePathInstLength) {
continue;
@@ -101,25 +101,30 @@ AhciS3GetEumeratePorts (
DevicePathInst,
HcDevicePath,
HcDevicePathLength - sizeof (EFI_DEVICE_PATH_PROTOCOL)
- ) == 0) {
+ ) == 0)
+ {
//
// Get the port number.
//
while (DevicePathInst->Type != END_DEVICE_PATH_TYPE) {
if ((DevicePathInst->Type == MESSAGING_DEVICE_PATH) &&
- (DevicePathInst->SubType == MSG_SATA_DP)) {
- SataDeviceNode = (SATA_DEVICE_PATH *) DevicePathInst;
+ (DevicePathInst->SubType == MSG_SATA_DP))
+ {
+ SataDeviceNode = (SATA_DEVICE_PATH *)DevicePathInst;
//
// For now, the driver only support upto AHCI_MAX_PORTS ports and
// devices directly connected to a HBA.
//
if ((SataDeviceNode->HBAPortNumber >= AHCI_MAX_PORTS) ||
- (SataDeviceNode->PortMultiplierPortNumber != 0xFFFF)) {
+ (SataDeviceNode->PortMultiplierPortNumber != 0xFFFF))
+ {
break;
}
+
*PortBitMap |= (UINT32)BIT0 << SataDeviceNode->HBAPortNumber;
break;
}
+
DevicePathInst = NextDevicePathNode (DevicePathInst);
}
}