]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
Assign IDE_BLK_IO_DEV.UdmaMode when detecting the disk hardware support UDMA mode.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / idebus.c
index 3b0e69e929162aa2437219afa859a931055ede6f..73b302cd4273639f80905b874a317a9b0f38740e 100644 (file)
@@ -26,7 +26,7 @@ EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding = {
   IDEBusDriverBindingSupported,\r
   IDEBusDriverBindingStart,\r
   IDEBusDriverBindingStop,\r
-  0x10,\r
+  0xa,\r
   NULL,\r
   NULL\r
 };\r
@@ -91,7 +91,7 @@ IDEBusDriverBindingSupported (
   }\r
  \r
   //\r
-  // Clsoe protocol, don't use device path protocol in the .Support() function\r
+  // Close protocol, don't use device path protocol in the .Support() function\r
   //\r
   gBS->CloseProtocol (\r
         Controller,\r
@@ -189,7 +189,6 @@ IDEBusDriverBindingStart (
   EFI_IDE_CONTROLLER_INIT_PROTOCOL  *IdeInit;\r
   BOOLEAN                           EnumAll;\r
   BOOLEAN                           ChannelEnabled;\r
-  UINT8                             ChannelCount;\r
   UINT8                             MaxDevices;\r
   EFI_IDENTIFY_DATA                 IdentifyData;\r
   EFI_ATA_COLLECTIVE_MODE           *SupportedModes;\r
@@ -239,10 +238,9 @@ IDEBusDriverBindingStart (
   }\r
 \r
   //\r
-  // Save Enumall and ChannelCount. Step7.2\r
+  // Save Enumall. Step7.2\r
   //\r
   EnumAll       = IdeInit->EnumAll;\r
-  ChannelCount  = IdeInit->ChannelCount;\r
 \r
   //\r
   // Consume PCI I/O protocol. Note that the OpenProtocol with _GET_PROTOCOL\r
@@ -453,8 +451,8 @@ IDEBusDriverBindingStart (
       ZeroMem (IdeBlkIoDevicePtr, sizeof (IDE_BLK_IO_DEV));\r
 \r
       IdeBlkIoDevicePtr->Signature  = IDE_BLK_IO_DEV_SIGNATURE;\r
-      IdeBlkIoDevicePtr->Channel    = IdeChannel;\r
-      IdeBlkIoDevicePtr->Device     = IdeDevice;\r
+      IdeBlkIoDevicePtr->Channel    = (EFI_IDE_CHANNEL) IdeChannel;\r
+      IdeBlkIoDevicePtr->Device     = (EFI_IDE_DEVICE) IdeDevice;\r
 \r
       //\r
       // initialize Block IO interface's Media pointer\r
@@ -631,7 +629,11 @@ IDEBusDriverBindingStart (
           IdeBlkIoDevicePtr = NULL;\r
           continue;\r
         }\r
-\r
+        //\r
+        // Record Udma Mode\r
+        //\r
+        IdeBlkIoDevicePtr->UdmaMode.Valid = TRUE;\r
+        IdeBlkIoDevicePtr->UdmaMode.Mode  = SupportedModes->UdmaMode.Mode;\r
         EnableInterrupt (IdeBlkIoDevicePtr);\r
       } else if (SupportedModes->MultiWordDmaMode.Valid) {\r
 \r
@@ -666,7 +668,7 @@ IDEBusDriverBindingStart (
       //\r
       // Record PIO mode used in private data\r
       //\r
-      IdeBlkIoDevicePtr->PioMode = SupportedModes->PioMode.Mode;\r
+      IdeBlkIoDevicePtr->PioMode = (ATA_PIO_MODE) SupportedModes->PioMode.Mode;\r
 \r
       //\r
       // Set IDE controller Timing Blocks in the PCI Configuration Space\r