Revision: 14284
          http://edk2.svn.sourceforge.net/edk2/?rev=14284&view=rev
Author:   erictian
Date:     2013-04-18 02:08:51 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
MdeModulePkg/AtaBus: AtaBusDxe module would ignore ATA Pass Thru Protocol 
instances that do not have the LOGICAL attribute set

Signed-off-by: Michael Kinney <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c

Modified: trunk/edk2/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c  2013-04-18 01:47:34 UTC 
(rev 14283)
+++ trunk/edk2/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c  2013-04-18 02:08:51 UTC 
(rev 14284)
@@ -4,7 +4,7 @@
   This file implements protocol interfaces: Driver Binding protocol,
   Block IO protocol and DiskInfo protocol.
 
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -630,11 +630,36 @@
   }
 
   //
+  // Test to see if this ATA Pass Thru Protocol is for a LOGICAL channel
+  //
+  if ((AtaPassThru->Mode->Attributes & EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL) 
== 0) {
+    //
+    // Close the I/O Abstraction(s) used to perform the supported test
+    //
+    gBS->CloseProtocol (
+          Controller,
+          &gEfiAtaPassThruProtocolGuid,
+          This->DriverBindingHandle,
+          Controller
+          );
+    return EFI_UNSUPPORTED;
+  }
+
+  //
   // Test RemainingDevicePath is valid or not.
   //
   if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) 
{
     Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, 
&PortMultiplierPort);
     if (EFI_ERROR (Status)) {
+      //
+      // Close the I/O Abstraction(s) used to perform the supported test
+      //
+      gBS->CloseProtocol (
+            Controller,
+            &gEfiAtaPassThruProtocolGuid,
+            This->DriverBindingHandle,
+            Controller
+            );
       return Status;
     }
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to