summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Ata
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2013-09-18 02:13:34 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-18 02:13:34 +0000
commitdf202d72ebce0178d93eca8281ede0362cc1f36c (patch)
tree48e1aefe6963ef1f48358a84a2174058ee4ca25d /MdeModulePkg/Bus/Ata
parent80c83a6995db1914cc7db012f6b8f3e223e45847 (diff)
downloadedk2-df202d72ebce0178d93eca8281ede0362cc1f36c.zip
edk2-df202d72ebce0178d93eca8281ede0362cc1f36c.tar.gz
edk2-df202d72ebce0178d93eca8281ede0362cc1f36c.tar.bz2
MdeModulePkg/AtaAtapiPassThru: To follow UEFI 2.4, updating the implementation of ATA_PASS_THRU.PassThru() to allow sending ATA cmds to ATAPI devices.
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
Diffstat (limited to 'MdeModulePkg/Bus/Ata')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index e5bfc39..35477d8 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -2,7 +2,7 @@
This file implements ATA_PASSTHRU_PROCTOCOL and EXT_SCSI_PASSTHRU_PROTOCOL interfaces
for managed ATA controllers.
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 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
@@ -1265,6 +1265,15 @@ AtaPassThruPassThru (
return EFI_INVALID_PARAMETER;
}
+ Node = SearchDeviceInfoList (Instance, Port, PortMultiplierPort, EfiIdeHarddisk);
+
+ if (Node == NULL) {
+ Node = SearchDeviceInfoList(Instance, Port, PortMultiplierPort, EfiIdeCdrom);
+ if (Node == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ }
+
//
// convert the transfer length from sector count to byte.
//
@@ -1281,12 +1290,6 @@ AtaPassThruPassThru (
Packet->OutTransferLength = Packet->OutTransferLength * 0x200;
}
- Node = SearchDeviceInfoList (Instance, Port, PortMultiplierPort, EfiIdeHarddisk);
-
- if (Node == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
//
// Check whether this device needs 48-bit addressing (ATAPI-6 ata device).
// Per ATA-6 spec, word83: bit15 is zero and bit14 is one.