]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
MdeModulePkg/.../IdeMode: correctly report length of returned data
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Jan 2016 11:33:37 +0000 (11:33 +0000)
committerlersek <lersek@Edk2>
Mon, 25 Jan 2016 11:33:37 +0000 (11:33 +0000)
commitf6a683e01b6053493cd98b9e3a4364ed8d1bde80
tree9f29642976419931b78acea4324623bf1170ce0b
parent4e50241273b7e01cf2d7eb22ebf9f6a9d045b00b
MdeModulePkg/.../IdeMode: correctly report length of returned data

For some SCSI commands, notably INQUIRY, it's relatively common for
the device to provide less data than we intended to read, and for
this reason EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET makes
InTransferLength and OutTransferLength read-write.  Make ATAPI
aware of this.

This makes it possible to handle EFI_NOT_READY always, not just
for read as done in r19685.

I've chosen to use a break statement instead of calling
CheckStatusRegister directly; the break statement reaches a
pre-existing call the CheckStatusRegister function.  This
ensures that the assignment to *ByteCount is not missed, and
adds a further sanity check to DRQClear.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19737 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c