summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-01-19 10:46:34 +0000
committerlersek <lersek@Edk2>2016-01-19 10:46:34 +0000
commitdfc229f6a67b03e3c47b67b92982a100cfef738a (patch)
tree90555ba0e9e0e6fea8a1a15e7462d97e9be0c29b /MdeModulePkg
parent3b672240e6c77ccf3f5cc0f3e8dbf026fc9e2751 (diff)
downloadedk2-platforms-dfc229f6a67b03e3c47b67b92982a100cfef738a.tar.xz
MdeModulePkg/.../IdeMode: actualize DRQReady*() comment blocks
The DRQReady() and DRQReady2() functions only differ in that they poll different status registers for BSY, ERR, and DRQ: the former looks at the Status Register (clearing interrupt status), while the latter looks at the Alternate Status Register (not clearing interrupt status). They both correctly return a unique status code, EFI_NOT_READY, for the BSY==0 && ERR==0 && DRQ==0 case; that is, when the device reports "command complete". However, the functions' leading comments don't explain this case, so it's easy to miss in callers. Update the comments. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: John Snow <jsnow@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-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@19684 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
index f74e5ca373..b06f9889ed 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
@@ -467,9 +467,18 @@ DRQClear2 (
@param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
@param Timeout The time to complete the command, uses 100ns as a unit.
- @retval EFI_SUCCESS DRQ bit set within the time out.
- @retval EFI_TIMEOUT DRQ bit not set within the time out.
- @retval EFI_ABORTED DRQ bit not set caused by the command abort.
+ @retval EFI_SUCCESS BSY bit cleared and DRQ bit set within the
+ timeout.
+
+ @retval EFI_TIMEOUT BSY bit not cleared within the timeout.
+
+ @retval EFI_ABORTED Polling abandoned due to command abort.
+
+ @retval EFI_DEVICE_ERROR Polling abandoned due to a non-abort error.
+
+ @retval EFI_NOT_READY BSY bit cleared within timeout, and device
+ reported "command complete" by clearing DRQ
+ bit.
@note Read Status Register will clear interrupt status.
@@ -542,9 +551,19 @@ DRQReady (
@param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
@param Timeout The time to complete the command, uses 100ns as a unit.
- @retval EFI_SUCCESS DRQ bit set within the time out.
- @retval EFI_TIMEOUT DRQ bit not set within the time out.
- @retval EFI_ABORTED DRQ bit not set caused by the command abort.
+ @retval EFI_SUCCESS BSY bit cleared and DRQ bit set within the
+ timeout.
+
+ @retval EFI_TIMEOUT BSY bit not cleared within the timeout.
+
+ @retval EFI_ABORTED Polling abandoned due to command abort.
+
+ @retval EFI_DEVICE_ERROR Polling abandoned due to a non-abort error.
+
+ @retval EFI_NOT_READY BSY bit cleared within timeout, and device
+ reported "command complete" by clearing DRQ
+ bit.
+
@note Read Alternate Status Register will not clear interrupt status.
**/