]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/IdeBus/Dxe/ata.c
Update comments to conform to the new, Doxygen friendly, coding standard. These...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / ata.c
index 88e81c0ada92d6e7f436249335fe72f1108fee97..9a1542d0ea649f1efac2f92d5790336fce762e26 100644 (file)
@@ -1,33 +1,25 @@
-/*++\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
-\r
-Module Name:\r
-\r
-    ata.c\r
-    \r
-Abstract: \r
-    \r
-Revision History\r
-\r
-    2002-6: Add Atapi6 enhancement, support >120GB hard disk, including\r
-            update - ATAIdentity() func\r
-            update - AtaBlockIoReadBlocks() func\r
-            update - AtaBlockIoWriteBlocks() func\r
-            add    - AtaAtapi6Identify() func\r
-            add    - AtaReadSectorsExt() func\r
-            add    - AtaWriteSectorsExt() func\r
-            add    - AtaPioDataInExt() func\r
-            add    - AtaPioDataOutExt() func\r
-            \r
---*/\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
+  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
+  @par Revision Reference:\r
+  2002-6: Add Atapi6 enhancement, support >120GB hard disk, including\r
+  update - ATAIdentity() func\r
+  update - AtaBlockIoReadBlocks() func\r
+  update - AtaBlockIoWriteBlocks() func\r
+  add    - AtaAtapi6Identify() func\r
+  add    - AtaReadSectorsExt() func\r
+  add    - AtaWriteSectorsExt() func\r
+  add    - AtaPioDataInExt() func\r
+  add    - AtaPioDataOutExt() func\r
+\r
+**/\r
 \r
 #include "idebus.h"\r
 \r
@@ -68,46 +60,34 @@ AtaPioDataOutExt (
   IN  UINT16          SectorCount\r
   );\r
 \r
