]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
MdeModulePkg/Ata: Use a new Pcd named "PcdAtaSmartEnable" to control if enabling...
[mirror_edk2.git] / MdeModulePkg / Bus / Ata / AtaAtapiPassThru / AhciMode.c
index cfd2d807c31bd7e959817e65b756ceccf341ba4d..42ee5bc58091cdffc852c6fe99011cfbd1197f96 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The file for AHCI mode of ATA host controller.\r
 \r
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -503,12 +503,12 @@ AhciBuildCommand (
   IN     UINT8                      AtapiCommandLength,\r
   IN     UINT8                      CommandSlotNumber,\r
   IN OUT VOID                       *DataPhysicalAddr,\r
-  IN     UINT64                     DataLength\r
+  IN     UINT32                     DataLength\r
   )\r
 {\r
   UINT64     BaseAddr;\r
-  UINT64     PrdtNumber;\r
-  UINT64     PrdtIndex;\r
+  UINT32     PrdtNumber;\r
+  UINT32     PrdtIndex;\r
   UINTN      RemainedData;\r
   UINTN      MemAddr;\r
   DATA_64    Data64;\r
@@ -557,7 +557,7 @@ AhciBuildCommand (
 \r
   RemainedData = (UINTN) DataLength;\r
   MemAddr      = (UINTN) DataPhysicalAddr;\r
-  CommandList->AhciCmdPrdtl = (UINT32)PrdtNumber;\r
+  CommandList->AhciCmdPrdtl = PrdtNumber;\r
 \r
   for (PrdtIndex = 0; PrdtIndex < PrdtNumber; PrdtIndex++) {\r
     if (RemainedData < EFI_AHCI_MAX_DATA_PER_PRDT) {\r
@@ -2349,7 +2349,7 @@ AhciModeInitialization (
       //\r
       // If the device is a hard disk, then try to enable S.M.A.R.T feature\r
       //\r
-      if (DeviceType == EfiIdeHarddisk) {\r
+      if ((DeviceType == EfiIdeHarddisk) && PcdGetBool (PcdAtaSmartEnable)) {\r
         AhciAtaSmartSupport (\r
           PciIo,\r
           AhciRegisters,\r