]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/AtaBus: AtaBusDxe module would ignore ATA Pass Thru Protocol instances...
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Apr 2013 02:08:51 +0000 (02:08 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Apr 2013 02:08:51 +0000 (02:08 +0000)
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14284 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c

index 11e90f97a949ccfca49ca1a33c39ed71f5444b0b..6732fd5e0d38ded84c65e23e5ad6006a16ba934f 100644 (file)
@@ -4,7 +4,7 @@
   This file implements protocol interfaces: Driver Binding protocol,\r
   Block IO protocol and DiskInfo protocol.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2013, 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
@@ -629,12 +629,37 @@ AtaBusDriverBindingSupported (
     return Status;\r
   }\r
 \r
+  //\r
+  // Test to see if this ATA Pass Thru Protocol is for a LOGICAL channel\r
+  //\r
+  if ((AtaPassThru->Mode->Attributes & EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL) == 0) {\r
+    //\r
+    // Close the I/O Abstraction(s) used to perform the supported test\r
+    //\r
+    gBS->CloseProtocol (\r
+          Controller,\r
+          &gEfiAtaPassThruProtocolGuid,\r
+          This->DriverBindingHandle,\r
+          Controller\r
+          );\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   //\r
   // Test RemainingDevicePath is valid or not.\r
   //\r
   if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) {\r
     Status = AtaPassThru->GetDevice (AtaPassThru, RemainingDevicePath, &Port, &PortMultiplierPort);\r
     if (EFI_ERROR (Status)) {\r
+      //\r
+      // Close the I/O Abstraction(s) used to perform the supported test\r
+      //\r
+      gBS->CloseProtocol (\r
+            Controller,\r
+            &gEfiAtaPassThruProtocolGuid,\r
+            This->DriverBindingHandle,\r
+            Controller\r
+            );\r
       return Status;\r
     }\r
   }\r