]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c
Check in patch to refine DevicePath Module and USB2HostController Module.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / AtapiPassThru / Dxe / AtapiPassThru.c
index 6fe81d1521d8e4cd7aff471f81e3029a2ad66481..8eac997fc7a4ba482e514240b1ad4553ff5b9076 100644 (file)
@@ -1,23 +1,14 @@
-/*++\r
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  http://opensource.org/licenses/bsd-license.php                                            \r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-\r
-    AtapiPassThru.c\r
-    \r
-Abstract: \r
-    \r
-\r
-Revision History\r
---*/\r
+**/\r
 \r
 #include "AtapiPassThru.h"\r
 \r
@@ -46,9 +37,9 @@ AtapiScsiPassThruDriverBindingStop (
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   );\r
 \r
-//\r
-// IDE registers' fixed address\r
-//\r
+///\r
+/// IDE registers' fixed address\r
+///\r
 static IDE_BASE_REGISTERS   gAtapiIoPortRegisters[2] = {\r
   { 0x1f0, { 0x1f1 }, 0x1f2, 0x1f3, 0x1f4, 0x1f5, 0x1f6, { 0x1f7 }, { 0x3f6 }, 0x3f7, 0 },\r
   { 0x170, { 0x171 }, 0x172, 0x173, 0x174, 0x175, 0x176, { 0x177 }, { 0x376 }, 0x377, 0 } \r
@@ -56,9 +47,9 @@ static IDE_BASE_REGISTERS   gAtapiIoPortRegisters[2] = {
 \r
 static SCSI_COMMAND_SET     gEndTable = { 0xff, 0xff };\r
 \r
-//\r
-// This table contains all the supported ATAPI commands.\r
-//\r
+///\r
+/// This table contains all the supported ATAPI commands.\r
+///\r
 static SCSI_COMMAND_SET     gSupportedATAPICommands[] = {\r
   { OP_INQUIRY,                     DataIn  },\r
   { OP_LOAD_UNLOAD_CD,              NoData  },\r
@@ -107,6 +98,18 @@ EFI_DRIVER_BINDING_PROTOCOL gAtapiScsiPassThruDriverBinding = {
   NULL\r
 };\r
 \r
+/**\r
+  Supported.\r
+\r
+  (Standard DriverBinding Protocol Supported() function)\r
+\r
+  @return EFI_STATUS\r
+\r
+  @todo    This - add argument and description to function comment\r
+  @todo    Controller - add argument and description to function comment\r
+  @todo    RemainingDevicePath - add argument and description to function comment\r
+  @todo    EFI_UNSUPPORTED - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruDriverBindingSupported (\r
@@ -114,22 +117,6 @@ AtapiScsiPassThruDriverBindingSupported (
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-  \r
-  Routine Description:\r
-    Supported.\r
-    \r
-  Arguments:\r
-    (Standard DriverBinding Protocol Supported() function)\r
-    \r
-  Returns:\r
-    EFI_STATUS\r
-  \r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Controller - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
 {\r
   EFI_STATUS          Status;\r
   EFI_PCI_IO_PROTOCOL *PciIo;\r
@@ -186,6 +173,18 @@ AtapiScsiPassThruDriverBindingSupported (
   return Status;\r
 }\r
 \r
+/**\r
+  Create handles for IDE channels specified by RemainingDevicePath.\r
+  Install SCSI Pass Thru Protocol onto each created handle.\r
+\r
+  (Standard DriverBinding Protocol Start() function)\r
+\r
+  @return EFI_STATUS\r
+\r
+  @todo    This - add argument and description to function comment\r
+  @todo    Controller - add argument and description to function comment\r
+  @todo    RemainingDevicePath - add argument and description to function comment\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruDriverBindingStart (\r
@@ -193,22 +192,6 @@ AtapiScsiPassThruDriverBindingStart (
   IN EFI_HANDLE                   Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-  \r
-  Routine Description:\r
-    Create handles for IDE channels specified by RemainingDevicePath.\r
-    Install SCSI Pass Thru Protocol onto each created handle.\r
-  \r
-  Arguments:\r
-    (Standard DriverBinding Protocol Start() function)\r
-    \r
-  Returns:\r
-    EFI_STATUS\r
-    \r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Controller - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
 {\r
   EFI_STATUS          Status;\r
   EFI_PCI_IO_PROTOCOL *PciIo;\r
@@ -263,6 +246,19 @@ Done:
   return Status;\r
 }\r
 \r
+/**\r
+  Stop.\r
+\r
+  (Standard DriverBinding Protocol Stop() function)\r
+\r
+  @return EFI_STATUS\r
+\r
+  @todo    This - add argument and description to function comment\r
+  @todo    Controller - add argument and description to function comment\r
+  @todo    NumberOfChildren - add argument and description to function comment\r
+  @todo    ChildHandleBuffer - add argument and description to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruDriverBindingStop (\r
@@ -271,23 +267,6 @@ AtapiScsiPassThruDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-  \r
-  Routine Description:\r
-    Stop.\r
-  \r
-  Arguments:\r
-    (Standard DriverBinding Protocol Stop() function)\r
-  \r
-  Returns:\r
-    EFI_STATUS\r
-  \r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Controller - add argument and description to function comment\r
-// TODO:    NumberOfChildren - add argument and description to function comment\r
-// TODO:    ChildHandleBuffer - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru;\r
@@ -337,28 +316,25 @@ AtapiScsiPassThruDriverBindingStop (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Attaches SCSI Pass Thru Protocol for specified IDE channel.\r
+\r
+  @param Controller:       Parent device handle to the IDE channel.\r
+  @param PciIo:            PCI I/O protocol attached on the "Controller".\r
+\r
+  @return EFI_SUCCESS Always returned unless installing SCSI Pass Thru Protocol failed.\r
+\r
+  @todo    This - add argument and description to function comment\r
+  @todo    Controller - add argument and description to function comment\r
+  @todo    PciIo - add argument and description to function comment\r
+  @todo    EFI_OUT_OF_RESOURCES - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 RegisterAtapiScsiPassThru (\r
   IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
   IN  EFI_HANDLE                  Controller,\r
   IN  EFI_PCI_IO_PROTOCOL         *PciIo\r
   )\r
-/*++\r
-  \r
-  Routine Description:\r
-    Attaches SCSI Pass Thru Protocol for specified IDE channel.\r
-    \r
-  Arguments:\r
-    Controller:       Parent device handle to the IDE channel.    \r
-    PciIo:            PCI I/O protocol attached on the "Controller".                        \r
-  \r
-  Returns:\r
-    Always return EFI_SUCCESS unless installing SCSI Pass Thru Protocol failed.\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Controller - add argument and description to function comment\r
-// TODO:    PciIo - add argument and description to function comment\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
 {\r
   EFI_STATUS                Status;\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
@@ -427,6 +403,29 @@ RegisterAtapiScsiPassThru (
   return Status;\r
 }\r
 \r
+/**\r
+  Implements EFI_SCSI_PASS_THRU_PROTOCOL.PassThru() function.\r
+\r
+  @param This     The EFI_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param Target   The Target ID of the ATAPI device to send the SCSI\r
+  Request Packet. To ATAPI devices attached on an IDE\r
+  Channel, Target ID 0 indicates Master device;Target\r
+  ID 1 indicates Slave device.\r
+  @param Lun      The LUN of the ATAPI device to send the SCSI Request\r
+  Packet. To the ATAPI device, Lun is always 0.\r
+  @param Packet   The SCSI Request Packet to send to the ATAPI device\r
+  specified by Target and Lun.\r
+  @param Event    If non-blocking I/O is not supported then Event is ignored,\r
+  and blocking I/O is performed.<br>\r
+  If Event is NULL, then blocking I/O is performed.<br>\r
+  If Event is not NULL and non blocking I/O is supported,\r
+  then non-blocking I/O is performed, and Event will be signaled\r
+  when the SCSI Request Packet completes.\r
+\r
+  @todo    This - add argument and description to function comment\r
+  @todo    EFI_INVALID_PARAMETER - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruFunction (\r
@@ -436,34 +435,6 @@ AtapiScsiPassThruFunction (
   IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET         *Packet,\r
   IN EFI_EVENT                                          Event OPTIONAL\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Implements EFI_SCSI_PASS_THRU_PROTOCOL.PassThru() function.\r
-  \r
-  Arguments:\r
-    This:     The EFI_SCSI_PASS_THRU_PROTOCOL instance.\r
-    Target:   The Target ID of the ATAPI device to send the SCSI \r
-              Request Packet. To ATAPI devices attached on an IDE\r
-              Channel, Target ID 0 indicates Master device;Target\r
-              ID 1 indicates Slave device.\r
-    Lun:      The LUN of the ATAPI device to send the SCSI Request\r
-              Packet. To the ATAPI device, Lun is always 0.\r
-    Packet:   The SCSI Request Packet to send to the ATAPI device \r
-              specified by Target and Lun.\r
-    Event:    If non-blocking I/O is not supported then Event is ignored, \r
-              and blocking I/O is performed.\r
-              If Event is NULL, then blocking I/O is performed.\r
-              If Event is not NULL and non blocking I/O is supported, \r
-              then non-blocking I/O is performed, and Event will be signaled \r
-              when the SCSI Request Packet completes.      \r
-    \r
-  Returns:  \r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
   EFI_STATUS                Status;\r
@@ -515,6 +486,29 @@ AtapiScsiPassThruFunction (
   return Status;\r
 }\r
 \r
+/**\r
+  Used to retrieve the list of legal Target IDs for SCSI devices \r
+  on a SCSI channel.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Target On input, a pointer to the Target ID of a SCSI\r
+  device present on the SCSI channel.  On output,\r
+  a pointer to the Target ID of the next SCSI device\r
+  present on a SCSI channel.  An input value of\r
+  0xFFFFFFFF retrieves the Target ID of the first\r
+  SCSI device present on a SCSI channel.\r
+  @param  Lun On input, a pointer to the LUN of a SCSI device\r
+  present on the SCSI channel. On output, a pointer\r
+  to the LUN of the next SCSI device present on\r
+  a SCSI channel.\r
+\r
+  @retval  EFI_SUCCESS The Target ID and Lun of the next SCSI device\r
+  on the SCSI channel was returned in Target and Lun.\r
+  @retval  EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
+  @retval  EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were not\r
+  returned on a previous call to GetNextDevice().\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruGetNextDevice (\r
@@ -522,32 +516,6 @@ AtapiScsiPassThruGetNextDevice (
   IN OUT UINT32                      *Target,\r
   IN OUT UINT64                      *Lun\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Used to retrieve the list of legal Target IDs for SCSI devices \r
-    on a SCSI channel.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    Target                - On input, a pointer to the Target ID of a SCSI \r
-                            device present on the SCSI channel.  On output, \r
-                            a pointer to the Target ID of the next SCSI device\r
-                             present on a SCSI channel.  An input value of \r
-                             0xFFFFFFFF retrieves the Target ID of the first \r
-                             SCSI device present on a SCSI channel.\r
-    Lun                   - On input, a pointer to the LUN of a SCSI device\r
-                            present on the SCSI channel. On output, a pointer\r
-                            to the LUN of the next SCSI device present on \r
-                            a SCSI channel.\r
-    \r
-  Returns:\r
-    EFI_SUCCESS           - The Target ID and Lun of the next SCSI device \r
-                            on the SCSI channel was returned in Target and Lun.\r
-    EFI_NOT_FOUND         - There are no more SCSI devices on this SCSI channel.\r
-    EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF,and Target and Lun were not\r
-                            returned on a previous call to GetNextDevice().\r
---*/\r
 {\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
 \r
@@ -591,6 +559,33 @@ AtapiScsiPassThruGetNextDevice (
 \r
 }\r
 \r
+/**\r
+  Used to allocate and build a device path node for a SCSI device \r
+  on a SCSI channel. Would not build device path for a SCSI Host Controller.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Target The Target ID of the SCSI device for which\r
+  a device path node is to be allocated and built.\r
+  @param  Lun The LUN of the SCSI device for which a device\r
+  path node is to be allocated and built.\r
+  @param  DevicePath A pointer to a single device path node that\r
+  describes the SCSI device specified by\r
+  Target and Lun. This function is responsible\r
+  for allocating the buffer DevicePath with the boot\r
+  service AllocatePool().  It is the caller's\r
+  responsibility to free DevicePath when the caller\r
+  is finished with DevicePath.\r
+\r
+  @retval  EFI_SUCCESS The device path node that describes the SCSI device\r
+  specified by Target and Lun was allocated and\r
+  returned in DevicePath.\r
+  @retval  EFI_NOT_FOUND The SCSI devices specified by Target and Lun does\r
+  not exist on the SCSI channel.\r
+  @retval  EFI_INVALID_PARAMETER DevicePath is NULL.\r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources to allocate\r
+  DevicePath.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruBuildDevicePath (\r
@@ -599,35 +594,6 @@ AtapiScsiPassThruBuildDevicePath (
   IN     UINT64                         Lun,\r
   IN OUT EFI_DEVICE_PATH_PROTOCOL       **DevicePath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Used to allocate and build a device path node for a SCSI device \r
-    on a SCSI channel. Would not build device path for a SCSI Host Controller.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    Target                - The Target ID of the SCSI device for which\r
-                            a device path node is to be allocated and built.\r
-    Lun                   - The LUN of the SCSI device for which a device \r
-                            path node is to be allocated and built.\r
-    DevicePath            - A pointer to a single device path node that \r
-                            describes the SCSI device specified by \r
-                            Target and Lun. This function is responsible \r
-                            for allocating the buffer DevicePath with the boot\r
-                            service AllocatePool().  It is the caller's \r
-                            responsibility to free DevicePath when the caller\r
-                            is finished with DevicePath.    \r
-  Returns:\r
-    EFI_SUCCESS           - The device path node that describes the SCSI device\r
-                            specified by Target and Lun was allocated and \r
-                            returned in DevicePath.\r
-    EFI_NOT_FOUND         - The SCSI devices specified by Target and Lun does\r
-                            not exist on the SCSI channel.\r
-    EFI_INVALID_PARAMETER - DevicePath is NULL.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources to allocate \r
-                            DevicePath.\r
---*/\r
 {\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
   EFI_DEV_PATH              *Node;\r
@@ -670,6 +636,29 @@ AtapiScsiPassThruBuildDevicePath (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Used to translate a device path node to a Target ID and LUN.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DevicePath A pointer to the device path node that\r
+  describes a SCSI device on the SCSI channel.\r
+  @param  Target A pointer to the Target ID of a SCSI device\r
+  on the SCSI channel.\r
+  @param  Lun A pointer to the LUN of a SCSI device on\r
+  the SCSI channel.\r
+\r
+  @retval  EFI_SUCCESS DevicePath was successfully translated to a\r
+  Target ID and LUN, and they were returned\r
+  in Target and Lun.\r
+  @retval  EFI_INVALID_PARAMETER DevicePath is NULL.\r
+  @retval  EFI_INVALID_PARAMETER Target is NULL.\r
+  @retval  EFI_INVALID_PARAMETER Lun is NULL.\r
+  @retval  EFI_UNSUPPORTED This driver does not support the device path\r
+  node type in DevicePath.\r
+  @retval  EFI_NOT_FOUND A valid translation from DevicePath to a\r
+  Target ID and LUN does not exist.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruGetTargetLun (\r
@@ -678,31 +667,6 @@ AtapiScsiPassThruGetTargetLun (
   OUT UINT32                         *Target,\r
   OUT UINT64                         *Lun\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Used to translate a device path node to a Target ID and LUN.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    DevicePath            - A pointer to the device path node that \r
-                            describes a SCSI device on the SCSI channel.\r
-    Target                - A pointer to the Target ID of a SCSI device \r
-                            on the SCSI channel. \r
-    Lun                   - A pointer to the LUN of a SCSI device on \r
-                            the SCSI channel.    \r
-  Returns:\r
-    EFI_SUCCESS           - DevicePath was successfully translated to a \r
-                            Target ID and LUN, and they were returned \r
-                            in Target and Lun.\r
-    EFI_INVALID_PARAMETER - DevicePath is NULL.\r
-    EFI_INVALID_PARAMETER - Target is NULL.\r
-    EFI_INVALID_PARAMETER - Lun is NULL.\r
-    EFI_UNSUPPORTED       - This driver does not support the device path \r
-                            node type in DevicePath.\r
-    EFI_NOT_FOUND         - A valid translation from DevicePath to a \r
-                            Target ID and LUN does not exist.\r
---*/\r
 {\r
   EFI_DEV_PATH  *Node;\r
 \r
@@ -734,29 +698,26 @@ AtapiScsiPassThruGetTargetLun (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Resets a SCSI channel.This operation resets all the \r
+  SCSI devices connected to the SCSI channel.\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval  EFI_SUCCESS The SCSI channel was reset.\r
+  @retval  EFI_UNSUPPORTED The SCSI channel does not support\r
+  a channel reset operation.\r
+  @retval  EFI_DEVICE_ERROR A device error occurred while\r
+  attempting to reset the SCSI channel.\r
+  @retval  EFI_TIMEOUT A timeout occurred while attempting\r
+  to reset the SCSI channel.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruResetChannel (\r
   IN  EFI_SCSI_PASS_THRU_PROTOCOL   *This\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Resets a SCSI channel.This operation resets all the \r
-    SCSI devices connected to the SCSI channel.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    \r
-  Returns:\r
-    EFI_SUCCESS           - The SCSI channel was reset.\r
-    EFI_UNSUPPORTED       - The SCSI channel does not support \r
-                            a channel reset operation.\r
-    EFI_DEVICE_ERROR      - A device error occurred while \r
-                            attempting to reset the SCSI channel.\r
-    EFI_TIMEOUT           - A timeout occurred while attempting \r
-                            to reset the SCSI channel.\r
---*/\r
 {\r
   UINT8                     DeviceControlValue;\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
@@ -813,6 +774,25 @@ AtapiScsiPassThruResetChannel (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Resets a SCSI device that is connected to a SCSI channel.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Target The Target ID of the SCSI device to reset.\r
+  @param  Lun The LUN of the SCSI device to reset.\r
+\r
+  @retval  EFI_SUCCESS The SCSI device specified by Target and\r
+  Lun was reset.\r
+  @retval  EFI_UNSUPPORTED The SCSI channel does not support a target\r
+  reset operation.\r
+  @retval  EFI_INVALID_PARAMETER Target or Lun are invalid.\r
+  @retval  EFI_DEVICE_ERROR A device error occurred while attempting\r
+  to reset the SCSI device specified by Target\r
+  and Lun.\r
+  @retval  EFI_TIMEOUT A timeout occurred while attempting to reset\r
+  the SCSI device specified by Target and Lun.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 AtapiScsiPassThruResetTarget (\r
@@ -820,28 +800,6 @@ AtapiScsiPassThruResetTarget (
   IN UINT32                         Target,\r
   IN UINT64                         Lun\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Resets a SCSI device that is connected to a SCSI channel.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    Target                - The Target ID of the SCSI device to reset. \r
-    Lun                   - The LUN of the SCSI device to reset.\r
-        \r
-  Returns:\r
-    EFI_SUCCESS           - The SCSI device specified by Target and \r
-                            Lun was reset.\r
-    EFI_UNSUPPORTED       - The SCSI channel does not support a target\r
-                            reset operation.\r
-    EFI_INVALID_PARAMETER - Target or Lun are invalid.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempting \r
-                            to reset the SCSI device specified by Target \r
-                            and Lun.\r
-    EFI_TIMEOUT           - A timeout occurred while attempting to reset \r
-                            the SCSI device specified by Target and Lun.\r
---*/\r
 {\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate;\r
   UINT8                     Command;\r
@@ -899,25 +857,24 @@ AtapiScsiPassThruResetTarget (
 }\r
 \r
     \r
+/**\r
+  Checks the parameters in the SCSI Request Packet to make sure\r
+  they are valid for a SCSI Pass Thru request.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    Packet - add argument and description to function comment\r
+  @todo    EFI_INVALID_PARAMETER - add return value to function comment\r
+  @todo    EFI_INVALID_PARAMETER - add return value to function comment\r
+  @todo    EFI_INVALID_PARAMETER - add return value to function comment\r
+  @todo    EFI_UNSUPPORTED - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 CheckSCSIRequestPacket (\r
   EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET      *Packet\r
   )\r
-/*++\r
-  \r
-  Checks the parameters in the SCSI Request Packet to make sure\r
-  they are valid for a SCSI Pass Thru request.\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    Packet - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   if (Packet == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -941,21 +898,20 @@ CheckSCSIRequestPacket (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Checks the requested SCSI command: \r
+  Is it supported by this driver?\r
+  Is the Data transfer direction reasonable?\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    Packet - add argument and description to function comment\r
+**/\r
 BOOLEAN\r
 IsCommandValid (\r
   EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET   *Packet\r
   )\r
-/*++\r
-  \r
-  Checks the requested SCSI command: \r
-    Is it supported by this driver?\r
-    Is the Data transfer direction reasonable?\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    Packet - add argument and description to function comment\r
 {\r
   UINT8 Index;\r
   UINT8 *OpCode;\r
@@ -995,30 +951,25 @@ IsCommandValid (
   return FALSE;\r
 }\r
 \r
+/**\r
+  Performs blocking I/O request.\r
+\r
+  @param AtapiScsiPrivate   Private data structure for the specified channel.\r
+  @param Target             The Target ID of the ATAPI device to send the SCSI\r
+  Request Packet. To ATAPI devices attached on an IDE\r
+  Channel, Target ID 0 indicates Master device;Target\r
+  ID 1 indicates Slave device.\r
+  @param Packet             The SCSI Request Packet to send to the ATAPI device\r
+  specified by Target.\r
+\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+**/\r
 EFI_STATUS\r
 SubmitBlockingIoCommand (\r
   ATAPI_SCSI_PASS_THRU_DEV                  *AtapiScsiPrivate,\r
   UINT32                                    Target,\r
   EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET    *Packet\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Performs blocking I/O request.\r
-    \r
-  Arguments:\r
-    AtapiScsiPrivate:   Private data structure for the specified channel.\r
-    Target:             The Target ID of the ATAPI device to send the SCSI \r
-                        Request Packet. To ATAPI devices attached on an IDE\r
-                        Channel, Target ID 0 indicates Master device;Target\r
-                        ID 1 indicates Slave device.\r
-    Packet:             The SCSI Request Packet to send to the ATAPI device \r
-                        specified by Target.\r
-  \r
-  Returns:\r
-  \r
---*/\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
 {\r
   UINT8       PacketCommand[12];\r
   UINT64      TimeoutInMicroSeconds;\r
@@ -1079,6 +1030,23 @@ Routine Description:
   return PacketCommandStatus;\r
 }\r
 \r
+/**\r
+  RequestSenseCommand\r
+\r
+  @param  AtapiScsiPrivate\r
+  @param  Target\r
+  @param  Timeout\r
+  @param  SenseData\r
+  @param  SenseDataLength\r
+\r
+  @todo Add function description\r
+  @todo  AtapiScsiPrivate TODO: add argument description\r
+  @todo  Target TODO: add argument description\r
+  @todo  Timeout TODO: add argument description\r
+  @todo  SenseData TODO: add argument description\r
+  @todo  SenseDataLength TODO: add argument description\r
+  @todo add return values\r
+**/\r
 EFI_STATUS\r
 RequestSenseCommand (\r
   ATAPI_SCSI_PASS_THRU_DEV    *AtapiScsiPrivate,\r
@@ -1087,25 +1055,6 @@ RequestSenseCommand (
   VOID                        *SenseData,\r
   UINT8                       *SenseDataLength\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AtapiScsiPrivate  - TODO: add argument description\r
-  Target            - TODO: add argument description\r
-  Timeout           - TODO: add argument description\r
-  SenseData         - TODO: add argument description\r
-  SenseDataLength   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  Packet;\r
   UINT8                                   Cdb[12];\r
@@ -1130,6 +1079,37 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Submits ATAPI command packet to the specified ATAPI device.\r
+\r
+  @param AtapiScsiPrivate:   Private data structure for the specified channel.\r
+  @param Target:             The Target ID of the ATAPI device to send the SCSI\r
+  Request Packet. To ATAPI devices attached on an IDE\r
+  Channel, Target ID 0 indicates Master device;Target\r
+  ID 1 indicates Slave device.\r
+  @param PacketCommand:      Points to the ATAPI command packet.\r
+  @param Buffer:             Points to the transferred data.\r
+  @param ByteCount:          When input,indicates the buffer size; when output,\r
+  indicates the actually transferred data size.\r
+  @param Direction:          Indicates the data transfer direction.\r
+  @param TimeoutInMicroSeconds: The timeout, in micro second units,\r
+  to use for the execution of this ATAPI command.\r
+  A TimeoutInMicroSeconds value of 0 means that\r
+  this function will wait indefinitely for the ATAPI\r
+  command to execute.\r
+  <P>\r
+  If TimeoutInMicroSeconds is greater than zero, then\r
+  this function will return EFI_TIMEOUT if the time\r
+  required to execute the ATAPI command is greater\r
+  than TimeoutInMicroSeconds.\r
+  </P>\r
+\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    PacketCommand - add argument and description to function comment\r
+  @todo    Buffer - add argument and description to function comment\r
+  @todo    ByteCount - add argument and description to function comment\r
+  @todo    Direction - add argument and description to function comment\r
+**/\r
 EFI_STATUS\r
 AtapiPacketCommand (\r
   ATAPI_SCSI_PASS_THRU_DEV    *AtapiScsiPrivate,\r
@@ -1140,42 +1120,6 @@ AtapiPacketCommand (
   DATA_DIRECTION              Direction,\r
   UINT64                      TimeoutInMicroSeconds\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Submits ATAPI command packet to the specified ATAPI device.\r
-    \r
-  Arguments:\r
-    AtapiScsiPrivate:   Private data structure for the specified channel.\r
-    Target:             The Target ID of the ATAPI device to send the SCSI \r
-                        Request Packet. To ATAPI devices attached on an IDE\r
-                        Channel, Target ID 0 indicates Master device;Target\r
-                        ID 1 indicates Slave device.\r
-    PacketCommand:      Points to the ATAPI command packet.\r
-    Buffer:             Points to the transferred data.\r
-    ByteCount:          When input,indicates the buffer size; when output,\r
-                        indicates the actually transferred data size.\r
-    Direction:          Indicates the data transfer direction. \r
-    TimeoutInMicroSeconds:\r
-                        The timeout, in micro second units, to use for the \r
-                        execution of this ATAPI command.\r
-                        A TimeoutInMicroSeconds value of 0 means that \r
-                        this function will wait indefinitely for the ATAPI \r
-                        command to execute.\r
-                        If TimeoutInMicroSeconds is greater than zero, then \r
-                        this function will return EFI_TIMEOUT if the time \r
-                        required to execute the ATAPI command is greater \r
-                        than TimeoutInMicroSeconds.\r
-  \r
-  Returns:\r
-\r
-\r
---*/\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    PacketCommand - add argument and description to function comment\r
-// TODO:    Buffer - add argument and description to function comment\r
-// TODO:    ByteCount - add argument and description to function comment\r
-// TODO:    Direction - add argument and description to function comment\r
 {\r
 \r
   UINT16      *CommandIndex;\r
@@ -1285,6 +1229,35 @@ AtapiPacketCommand (
           );\r
 }\r
 \r
+/**\r
+  Performs data transfer between ATAPI device and host after the\r
+  ATAPI command packet is sent.\r
+\r
+  @param AtapiScsiPrivate:   Private data structure for the specified channel.\r
+  @param Buffer:             Points to the transferred data.\r
+  @param ByteCount:          When input,indicates the buffer size; when output,\r
+  indicates the actually transferred data size.\r
+  @param Direction:          Indicates the data transfer direction.\r
+  @param TimeoutInMicroSeconds: The timeout, in micro second units,\r
+  to use for the execution of this ATAPI command.\r
+  A TimeoutInMicroSeconds value of 0 means that\r
+  this function will wait indefinitely for the ATAPI\r
+  command to execute.\r
+  <P>\r
+  If TimeoutInMicroSeconds is greater than zero, then\r
+  this function will return EFI_TIMEOUT if the time\r
+  required to execute the ATAPI command is greater\r
+  than TimeoutInMicroSeconds.\r
+  </P>\r
+\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    Buffer - add argument and description to function comment\r
+  @todo    ByteCount - add argument and description to function comment\r
+  @todo    Direction - add argument and description to function comment\r
+  @todo    EFI_DEVICE_ERROR - add return value to function comment\r
+  @todo    EFI_DEVICE_ERROR - add return value to function comment\r
+  @todo    EFI_WARN_BUFFER_TOO_SMALL - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 AtapiPassThruPioReadWriteData (\r
   ATAPI_SCSI_PASS_THRU_DEV  *AtapiScsiPrivate,\r
@@ -1293,40 +1266,6 @@ AtapiPassThruPioReadWriteData (
   DATA_DIRECTION            Direction,\r
   UINT64                    TimeoutInMicroSeconds\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Performs data transfer between ATAPI device and host after the\r
-    ATAPI command packet is sent.\r
-    \r
-  Arguments:\r
-    AtapiScsiPrivate:   Private data structure for the specified channel.    \r
-    Buffer:             Points to the transferred data.\r
-    ByteCount:          When input,indicates the buffer size; when output,\r
-                        indicates the actually transferred data size.\r
-    Direction:          Indicates the data transfer direction. \r
-    TimeoutInMicroSeconds:\r
-                        The timeout, in micro second units, to use for the \r
-                        execution of this ATAPI command.\r
-                        A TimeoutInMicroSeconds value of 0 means that \r
-                        this function will wait indefinitely for the ATAPI \r
-                        command to execute.\r
-                        If TimeoutInMicroSeconds is greater than zero, then \r
-                        this function will return EFI_TIMEOUT if the time \r
-                        required to execute the ATAPI command is greater \r
-                        than TimeoutInMicroSeconds.\r
-\r
-  Returns:\r
-\r
-\r
---*/\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    Buffer - add argument and description to function comment\r
-// TODO:    ByteCount - add argument and description to function comment\r
-// TODO:    Direction - add argument and description to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_WARN_BUFFER_TOO_SMALL - add return value to function comment\r
 {\r
   UINT32      Index;\r
   UINT32      RequiredWordCount;\r
@@ -1420,19 +1359,20 @@ AtapiPassThruPioReadWriteData (
 }\r
 \r
 \r
+/**\r
+  Read one byte from a specified I/O port.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    PciIo - add argument and description to function comment\r
+  @todo    Port - add argument and description to function comment\r
+**/\r
 UINT8\r
 ReadPortB (\r
   IN  EFI_PCI_IO_PROTOCOL   *PciIo,\r
   IN  UINT16                Port\r
   )\r
-/*++\r
-  Read one byte from a specified I/O port.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    PciIo - add argument and description to function comment\r
-// TODO:    Port - add argument and description to function comment\r
 {\r
   UINT8 Data;\r
 \r
@@ -1449,19 +1389,20 @@ ReadPortB (
 }\r
 \r
 \r
+/**\r
+  Read one word from a specified I/O port.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    PciIo - add argument and description to function comment\r
+  @todo    Port - add argument and description to function comment\r
+**/\r
 UINT16\r
 ReadPortW (\r
   IN  EFI_PCI_IO_PROTOCOL   *PciIo,\r
   IN  UINT16                Port\r
   )\r
-/*++\r
-  Read one word from a specified I/O port.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    PciIo - add argument and description to function comment\r
-// TODO:    Port - add argument and description to function comment\r
 {\r
   UINT16  Data;\r
 \r
@@ -1478,21 +1419,22 @@ ReadPortW (
 }\r
 \r
 \r
+/**\r
+  Write one byte to a specified I/O port.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    PciIo - add argument and description to function comment\r
+  @todo    Port - add argument and description to function comment\r
+  @todo    Data - add argument and description to function comment\r
+**/\r
 VOID\r
 WritePortB (\r
   IN  EFI_PCI_IO_PROTOCOL   *PciIo,\r
   IN  UINT16                Port,\r
   IN  UINT8                 Data\r
   )\r
-/*++\r
-  Write one byte to a specified I/O port.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    PciIo - add argument and description to function comment\r
-// TODO:    Port - add argument and description to function comment\r
-// TODO:    Data - add argument and description to function comment\r
 {\r
 \r
   PciIo->Io.Write (\r
@@ -1507,21 +1449,22 @@ WritePortB (
 }\r
 \r
 \r
+/**\r
+  Write one word to a specified I/O port.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    PciIo - add argument and description to function comment\r
+  @todo    Port - add argument and description to function comment\r
+  @todo    Data - add argument and description to function comment\r
+**/\r
 VOID\r
 WritePortW (\r
   IN  EFI_PCI_IO_PROTOCOL   *PciIo,\r
   IN  UINT16                Port,\r
   IN  UINT16                Data\r
   )\r
-/*++\r
-  Write one word to a specified I/O port.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    PciIo - add argument and description to function comment\r
-// TODO:    Port - add argument and description to function comment\r
-// TODO:    Data - add argument and description to function comment\r
 {\r
 \r
   PciIo->Io.Write (\r
@@ -1534,25 +1477,26 @@ WritePortW (
               );\r
 }\r
 \r
+/**\r
+  Check whether DRQ is clear in the Status Register. (BSY must also be cleared)\r
+  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
+  DRQ clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
+  elapsed.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 StatusDRQClear (\r
   ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
   UINT64                          TimeoutInMicroSeconds\r
   )\r
-/*++\r
-  Check whether DRQ is clear in the Status Register. (BSY must also be cleared)\r
-  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
-  DRQ clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
-  elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   UINT64  Delay;\r
   UINT8   StatusRegister;\r
@@ -1613,26 +1557,27 @@ StatusDRQClear (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-AltStatusDRQClear (\r
-  ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
-  UINT64                          TimeoutInMicroSeconds\r
-  )\r
-/*++\r
+/**\r
   Check whether DRQ is clear in the Alternate Status Register. \r
   (BSY must also be cleared).\r
   If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
   DRQ clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
   elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
+EFI_STATUS\r
+AltStatusDRQClear (\r
+  ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
+  UINT64                          TimeoutInMicroSeconds\r
+  )\r
 {\r
   UINT64  Delay;\r
   UINT8   AltStatusRegister;\r
@@ -1691,25 +1636,26 @@ AltStatusDRQClear (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Check whether DRQ is ready in the Status Register. (BSY must also be cleared)\r
+  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
+  DRQ ready. Otherwise, it will return EFI_TIMEOUT when specified time is \r
+  elapsed.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 StatusDRQReady (\r
   ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
   UINT64                          TimeoutInMicroSeconds\r
   )\r
-/*++\r
-  Check whether DRQ is ready in the Status Register. (BSY must also be cleared)\r
-  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
-  DRQ ready. Otherwise, it will return EFI_TIMEOUT when specified time is \r
-  elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   UINT64  Delay;\r
   UINT8   StatusRegister;\r
@@ -1770,26 +1716,27 @@ StatusDRQReady (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-AltStatusDRQReady (\r
-  ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
-  UINT64                          TimeoutInMicroSeconds\r
-  )\r
-/*++\r
+/**\r
   Check whether DRQ is ready in the Alternate Status Register. \r
   (BSY must also be cleared)\r
   If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
   DRQ ready. Otherwise, it will return EFI_TIMEOUT when specified time is \r
   elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
+EFI_STATUS\r
+AltStatusDRQReady (\r
+  ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate,\r
+  UINT64                          TimeoutInMicroSeconds\r
+  )\r
 {\r
   UINT64  Delay;\r
   UINT8   AltStatusRegister;\r
@@ -1849,24 +1796,25 @@ AltStatusDRQReady (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Check whether BSY is clear in the Status Register.\r
+  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
+  BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
+  elapsed.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 StatusWaitForBSYClear (\r
   ATAPI_SCSI_PASS_THRU_DEV    *AtapiScsiPrivate,\r
   UINT64                      TimeoutInMicroSeconds\r
   )\r
-/*++\r
-  Check whether BSY is clear in the Status Register.\r
-  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
-  BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
-  elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   UINT64  Delay;\r
   UINT8   StatusRegister;\r
@@ -1909,24 +1857,25 @@ StatusWaitForBSYClear (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Check whether BSY is clear in the Alternate Status Register.\r
+  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
+  BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
+  elapsed.\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 AltStatusWaitForBSYClear (\r
   ATAPI_SCSI_PASS_THRU_DEV    *AtapiScsiPrivate,\r
   UINT64                      TimeoutInMicroSeconds\r
   )\r
-/*++\r
-  Check whether BSY is clear in the Alternate Status Register.\r
-  If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
-  BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is \r
-  elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   UINT64  Delay;\r
   UINT8   AltStatusRegister;\r
@@ -1968,26 +1917,27 @@ AltStatusWaitForBSYClear (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-StatusDRDYReady (\r
-  ATAPI_SCSI_PASS_THRU_DEV     *AtapiScsiPrivate,\r
-  UINT64                       TimeoutInMicroSeconds\r
-  )\r
-/*++\r
+/**\r
   Check whether DRDY is ready in the Status Register. \r
   (BSY must also be cleared)\r
   If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
   DRDY ready. Otherwise, it will return EFI_TIMEOUT when specified time is \r
   elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
+EFI_STATUS\r
+StatusDRDYReady (\r
+  ATAPI_SCSI_PASS_THRU_DEV     *AtapiScsiPrivate,\r
+  UINT64                       TimeoutInMicroSeconds\r
+  )\r
 {\r
   UINT64  Delay;\r
   UINT8   StatusRegister;\r
@@ -2043,26 +1993,27 @@ StatusDRDYReady (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-AltStatusDRDYReady (\r
-  ATAPI_SCSI_PASS_THRU_DEV     *AtapiScsiPrivate,\r
-  UINT64                       TimeoutInMicroSeconds\r
-  )\r
-/*++\r
+/**\r
   Check whether DRDY is ready in the Alternate Status Register. \r
   (BSY must also be cleared)\r
   If TimeoutInMicroSeconds is zero, this routine should wait infinitely for\r
   DRDY ready. Otherwise, it will return EFI_TIMEOUT when specified time is \r
   elapsed.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    TimeoutInMicroSeconds - add argument and description to function comment\r
-// TODO:    EFI_ABORTED - add return value to function comment\r
-// TODO:    EFI_TIMEOUT - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    TimeoutInMicroSeconds - add argument and description to function comment\r
+  @todo    EFI_ABORTED - add return value to function comment\r
+  @todo    EFI_TIMEOUT - add return value to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+**/\r
+EFI_STATUS\r
+AltStatusDRDYReady (\r
+  ATAPI_SCSI_PASS_THRU_DEV     *AtapiScsiPrivate,\r
+  UINT64                       TimeoutInMicroSeconds\r
+  )\r
 {\r
   UINT64  Delay;\r
   UINT8   AltStatusRegister;\r
@@ -2118,109 +2069,106 @@ AltStatusDRDYReady (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Check Error Register for Error Information. \r
+\r
+  @todo function comment is missing 'Routine Description:'\r
+  @todo function comment is missing 'Arguments:'\r
+  @todo function comment is missing 'Returns:'\r
+  @todo    AtapiScsiPrivate - add argument and description to function comment\r
+  @todo    EFI_SUCCESS - add return value to function comment\r
+  @todo    EFI_DEVICE_ERROR - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 AtapiPassThruCheckErrorStatus (\r
   ATAPI_SCSI_PASS_THRU_DEV        *AtapiScsiPrivate\r
   )\r
-/*++  \r
-  Check Error Register for Error Information. \r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    AtapiScsiPrivate - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
 {\r
   UINT8 StatusRegister;\r
-\r
-//#ifdef EFI_DEBUG\r
-\r
   UINT8 ErrorRegister;\r
 \r
-//#endif\r
-\r
   StatusRegister = ReadPortB (\r
                     AtapiScsiPrivate->PciIo,\r
                     AtapiScsiPrivate->IoPort->Reg.Status\r
                     );\r
-  DEBUG_CODE (\r
+  \r
+  DEBUG_CODE_BEGIN ();\r
 \r
     if (StatusRegister & DWF) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Write Fault\n",\r
-      StatusRegister)\r
-      );\r
-  }\r
+      DEBUG (\r
+        (EFI_D_BLKIO,\r
+        "AtapiPassThruCheckErrorStatus()-- %02x : Error : Write Fault\n",\r
+        StatusRegister)\r
+        );\r
+    }\r
 \r
-  if (StatusRegister & CORR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Corrected Data\n",\r
-      StatusRegister)\r
-      );\r
-  }\r
+    if (StatusRegister & CORR) {\r
+      DEBUG (\r
+        (EFI_D_BLKIO,\r
+        "AtapiPassThruCheckErrorStatus()-- %02x : Error : Corrected Data\n",\r
+        StatusRegister)\r
+        );\r
+    }\r
 \r
-  if (StatusRegister & ERR) {\r
-    ErrorRegister = ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->Reg1.Error);\r
+    if (StatusRegister & ERR) {\r
+      ErrorRegister = ReadPortB (AtapiScsiPrivate->PciIo, AtapiScsiPrivate->IoPort->Reg1.Error);\r
+      \r
 \r
-    if (ErrorRegister & BBK_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Bad Block Detected\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & BBK_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Bad Block Detected\n",\r
+          ErrorRegister)\r
+          );\r
+      }\r
 \r
-  if (ErrorRegister & UNC_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Uncorrectable Data\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & UNC_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Uncorrectable Data\n",\r
+          ErrorRegister)\r
+          );\r
+      }\r
 \r
-  if (ErrorRegister & MC_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Media Change\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & MC_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Media Change\n",\r
+          ErrorRegister)\r
+          );\r
+      }\r
 \r
-  if (ErrorRegister & ABRT_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Abort\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & ABRT_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Abort\n",\r
+          ErrorRegister)\r
+          );\r
+      }\r
 \r
-  if (ErrorRegister & TK0NF_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Track 0 Not Found\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & TK0NF_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Track 0 Not Found\n",\r
+          ErrorRegister)\r
+          );\r
+      }\r
 \r
-  if (ErrorRegister & AMNF_ERR) {\r
-    DEBUG (\r
-      (EFI_D_BLKIO,\r
-      "AtapiPassThruCheckErrorStatus()-- %02x : Error : Address Mark Not Found\n",\r
-      ErrorRegister)\r
-      );\r
-  }\r
+      if (ErrorRegister & AMNF_ERR) {\r
+        DEBUG (\r
+          (EFI_D_BLKIO,\r
+          "AtapiPassThruCheckErrorStatus()-- %02x : Error : Address Mark Not Found\n",\r
+          ErrorRegister)\r
+          );\r
+       }\r
+    }\r
 \r
-  }\r
-  );\r
+  DEBUG_CODE_END ();\r
 \r
   if ((StatusRegister & (ERR | DWF | CORR)) == 0) {\r
-\r
     return EFI_SUCCESS;\r
   }\r
 \r
\r
   return EFI_DEVICE_ERROR;\r
-\r
 }\r