-EFI_STATUS\r
-ATAIdentify (\r
-  IN  IDE_BLK_IO_DEV  *IdeDev\r
-  )\r
-/*++\r
-  Name:\r
-        ATAIdentify\r
-\r
+/**\r
+  Sends out an ATA Identify Command to the specified device.\r
 \r
-  Purpose: \r
-        This function is called by DiscoverIdeDevice() during its device\r
-        identification. It sends out the ATA Identify Command to the \r
-        specified device. Only ATA device responses to this command. If \r
-        the command succeeds, it returns the Identify data structure which \r
-        contains information about the device. This function extracts the \r
-        information it needs to fill the IDE_BLK_IO_DEV data structure, \r
-        including device type, media block size, media capacity, and etc.\r
+  This function is called by DiscoverIdeDevice() during its device\r
+  identification. It sends out the ATA Identify Command to the \r
+  specified device. Only ATA device responses to this command. If \r
+  the command succeeds, it returns the Identify data structure which \r
+  contains information about the device. This function extracts the \r
+  information it needs to fill the IDE_BLK_IO_DEV data structure, \r
+  including device type, media block size, media capacity, and etc.\r
 \r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure,used\r
+  to record all the information of the IDE device.\r
 \r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure,used\r
-          to record all the information of the IDE device.\r
-\r
-\r
-  Returns:  \r
-        EFI_SUCCESS\r
-          Identify ATA device successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          ATA Identify Device Command failed or device is not \r
-          ATA device.\r
+  @retval EFI_SUCCESS Identify ATA device successfully.\r
+  \r
+  @retval EFI_DEVICE_ERROR ATA Identify Device Command failed or\r
+  device is not ATA device.\r
 \r
+  @note\r
+  parameter IdeDev will be updated in this function.\r
 \r
-  Notes:\r
-        parameter IdeDev will be updated in this function.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
+**/\r
+EFI_STATUS\r
+ATAIdentify (\r
+  IN  IDE_BLK_IO_DEV  *IdeDev\r
+  )\r
 {\r
   EFI_STATUS        Status;\r
   EFI_IDENTIFY_DATA *AtaIdentifyPointer;\r
@@ -213,42 +193,30 @@ ATAIdentify (
 }\r
 \r
 \r
-EFI_STATUS\r
-AtaAtapi6Identify (\r
-  IN  IDE_BLK_IO_DEV  *IdeDev\r
-  )\r
-/*++\r
-  Name:\r
-  \r
-        AtaAtapi6Identify\r
+/**\r
+  This function is called by ATAIdentify() to identity whether this disk\r
+  supports ATA/ATAPI6 48bit addressing, ie support >120G capacity\r
 \r
-  Purpose: \r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @retval  EFI_SUCCESS The disk specified by IdeDev is a Atapi6 supported one\r
+  and 48-bit addressing must be used\r
   \r
-        This function is called by ATAIdentify() to identity whether this disk\r
-        supports ATA/ATAPI6 48bit addressing, ie support >120G capacity\r
+  @retval  EFI_UNSUPPORTED The disk dosn't not support Atapi6 or it supports but\r
+  the capacity is below 120G, 48bit addressing is not\r
+  needed\r
 \r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
+  @note\r
+  This function must be called after DEVICE_IDENTITY command has been \r
+  successfully returned\r
 \r
-  Returns:  \r
-  \r
-        EFI_SUCCESS     - The disk specified by IdeDev is a Atapi6 supported one\r
-                          and 48-bit addressing must be used\r
-\r
-        EFI_UNSUPPORTED - The disk dosn't not support Atapi6 or it supports but\r
-                          the capacity is below 120G, 48bit addressing is not \r
-                          needed\r
-                          \r
-  Notes:\r
-\r
-       This function must be called after DEVICE_IDENTITY command has been \r
-       successfully returned\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
+**/\r
+EFI_STATUS\r
+AtaAtapi6Identify (\r
+  IN  IDE_BLK_IO_DEV  *IdeDev\r
+  )\r
 {\r
   UINT8             Index;\r
   EFI_LBA           TmpLba;\r
@@ -304,33 +272,19 @@ AtaAtapi6Identify (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
+/**\r
+  This function is called by ATAIdentify() or ATAPIIdentify()\r
+  to print device's module name. \r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+**/\r
 VOID\r
 PrintAtaModuleName (\r
   IN  IDE_BLK_IO_DEV  *IdeDev\r
   )\r
-/*++\r
-  Name:\r
-        PrintAtaModuleName\r
-\r
-\r
-  Purpose: \r
-        This function is called by ATAIdentify() or ATAPIIdentify()\r
-        to print device's module name. \r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-  Returns:  \r
-        no returns.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
 {\r
   if (IdeDev->pIdData == NULL) {\r
     return ;\r
@@ -340,6 +294,44 @@ PrintAtaModuleName (
   IdeDev->ModelName[40] = 0x00;\r
 }\r
 \r
+/**\r
+  This function is used to send out ATA commands conforms to the \r
+  PIO Data In Protocol.\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *Buffer\r
+  buffer contained data transferred from device to host.\r
+\r
+  @param[in] ByteCount\r
+  data size in byte unit of the buffer.\r
+\r
+  @param[in] AtaCommand\r
+  value of the Command Register\r
+\r
+  @param[in] Head\r
+  value of the Head/Device Register\r
+\r
+  @param[in] SectorCount\r
+  value of the Sector Count Register\r
+\r
+  @param[in] SectorNumber\r
+  value of the Sector Number Register\r
+\r
+  @param[in] CylinderLsb\r
+  value of the low byte of the Cylinder Register\r
+\r
+  @param[in] CylinderMsb\r
+  value of the high byte of the Cylinder Register\r
+\r
+  @retval EFI_SUCCESS send out the ATA command and device send required\r
+  data successfully.\r
+  \r
+  @retval EFI_DEVICE_ERROR command sent failed.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaPioDataIn (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -352,66 +344,6 @@ AtaPioDataIn (
   IN  UINT8           CylinderLsb,\r
   IN  UINT8           CylinderMsb\r
   )\r
-/*++\r
-  Name:\r
-        AtaPioDataIn\r
-\r
-\r
-  Purpose: \r
-        This function is used to send out ATA commands conforms to the \r
-        PIO Data In Protocol.\r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *Buffer\r
-          buffer contained data transferred from device to host.\r
-\r
-        UINT32      IN    ByteCount\r
-          data size in byte unit of the buffer.\r
-\r
-        UINT8     IN    AtaCommand\r
-          value of the Command Register\r
-\r
-        UINT8     IN    Head\r
-          value of the Head/Device Register\r
-\r
-        UINT8     IN    SectorCount\r
-          value of the Sector Count Register\r
-\r
-        UINT8     IN    SectorNumber\r
-          value of the Sector Number Register\r
-\r
-        UINT8     IN    CylinderLsb\r
-          value of the low byte of the Cylinder Register\r
-\r
-        UINT8     IN    CylinderMsb\r
-          value of the high byte of the Cylinder Register\r
-\r
-\r
-  Returns:  \r
-        EFI_SUCCESS\r
-          send out the ATA command and device send required\r
-          data successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          command sent failed.\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - 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:    AtaCommand - add argument and description to function comment\r
-// TODO:    Head - add argument and description to function comment\r
-// TODO:    SectorCount - add argument and description to function comment\r
-// TODO:    SectorNumber - add argument and description to function comment\r
-// TODO:    CylinderLsb - add argument and description to function comment\r
-// TODO:    CylinderMsb - add argument and description to function comment\r
 {\r
   UINTN       WordCount;\r
   UINTN       Increment;\r
@@ -529,6 +461,29 @@ AtaPioDataIn (
   return CheckErrorStatus (IdeDev);\r
 }\r
 \r
+/**\r
+  This function is used to send out ATA commands conforms to the \r
+  PIO Data Out Protocol.\r
+\r
+  @param *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param *Buffer      buffer contained data transferred from host to device.\r
+  @param ByteCount    data size in byte unit of the buffer.\r
+  @param AtaCommand   value of the Command Register\r
+  @param Head         value of the Head/Device Register\r
+  @param SectorCount  value of the Sector Count Register\r
+  @param SectorNumber value of the Sector Number Register\r
+  @param CylinderLsb  value of the low byte of the Cylinder Register\r
+  @param CylinderMsb  value of the high byte of the Cylinder Register\r
+\r
+  @retval EFI_SUCCESS send out the ATA command and device received required\r
+  data successfully.\r
+  \r
+  @retval EFI_DEVICE_ERROR command sent failed.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaPioDataOut (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -541,67 +496,6 @@ AtaPioDataOut (
   IN  UINT8           CylinderLsb,\r
   IN  UINT8           CylinderMsb\r
   )\r
-/*++\r
-  Name:\r
-        AtaPioDataOut\r
-\r
-\r
-  Purpose: \r
-        This function is used to send out ATA commands conforms to the \r
-        PIO Data Out Protocol.\r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *Buffer\r
-          buffer contained data transferred from host to device.\r
-\r
-        UINT32      IN    ByteCount\r
-          data size in byte unit of the buffer.\r
-\r
-        UINT8     IN    AtaCommand\r
-          value of the Command Register\r
-\r
-        UINT8     IN    Head\r
-          value of the Head/Device Register\r
-\r
-        UINT8     IN    SectorCount\r
-          value of the Sector Count Register\r
-\r
-        UINT8     IN    SectorNumber\r
-          value of the Sector Number Register\r
-\r
-        UINT8     IN    CylinderLsb\r
-          value of the low byte of the Cylinder Register\r
-\r
-        UINT8     IN    CylinderMsb\r
-          value of the high byte of the Cylinder Register\r
-\r
-\r
-  Returns:  \r
-        EFI_SUCCESS\r
-          send out the ATA command and device received required\r
-          data successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          command sent failed. \r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - 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:    AtaCommand - add argument and description to function comment\r
-// TODO:    Head - add argument and description to function comment\r
-// TODO:    SectorCount - add argument and description to function comment\r
-// TODO:    SectorNumber - add argument and description to function comment\r
-// TODO:    CylinderLsb - add argument and description to function comment\r
-// TODO:    CylinderMsb - add argument and description to function comment\r
 {\r
   UINTN       WordCount;\r
   UINTN       Increment;\r
@@ -718,38 +612,23 @@ AtaPioDataOut (
   return CheckErrorStatus (IdeDev);\r
 }\r
 \r
+/**\r
+  This function is used to analyze the Status Register and print out \r
+  some debug information and if there is ERR bit set in the Status\r
+  Register, the Error Register's value is also be parsed and print out.\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @retval EFI_SUCCESS       No err information in the Status Register.\r
+  @retval EFI_DEVICE_ERROR  Any err information in the Status Register.\r
+\r
+**/\r
 EFI_STATUS\r
 CheckErrorStatus (\r
   IN  IDE_BLK_IO_DEV  *IdeDev\r
   )\r
-/*++\r
-  Name:\r
-        CheckErrorStatus\r
-\r
-\r
-  Purpose: \r
-        This function is used to analyze the Status Register and print out \r
-        some debug information and if there is ERR bit set in the Status\r
-        Register, the Error Register's value is also be parsed and print out.\r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-  Returns:  \r
-        EFI_SUCCESS\r
-          No err information in the Status Register.\r
-\r
-        EFI_DEVICE_ERROR\r
-          Any err information in the Status Register.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
 {\r
   UINT8 StatusRegister;\r
 \r
@@ -841,6 +720,28 @@ CheckErrorStatus (
 \r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoReadBlocks() to perform\r
+  reading from media in block unit.\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer\r
+  A pointer to the destination buffer for the data. \r
+\r
+  @param[in] Lba\r
+  The starting logical block address to read from \r
+  on the device media.\r
+\r
+  @param[in] NumberOfBlocks\r
+  The number of transfer data blocks.\r
+\r
+  @return return status is fully dependent on the return status\r
+  of AtaPioDataIn() function.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaReadSectors (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -848,43 +749,6 @@ AtaReadSectors (
   IN  EFI_LBA         Lba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-        AtaReadSectors\r
-\r
-\r
-  Purpose: \r
-        This function is called by the AtaBlkIoReadBlocks() to perform\r
-        reading from media in block unit.\r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the destination buffer for the data. \r
-\r
-        EFI_LBA     IN    Lba\r
-          The starting logical block address to read from \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-        return status is fully dependent on the return status\r
-        of AtaPioDataIn() function.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    Lba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       BlocksRemaining;\r
@@ -974,6 +838,28 @@ AtaReadSectors (
   return Status;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoWriteBlocks() to perform\r
+  writing onto media in block unit.\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure,used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *BufferData\r
+  A pointer to the source buffer for the data. \r
+\r
+  @param[in] Lba\r
+  The starting logical block address to write onto \r
+  the device media.\r
+\r
+  @param[in] NumberOfBlocks\r
+  The number of transfer data blocks.\r
+\r
+  @return return status is fully dependent on the return status\r
+  of AtaPioDataOut() function.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaWriteSectors (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -981,44 +867,6 @@ AtaWriteSectors (
   IN  EFI_LBA         Lba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-        AtaWriteSectors\r
-\r
-\r
-  Purpose: \r
-        This function is called by the AtaBlkIoWriteBlocks() to perform\r
-        writing onto media in block unit.\r
-\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure,used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *BufferData\r
-          A pointer to the source buffer for the data. \r
-\r
-        EFI_LBA     IN    Lba\r
-          The starting logical block address to write onto \r
-          the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-\r
-  Returns:  \r
-        return status is fully dependent on the return status\r
-        of AtaPioDataOut() function.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    BufferData - add argument and description to function comment\r
-// TODO:    Lba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       BlocksRemaining;\r
@@ -1095,41 +943,34 @@ AtaWriteSectors (
   return Status;\r
 }\r
 \r
+/**\r
+  This function is used to implement the Soft Reset on the specified\r
+  device. But, the ATA Soft Reset mechanism is so strong a reset method \r
+  that it will force resetting on both devices connected to the \r
+  same cable.\r
+\r
+  It is called by IdeBlkIoReset(), a interface function of Block\r
+  I/O protocol.\r
+\r
+  This function can also be used by the ATAPI device to perform reset when\r
+  ATAPI Reset command is failed.\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @retval EFI_SUCCESS       Soft reset completes successfully.\r
+  @retval EFI_DEVICE_ERROR  Any step during the reset process is failed.\r
+\r
+  @note\r
+  The registers initial values after ATA soft reset are different\r
+  to the ATA device and ATAPI device.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaSoftReset (\r
   IN  IDE_BLK_IO_DEV  *IdeDev\r
   )\r
-/*++\r
-  Name:\r
-        AtaSoftReset\r
-\r
-  Purpose: \r
-        This function is used to implement the Soft Reset on the specified\r
-        device. But, the ATA Soft Reset mechanism is so strong a reset method \r
-        that it will force resetting on both devices connected to the \r
-        same cable.\r
-        It is called by IdeBlkIoReset(), a interface function of Block\r
-        I/O protocol.\r
-        This function can also be used by the ATAPI device to perform reset when\r
-        ATAPI Reset command is failed.\r
-            \r
-  Parameters:\r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-  Returns:  \r
-        EFI_SUCCESS\r
-          Soft reset completes successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          Any step during the reset process is failed.\r
-  Notes:\r
-        The registers initial values after ATA soft reset are different\r
-        to the ATA device and ATAPI device.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
 {\r
 \r
   UINT8 DeviceControl;\r
@@ -1165,77 +1006,55 @@ AtaSoftReset (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-AtaBlkIoReadBlocks (\r
-  IN IDE_BLK_IO_DEV   *IdeBlkIoDevice,\r
-  IN UINT32           MediaId,\r
-  IN EFI_LBA          LBA,\r
-  IN UINTN            BufferSize,\r
-  OUT VOID            *Buffer\r
-  )\r
-/*++\r
-  Name:\r
-      AtaBlkIoReadBlocks\r
-\r
-\r
-  Purpose: \r
-      This function is the ATA implementation for ReadBlocks in the\r
-      Block I/O Protocol interface.\r
-\r
+/**\r
+  This function is the ATA implementation for ReadBlocks in the\r
+  Block I/O Protocol interface.\r
 \r
-  Parameters:\r
-      IDE_BLK_IO_DEV    IN    *IdeBlkIoDevice\r
-        Indicates the calling context.\r
+  @param[in] *IdeBlkIoDevice\r
+  Indicates the calling context.\r
 \r
-      UINT32      IN    MediaId\r
-        The media id that the read request is for.\r
+  @param[in] MediaId\r
+  The media id that the read request is for.\r
 \r
-      EFI_LBA     IN    LBA\r
-        The starting logical block address to read from \r
-        on the device.\r
+  @param[in] LBA\r
+  The starting logical block address to read from \r
+  on the device.\r
 \r
-      UINTN     IN    BufferSize\r
-        The size of the Buffer in bytes. This must be a\r
-        multiple of the intrinsic block size of the device.\r
+  @param[in] BufferSize\r
+  The size of the Buffer in bytes. This must be a\r
+  multiple of the intrinsic block size of the device.\r
 \r
-      VOID      OUT   *Buffer\r
-        A pointer to the destination buffer for the data. \r
-        The caller is responsible for either having implicit\r
-        or explicit ownership of the memory that data is read into.\r
+  @param[out] *Buffer\r
+  A pointer to the destination buffer for the data. \r
+  The caller is responsible for either having implicit\r
+  or explicit ownership of the memory that data is read into.\r
 \r
-  Returns:  \r
-      EFI_SUCCESS \r
-        Read Blocks successfully.\r
-\r
-      EFI_DEVICE_ERROR\r
-        Read Blocks failed.\r
-\r
-      EFI_NO_MEDIA\r
-        There is no media in the device.\r
-\r
-      EFI_MEDIA_CHANGE\r
-        The MediaId is not for the current media.\r
-\r
-      EFI_BAD_BUFFER_SIZE\r
-        The BufferSize parameter is not a multiple of the \r
-        intrinsic block size of the device.\r
+  @retval EFI_SUCCESS       Read Blocks successfully.\r
+  @retval EFI_DEVICE_ERROR  Read Blocks failed.\r
+  @retval EFI_NO_MEDIA      There is no media in the device.\r
+  @retval EFI_MEDIA_CHANGE  The MediaId is not for the current media.\r
+  \r
+  @retval EFI_BAD_BUFFER_SIZE\r
+  The BufferSize parameter is not a multiple of the\r
+  intrinsic block size of the device.\r
+  \r
+  @retval EFI_INVALID_PARAMETER\r
+  The read request contains LBAs that are not valid,\r
+  or the data buffer is not valid.\r
 \r
-      EFI_INVALID_PARAMETER\r
-        The read request contains LBAs that are not valid,\r
-        or the data buffer is not valid.\r
+  @note\r
+  If Read Block error because of device error, this function will call\r
+  AtaSoftReset() function to reset device.\r
 \r
-  Notes:\r
-      If Read Block error because of device error, this function will call\r
-      AtaSoftReset() function to reset device.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeBlkIoDevice - add argument and description to function comment\r
-// TODO:    MediaId - add argument and description to function comment\r
-// TODO:    LBA - add argument and description to function comment\r
-// TODO:    BufferSize - add argument and description to function comment\r
-// TODO:    Buffer - add argument and description to function comment\r
-// TODO:    EFI_MEDIA_CHANGED - add return value to function comment\r
+**/\r
+EFI_STATUS\r
+AtaBlkIoReadBlocks (\r
+  IN IDE_BLK_IO_DEV   *IdeBlkIoDevice,\r
+  IN UINT32           MediaId,\r
+  IN EFI_LBA          LBA,\r
+  IN UINTN            BufferSize,\r
+  OUT VOID            *Buffer\r
+  )\r
 {\r
   EFI_BLOCK_IO_MEDIA  *Media;\r
   UINTN               BlockSize;\r
@@ -1315,6 +1134,48 @@ AtaBlkIoReadBlocks (
 \r
 }\r
 \r
+/**\r
+  This function is the ATA implementation for WriteBlocks in the\r
+  Block I/O Protocol interface.\r
+\r
+  @param[in] *IdeBlkIoDevice\r
+  Indicates the calling context.\r
+\r
+  @param[in] MediaId\r
+  The media id that the write request is for.\r
+\r
+  @param[in] LBA\r
+  The starting logical block address to write onto \r
+  the device.\r
+\r
+  @param[in] BufferSize\r
+  The size of the Buffer in bytes. This must be a\r
+  multiple of the intrinsic block size of the device.\r
+\r
+  @param[out] *Buffer\r
+  A pointer to the source buffer for the data. \r
+  The caller is responsible for either having implicit\r
+  or explicit ownership of the memory that data is \r
+  written from.\r
+\r
+  @retval EFI_SUCCESS       Write Blocks successfully.\r
+  @retval EFI_DEVICE_ERROR  Write Blocks failed.\r
+  @retval EFI_NO_MEDIA      There is no media in the device.\r
+  @retval EFI_MEDIA_CHANGE  The MediaId is not for the current media.\r
+  \r
+  @retval EFI_BAD_BUFFER_SIZE\r
+  The BufferSize parameter is not a multiple of the\r
+  intrinsic block size of the device.\r
+  \r
+  @retval EFI_INVALID_PARAMETER\r
+  The write request contains LBAs that are not valid,\r
+  or the data buffer is not valid.\r
+\r
+  @note\r
+  If Write Block error because of device error, this function will call\r
+  AtaSoftReset() function to reset device.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaBlkIoWriteBlocks (\r
   IN  IDE_BLK_IO_DEV   *IdeBlkIoDevice,\r
@@ -1323,70 +1184,6 @@ AtaBlkIoWriteBlocks (
   IN  UINTN            BufferSize,\r
   OUT VOID             *Buffer\r
   )\r
-/*++\r
-  Name:\r
-        AtaBlkIoWriteBlocks\r
-\r
-\r
-  Purpose: \r
-        This function is the ATA implementation for WriteBlocks in the\r
-        Block I/O Protocol interface.\r
-\r
-  Parameters:\r
-        IDE_BLK_IO_DEV   IN    *IdeBlkIoDevice\r
-          Indicates the calling context.\r
-\r
-        UINT32      IN    MediaId\r
-          The media id that the write request is for.\r
-\r
-        EFI_LBA     IN    LBA\r
-          The starting logical block address to write onto \r
-          the device.\r
-\r
-        UINTN     IN    BufferSize\r
-          The size of the Buffer in bytes. This must be a\r
-          multiple of the intrinsic block size of the device.\r
-\r
-        VOID      OUT   *Buffer\r
-          A pointer to the source buffer for the data. \r
-          The caller is responsible for either having implicit\r
-          or explicit ownership of the memory that data is \r
-          written from.\r
-\r
-\r
-  Returns:  \r
-        EFI_SUCCESS \r
-          Write Blocks successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          Write Blocks failed.\r
-\r
-        EFI_NO_MEDIA\r
-          There is no media in the device.\r
-\r
-        EFI_MEDIA_CHANGE\r
-          The MediaId is not for the current media.\r
-\r
-        EFI_BAD_BUFFER_SIZE\r
-          The BufferSize parameter is not a multiple of the \r
-          intrinsic block size of the device.\r
-\r
-        EFI_INVALID_PARAMETER\r
-          The write request contains LBAs that are not valid,\r
-          or the data buffer is not valid.\r
-\r
-  Notes:\r
-        If Write Block error because of device error, this function will call\r
-        AtaSoftReset() function to reset device.\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeBlkIoDevice - add argument and description to function comment\r
-// TODO:    MediaId - add argument and description to function comment\r
-// TODO:    LBA - add argument and description to function comment\r
-// TODO:    BufferSize - add argument and description to function comment\r
-// TODO:    Buffer - add argument and description to function comment\r
-// TODO:    EFI_MEDIA_CHANGED - add return value to function comment\r
 {\r
 \r
   EFI_BLOCK_IO_MEDIA  *Media;\r
@@ -1457,6 +1254,24 @@ AtaBlkIoWriteBlocks (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoReadBlocks() to perform\r
+  reading from media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer    A pointer to the destination buffer for the data. \r
+  @param[in] StartLba       The starting logical block address to read from \r
+  on the device media.\r
+  @param[in] NumberOfBlocks The number of transfer data blocks.\r
+\r
+  @return return status is fully dependent on the return status\r
+  of AtaPioDataInExt() function.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaReadSectorsExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -1464,46 +1279,6 @@ AtaReadSectorsExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaReadSectorsExt\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoReadBlocks() to perform\r
-        reading from media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the destination buffer for the data. \r
-\r
-        EFI_LBA     IN    StartLba\r
-          The starting logical block address to read from \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-  \r
-        return status is fully dependent on the return status\r
-        of AtaPioDataInExt() function.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       BlocksRemaining;\r
@@ -1562,6 +1337,29 @@ AtaReadSectorsExt (
   return Status;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoWriteBlocks() to perform\r
+  writing onto media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure,used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer\r
+  A pointer to the source buffer for the data. \r
+\r
+  @param[in] Lba\r
+  The starting logical block address to write onto \r
+  the device media.\r
+\r
+  @param[in] NumberOfBlocks\r
+  The number of transfer data blocks.\r
+\r
+  @return status is fully dependent on the return status\r
+  of AtaPioDataOutExt() function.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaWriteSectorsExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -1569,46 +1367,6 @@ AtaWriteSectorsExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaWriteSectorsExt\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoWriteBlocks() to perform\r
-        writing onto media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure,used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the source buffer for the data. \r
-\r
-        EFI_LBA   IN    Lba\r
-          The starting logical block address to write onto \r
-          the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-  \r
-        return status is fully dependent on the return status\r
-        of AtaPioDataOutExt() function.\r
-\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
   EFI_LBA     Lba64;\r
@@ -1668,6 +1426,32 @@ AtaWriteSectorsExt (
   return Status;\r
 }\r
 \r
+/**\r
+  This function is used to send out ATA commands conforms to the \r
+  PIO Data In Protocol, supporting ATA/ATAPI-6 standard\r
+\r
+  Comparing with ATA-3 data in protocol, we have two differents here:<BR>\r
+  1. Do NOT wait for DRQ clear before sending command into IDE device.(the\r
+  wait will frequently fail... cause writing function return error)\r
+\r
+  2. Do NOT wait for DRQ clear after all data readed.(the wait greatly \r
+  slow down writing performance by 100 times!)\r
+\r
+  @param[in] *IdeDev pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in,out] *Buffer  buffer contained data transferred from device to host.\r
+  @param[in] ByteCount    data size in byte unit of the buffer.\r
+  @param[in] AtaCommand   value of the Command Register\r
+  @param[in] StartLba     the start LBA of this transaction\r
+  @param[in] SectorCount  the count of sectors to be transfered\r
+\r
+  @retval EFI_SUCCESS send out the ATA command and device send required\r
+  data successfully.\r
+  \r
+  @retval EFI_DEVICE_ERROR command sent failed.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaPioDataInExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -1677,63 +1461,6 @@ AtaPioDataInExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINT16          SectorCount\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaPioDataInExt\r
-\r
-  Purpose: \r
-  \r
-        This function is used to send out ATA commands conforms to the \r
-        PIO Data In Protocol, supporting ATA/ATAPI-6 standard\r
-\r
-        Comparing with ATA-3 data in protocol, we have two differents here:\r
-        1. Do NOT wait for DRQ clear before sending command into IDE device.(the\r
-           wait will frequently fail... cause writing function return error)\r
-           \r
-        2. Do NOT wait for DRQ clear after all data readed.(the wait greatly \r
-           slow down writing performance by 100 times!)\r
-\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN  OUT     *Buffer\r
-          buffer contained data transferred from device to host.\r
-\r
-        UINT32    IN    ByteCount\r
-          data size in byte unit of the buffer.\r
-\r
-        UINT8     IN    AtaCommand\r
-          value of the Command Register\r
-\r
-        EFI_LBA   IN    StartLba\r
-          the start LBA of this transaction\r
-          \r
-        UINT16    IN    SectorCount\r
-          the count of sectors to be transfered\r
-\r
-  Returns:  \r
-  \r
-        EFI_SUCCESS\r
-          send out the ATA command and device send required\r
-          data successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          command sent failed.\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - 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:    AtaCommand - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    SectorCount - add argument and description to function comment\r
 {\r
   UINT8       DevSel;\r
   UINT8       SectorCount8;\r
@@ -1864,6 +1591,33 @@ AtaPioDataInExt (
   return CheckErrorStatus (IdeDev);\r
 }\r
 \r
+/**\r
+  This function is used to send out ATA commands conforms to the \r
+  PIO Data Out Protocol, supporting ATA/ATAPI-6 standard\r
+\r
+  Comparing with ATA-3 data out protocol, we have two differents here:<BR>\r
+  1. Do NOT wait for DRQ clear before sending command into IDE device.(the\r
+  wait will frequently fail... cause writing function return error)\r
+\r
+  2. Do NOT wait for DRQ clear after all data readed.(the wait greatly \r
+  slow down writing performance by 100 times!)\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *Buffer      buffer contained data transferred from host to device.\r
+  @param[in] ByteCount    data size in byte unit of the buffer.\r
+  @param[in] AtaCommand   value of the Command Register\r
+  @param[in] StartLba     the start LBA of this transaction\r
+  @param[in] SectorCount  the count of sectors to be transfered\r
+\r
+  @retval EFI_SUCCESS send out the ATA command and device receive required\r
+  data successfully.\r
+  \r
+  @retval EFI_DEVICE_ERROR command sent failed.\r
+\r
+**/\r
 EFI_STATUS\r
 AtaPioDataOutExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -1873,62 +1627,6 @@ AtaPioDataOutExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINT16          SectorCount\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaPioDataOutExt\r
-\r
-  Purpose: \r
-  \r
-        This function is used to send out ATA commands conforms to the \r
-        PIO Data Out Protocol, supporting ATA/ATAPI-6 standard\r
-\r
-        Comparing with ATA-3 data out protocol, we have two differents here:\r
-        1. Do NOT wait for DRQ clear before sending command into IDE device.(the\r
-           wait will frequently fail... cause writing function return error)\r
-           \r
-        2. Do NOT wait for DRQ clear after all data readed.(the wait greatly \r
-           slow down writing performance by 100 times!)\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *Buffer\r
-          buffer contained data transferred from host to device.\r
-\r
-        UINT32    IN    ByteCount\r
-          data size in byte unit of the buffer.\r
-\r
-        UINT8     IN    AtaCommand\r
-          value of the Command Register\r
-\r
-        EFI_LBA   IN    StartLba\r
-          the start LBA of this transaction\r
-          \r
-        UINT16    IN    SectorCount\r
-          the count of sectors to be transfered\r
-\r
-  Returns:  \r
-  \r
-        EFI_SUCCESS\r
-          send out the ATA command and device receive required\r
-          data successfully.\r
-\r
-        EFI_DEVICE_ERROR\r
-          command sent failed.\r
-  Notes:\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - 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:    AtaCommand - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    SectorCount - add argument and description to function comment\r
 {\r
   UINT8       DevSel;\r
   UINT8       SectorCount8;\r
@@ -2055,31 +1753,18 @@ AtaPioDataOutExt (
 }\r
 \r
 \r
+/**\r
+  Enable SMART of the disk if supported\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure,used\r
+  to record all the information of the IDE device.\r
+\r
+**/\r
 VOID\r
 AtaSMARTSupport (\r
   IN  IDE_BLK_IO_DEV  *IdeDev\r
   )\r
-/*++\r
-  Name:  \r
-        AtaSMARTSupport\r
-\r
-  Purpose: \r
-\r
-        Enable SMART of the disk if supported\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure,used\r
-          to record all the information of the IDE device.\r
-\r
-  Returns:  \r
-  \r
-        NONE\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
 {\r
   EFI_STATUS        Status;\r
   BOOLEAN           SMARTSupported;\r
@@ -2213,6 +1898,20 @@ AtaSMARTSupport (
   return ;\r
 }\r
 \r
+/**\r
+  Send ATA Ext command into device with NON_DATA protocol\r
+\r
+  @param  IdeDev Standard IDE device private data structure\r
+  @param  AtaCommand The ATA command to be sent\r
+  @param  Device The value in Device register\r
+  @param  Feature The value in Feature register\r
+  @param  SectorCount The value in SectorCount register\r
+  @param  LbaAddress The LBA address in 48-bit mode\r
+\r
+  @retval  EFI_SUCCESS Reading succeed\r
+  @retval  EFI_DEVICE_ERROR Error executing commands on this device\r
+\r
+**/\r
 EFI_STATUS\r
 AtaCommandIssueExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -2222,27 +1921,6 @@ AtaCommandIssueExt (
   IN  UINT16          SectorCount,\r
   IN  EFI_LBA         LbaAddress\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Send ATA Ext command into device with NON_DATA protocol\r
-\r
-Arguments:\r
-\r
-  IdeDev      - Standard IDE device private data structure\r
-  AtaCommand  - The ATA command to be sent\r
-  Device      - The value in Device register\r
-  Feature     - The value in Feature register\r
-  SectorCount - The value in SectorCount register \r
-  LbaAddress - The LBA address in 48-bit mode\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS      - Reading succeed\r
-  EFI_DEVICE_ERROR - Error executing commands on this device \r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT8       SectorCount8;\r
@@ -2332,6 +2010,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Send ATA Ext command into device with NON_DATA protocol\r
+\r
+  @param  IdeDev Standard IDE device private data structure\r
+  @param  AtaCommand The ATA command to be sent\r
+  @param  Device The value in Device register\r
+  @param  Feature The value in Feature register\r
+  @param  SectorCount The value in SectorCount register\r
+  @param  LbaAddress The LBA address in 48-bit mode\r
+\r
+  @retval  EFI_SUCCESS Reading succeed\r
+  @retval  EFI_DEVICE_ERROR Error executing commands on this device\r
+\r
+**/\r
 EFI_STATUS\r
 AtaCommandIssue (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -2341,27 +2033,6 @@ AtaCommandIssue (
   IN  UINT16          SectorCount,\r
   IN  EFI_LBA         LbaAddress\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Send ATA Ext command into device with NON_DATA protocol\r
-\r
-Arguments:\r
-\r
-  IdeDev      - Standard IDE device private data structure\r
-  AtaCommand  - The ATA command to be sent\r
-  Device      - The value in Device register\r
-  Feature     - The value in Feature register\r
-  SectorCount - The value in SectorCount register \r
-  LbaAddress - The LBA address in 48-bit mode\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS      - Reading succeed\r
-  EFI_DEVICE_ERROR - Error executing commands on this device \r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT8       SectorCount8;\r
@@ -2437,6 +2108,29 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoReadBlocks() to perform\r
+  reading from media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer A pointer to the destination buffer for the data. \r
+\r
+  @param[in] StartLba The starting logical block address to read from \r
+  on the device media.\r
+\r
+  @param[in] NumberOfBlocks The number of transfer data blocks.\r
+\r
+  @return The device status of UDMA operation. If the operation is\r
+  successful, return EFI_SUCCESS.\r
+\r
+  TODO:    EFI_UNSUPPORTED - add return value 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_DEVICE_ERROR - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 AtaUdmaReadExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -2444,49 +2138,6 @@ AtaUdmaReadExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaUdmaReadExt\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoReadBlocks() to perform\r
-        reading from media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the destination buffer for the data. \r
-\r
-        EFI_LBA     IN    StartLba\r
-          The starting logical block address to read from \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-\r
-        The device status of UDMA operation. If the operation is \r
-         successful, return EFI_SUCCESS.\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value 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_DEVICE_ERROR - add return value to function comment\r
 {\r
   IDE_DMA_PRD *PrdAddr;\r
   IDE_DMA_PRD *UsedPrdAddr;\r
@@ -2752,6 +2403,28 @@ AtaUdmaReadExt (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoReadBlocks() to perform\r
+  reading from media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer    A pointer to the destination buffer for the data. \r
+  @param[in] StartLba       The starting logical block address to read from \r
+  on the device media.\r
+  @param[in] NumberOfBlocks The number of transfer data blocks.\r
+\r
+  @return The device status of UDMA operation. If the operation is\r
+  successful, return EFI_SUCCESS.\r
+\r
+  TODO:    EFI_UNSUPPORTED - add return value 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_DEVICE_ERROR - add return value to function comment\r
+**/\r
 EFI_STATUS\r
 AtaUdmaRead (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -2759,49 +2432,6 @@ AtaUdmaRead (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaUdmaRead\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoReadBlocks() to perform\r
-        reading from media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the destination buffer for the data. \r
-\r
-        EFI_LBA     IN    StartLba\r
-          The starting logical block address to read from \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-\r
-        The device status of UDMA operation. If the operation is \r
-         successful, return EFI_SUCCESS.\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value 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_DEVICE_ERROR - add return value to function comment\r
 {\r
   IDE_DMA_PRD *PrdAddr;\r
   IDE_DMA_PRD *UsedPrdAddr;\r
@@ -3066,6 +2696,28 @@ AtaUdmaRead (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoWriteBlocks() to perform\r
+  writing to media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer A pointer to the source buffer for the data. \r
+\r
+  @param[in] StartLba The starting logical block address to write to \r
+  on the device media.\r
+\r
+  @param[in] NumberOfBlocks The number of transfer data blocks.\r
+\r
+  @return The device status of UDMA operation. If the operation is\r
+  successful, return EFI_SUCCESS.\r
+\r
+  TODO:    EFI_UNSUPPORTED - add return value 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
+**/\r
 EFI_STATUS\r
 AtaUdmaWriteExt (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -3073,48 +2725,6 @@ AtaUdmaWriteExt (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaUdmaWriteExt\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoWriteBlocks() to perform\r
-        writing to media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the source buffer for the data. \r
-\r
-        EFI_LBA     IN    StartLba\r
-          The starting logical block address to write to \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-\r
-        The device status of UDMA operation. If the operation is \r
-         successful, return EFI_SUCCESS.\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value 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
 {\r
   IDE_DMA_PRD *PrdAddr;\r
   IDE_DMA_PRD *UsedPrdAddr;\r
@@ -3377,6 +2987,32 @@ AtaUdmaWriteExt (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  This function is called by the AtaBlkIoWriteBlocks() to perform\r
+  writing to media in block unit. The function has been enhanced to \r
+  support >120GB access and transfer at most 65536 blocks per command\r
+\r
+  @param[in] *IdeDev\r
+  pointer pointing to IDE_BLK_IO_DEV data structure, used\r
+  to record all the information of the IDE device.\r
+\r
+  @param[in] *DataBuffer\r
+  A pointer to the source buffer for the data. \r
+\r
+  @param[in] StartLba\r
+  The starting logical block address to write to \r
+  on the device media.\r
+\r
+  @param[in] NumberOfBlocks\r
+  The number of transfer data blocks.\r
+\r
+  @return The device status of UDMA operation. If the operation is\r
+  successful, return EFI_SUCCESS.\r
+\r
+  TODO:    EFI_UNSUPPORTED - add return value 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
+**/\r
 EFI_STATUS\r
 AtaUdmaWrite (\r
   IN  IDE_BLK_IO_DEV  *IdeDev,\r
@@ -3384,48 +3020,6 @@ AtaUdmaWrite (
   IN  EFI_LBA         StartLba,\r
   IN  UINTN           NumberOfBlocks\r
   )\r
-/*++\r
-  Name:\r
-  \r
-        AtaUdmaWrite\r
-\r
-  Purpose: \r
-  \r
-        This function is called by the AtaBlkIoWriteBlocks() to perform\r
-        writing to media in block unit. The function has been enhanced to \r
-        support >120GB access and transfer at most 65536 blocks per command\r
-\r
-  Parameters:\r
-  \r
-        IDE_BLK_IO_DEV  IN    *IdeDev\r
-          pointer pointing to IDE_BLK_IO_DEV data structure, used\r
-          to record all the information of the IDE device.\r
-\r
-        VOID      IN    *DataBuffer\r
-          A pointer to the source buffer for the data. \r
-\r
-        EFI_LBA     IN    StartLba\r
-          The starting logical block address to write to \r
-          on the device media.\r
-\r
-        UINTN     IN    NumberOfBlocks\r
-          The number of transfer data blocks.\r
-\r
-  Returns:  \r
-\r
-        The device status of UDMA operation. If the operation is \r
-         successful, return EFI_SUCCESS.\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO:    IdeDev - add argument and description to function comment\r
-// TODO:    DataBuffer - add argument and description to function comment\r
-// TODO:    StartLba - add argument and description to function comment\r
-// TODO:    NumberOfBlocks - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value 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
 {\r
   IDE_DMA_PRD *PrdAddr;\r
   IDE_DMA_PRD *UsedPrdAddr;\r