From: Feng Tian Date: Wed, 18 Sep 2013 02:13:34 +0000 (+0000) Subject: MdeModulePkg/AtaAtapiPassThru: To follow UEFI 2.4, updating the implementation of... X-Git-Tag: edk2-stable201903~12246 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=df202d72ebce0178d93eca8281ede0362cc1f36c;p=mirror_edk2.git 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 Reviewed-by: Eric Jin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14681 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index e5bfc39800..35477d8862 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.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
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.