]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/AtaAtapiPassThru: To follow UEFI 2.4, updating the implementation of...
authorFeng Tian <feng.tian@intel.com>
Wed, 18 Sep 2013 02:13:34 +0000 (02:13 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 18 Sep 2013 02:13:34 +0000 (02:13 +0000)
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14681 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c

index e5bfc39800e37ba6993e972aa16a439c7e34d871..35477d886257285b4ea8d796eaa95dde05bc35d6 100644 (file)
@@ -2,7 +2,7 @@
   This file implements ATA_PASSTHRU_PROCTOCOL and EXT_SCSI_PASSTHRU_PROTOCOL interfaces\r
   for managed ATA controllers.\r
 \r
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 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
@@ -1265,6 +1265,15 @@ AtaPassThruPassThru (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  Node = SearchDeviceInfoList (Instance, Port, PortMultiplierPort, EfiIdeHarddisk);\r
+\r
+  if (Node == NULL) {\r
+    Node = SearchDeviceInfoList(Instance, Port, PortMultiplierPort, EfiIdeCdrom);\r
+    if (Node == NULL) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+  }\r
+\r
   //\r
   // convert the transfer length from sector count to byte.\r
   //\r
@@ -1281,12 +1290,6 @@ AtaPassThruPassThru (
     Packet->OutTransferLength = Packet->OutTransferLength * 0x200;\r
   }\r
 \r
-  Node = SearchDeviceInfoList (Instance, Port, PortMultiplierPort, EfiIdeHarddisk);\r
-\r
-  if (Node == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
   //\r
   // Check whether this device needs 48-bit addressing (ATAPI-6 ata device).\r
   // Per ATA-6 spec, word83: bit15 is zero and bit14 is one.\r