]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add doxygen style comments for functions in Partition & Disk IO modules.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 May 2008 04:17:44 +0000 (04:17 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 May 2008 04:17:44 +0000 (04:17 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5182 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h

index 57a05847828899a93184bb78b8c928e2baac0313..5223ae7b905d5e1f8a17a9876ea1b50e61b558e6 100644 (file)
@@ -53,6 +53,19 @@ extern EFI_COMPONENT_NAME2_PROTOCOL  gDiskIoComponentName2;
 // Prototypes\r
 // Driver model protocol interface\r
 //\r
+/**\r
+  Test to see if this driver supports ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+  @retval other               This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoDriverBindingSupported (\r
@@ -61,6 +74,20 @@ DiskIoDriverBindingSupported (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening a Block IO protocol and\r
+  installing a Disk IO protocol on ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoDriverBindingStart (\r
@@ -69,6 +96,20 @@ DiskIoDriverBindingStart (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle by removing Disk IO protocol and closing\r
+  the Block IO protocol on ControllerHandle.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoDriverBindingStop (\r
@@ -81,6 +122,29 @@ DiskIoDriverBindingStop (
 //\r
 // Disk I/O Protocol Interface\r
 //\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+  Reads may support reads that are not aligned on\r
+  sector boundaries. There are three cases:\r
+    UnderRun - The first byte is not on a sector boundary or the read request is\r
+               less than a sector in length.\r
+    Aligned  - A read of N contiguous sectors.\r
+    OverRun  - The last byte is not on a sector boundary.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  MediaId               Id of the media, changes every time the media is replaced.\r
+  @param  Offset                The starting byte offset to read from\r
+  @param  BufferSize            Size of Buffer\r
+  @param  Buffer                Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoReadDisk (\r
@@ -91,6 +155,31 @@ DiskIoReadDisk (
   OUT VOID                 *Buffer\r
   );\r
 \r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+  Writes may require a read modify write to support writes that are not\r
+  aligned on sector boundaries. There are three cases:\r
+    UnderRun - The first byte is not on a sector boundary or the write request\r
+               is less than a sector in length. Read modify write is required.\r
+    Aligned  - A write of N contiguous sectors.\r
+    OverRun  - The last byte is not on a sector boundary. Read modified write\r
+               required.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Offset     The starting byte offset to read from\r
+  @param  BufferSize Size of Buffer\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
+                                 valid for the device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DiskIoWriteDisk (\r
index 56245ec7ae839f4da5e9350bdc05a392248a8d6c..ef3c766e536ecfcdf0cab564965e6d417a5e5808 100644 (file)
@@ -17,6 +17,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Partition.h"\r
 \r
 \r
+/**\r
+  Install child handles if the Handle supports GPT partition structure.\r
+\r
+  @param[in]  BlockIo     Parent BlockIo interface\r
+  @param[in]  DiskIo      Disk Io protocol.\r
+  @param[in]  Lba         The starting Lba of the Partition Table\r
+  @param[out] PartHeader  Stores the partition table that is read\r
+\r
+  @retval TRUE      The partition table is valid\r
+  @retval FALSE     The partition table is not valid\r
+\r
+**/\r
 BOOLEAN\r
 PartitionValidGptTable (\r
   IN  EFI_BLOCK_IO_PROTOCOL       *BlockIo,\r
@@ -26,6 +38,18 @@ PartitionValidGptTable (
   );\r
 \r
 \r
+/**\r
+  Check if the CRC field in the Partition table header is valid\r
+  for Partition entry array.\r
+\r
+  @param[in]  BlockIo     Parent BlockIo interface\r
+  @param[in]  DiskIo      Disk Io Protocol.\r
+  @param[in]  PartHeader  Partition table header structure\r
+\r
+  @retval TRUE      the CRC is valid\r
+  @retval FALSE     the CRC is invalid\r
+\r
+**/\r
 BOOLEAN\r
 PartitionCheckGptEntryArrayCRC (\r
   IN  EFI_BLOCK_IO_PROTOCOL       *BlockIo,\r
@@ -34,6 +58,18 @@ PartitionCheckGptEntryArrayCRC (
   );\r
 \r
 \r
+/**\r
+  Restore Partition Table to its alternate place\r
+  (Primary -> Backup or Backup -> Primary)\r
+\r
+  @param[in]  BlockIo     Parent BlockIo interface\r
+  @param[in]  DiskIo      Disk Io Protocol.\r
+  @param[in]  PartHeader  Partition table header structure\r
+\r
+  @retval TRUE      Restoring succeeds\r
+  @retval FALSE     Restoring failed\r
+\r
+**/\r
 BOOLEAN\r
 PartitionRestoreGptTable (\r
   IN  EFI_BLOCK_IO_PROTOCOL       *BlockIo,\r
@@ -42,6 +78,16 @@ PartitionRestoreGptTable (
   );\r
 \r
 \r
+/**\r
+  Restore Partition Table to its alternate place\r
+  (Primary -> Backup or Backup -> Primary)\r
+\r
+  @param[in]    PartHeader    Partition table header structure\r
+  @param[in]    PartEntry     The partition entry array\r
+  @param[out]   PEntryStatus  the partition entry status array \r
+                              recording the status of each partition\r
+\r
+**/\r
 VOID\r
 PartitionCheckGptEntry (\r
   IN  EFI_PARTITION_TABLE_HEADER  *PartHeader,\r
@@ -50,6 +96,17 @@ PartitionCheckGptEntry (
   );\r
 \r
 \r
+/**\r
+  Checks the CRC32 value in the table header\r
+\r
+  @param  MaxSize   Max Size limit\r
+  @param  Size      The size of the table\r
+  @param  Hdr       Table to check\r
+\r
+  @return TRUE    CRC Valid\r
+  @return FALSE   CRC Invalid\r
+\r
+**/\r
 BOOLEAN\r
 PartitionCheckCrcAltSize (\r
   IN UINTN                 MaxSize,\r
@@ -58,6 +115,16 @@ PartitionCheckCrcAltSize (
   );\r
 \r
 \r
+/**\r
+  Checks the CRC32 value in the table header\r
+\r
+  @param  MaxSize   Max Size limit\r
+  @param  Hdr       Table to check\r
+\r
+  @return TRUE      CRC Valid\r
+  @return FALSE     CRC Invalid\r
+\r
+**/\r
 BOOLEAN\r
 PartitionCheckCrc (\r
   IN UINTN                 MaxSize,\r
@@ -65,6 +132,13 @@ PartitionCheckCrc (
   );\r
 \r
 \r
+/**\r
+  Updates the CRC32 value in the table header\r
+\r
+  @param  Size   The size of the table\r
+  @param  Hdr    Table to update\r
+\r
+**/\r
 VOID\r
 PartitionSetCrcAltSize (\r
   IN UINTN                 Size,\r
@@ -72,6 +146,12 @@ PartitionSetCrcAltSize (
   );\r
 \r
 \r
+/**\r
+  Updates the CRC32 value in the table header\r
+\r
+  @param  Hdr    Table to update\r
+\r
+**/\r
 VOID\r
 PartitionSetCrc (\r
   IN OUT EFI_TABLE_HEADER *Hdr\r
@@ -325,7 +405,7 @@ Done:
   @param[in]  BlockIo     Parent BlockIo interface\r
   @param[in]  DiskIo      Disk Io protocol.\r
   @param[in]  Lba         The starting Lba of the Partition Table\r
-  @param[in]  PartHeader  Stores the partition table that is read\r
+  @param[out] PartHeader  Stores the partition table that is read\r
 \r
   @retval TRUE      The partition table is valid\r
   @retval FALSE     The partition table is not valid\r
@@ -546,6 +626,7 @@ Done:
   @param[in]    PartEntry     The partition entry array\r
   @param[out]   PEntryStatus  the partition entry status array \r
                               recording the status of each partition\r
+\r
 **/\r
 VOID\r
 PartitionCheckGptEntry (\r
@@ -602,7 +683,7 @@ PartitionCheckGptEntry (
 /**\r
   Updates the CRC32 value in the table header\r
 \r
-  @param[in,out]  Hdr    Table to update\r
+  @param  Hdr    Table to update\r
 \r
 **/\r
 VOID\r
@@ -617,8 +698,8 @@ PartitionSetCrc (
 /**\r
   Updates the CRC32 value in the table header\r
 \r
-  @param[in]      Size   The size of the table\r
-  @param[in,out]  Hdr    Table to update\r
+  @param  Size   The size of the table\r
+  @param  Hdr    Table to update\r
 \r
 **/\r
 VOID\r
@@ -639,11 +720,11 @@ PartitionSetCrcAltSize (
 /**\r
   Checks the CRC32 value in the table header\r
 \r
-  @param[in]      MaxSize   Max Size limit\r
-  @param[in,out]  Hdr       Table to check\r
+  @param  MaxSize   Max Size limit\r
+  @param  Hdr       Table to check\r
 \r
-  @return TRUE    CRC Valid\r
-  @return FALSE   CRC Invalid\r
+  @return TRUE      CRC Valid\r
+  @return FALSE     CRC Invalid\r
 \r
 **/\r
 BOOLEAN\r
@@ -659,9 +740,9 @@ PartitionCheckCrc (
 /**\r
   Checks the CRC32 value in the table header\r
 \r
-  @param[in]      MaxSize   Max Size limit\r
-  @param[in]      Size      The size of the table\r
-  @param[in,out]  Hdr       Table to check\r
+  @param  MaxSize   Max Size limit\r
+  @param  Size      The size of the table\r
+  @param  Hdr       Table to check\r
 \r
   @return TRUE    CRC Valid\r
   @return FALSE   CRC Invalid\r
index be63a7e23486a54cea72b2fa4150ee560ef749e6..c95a866e7587ce5612fb2f91669fc305178b1a8b 100644 (file)
@@ -24,26 +24,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Partition.h"\r
 \r
+/**\r
+  Test to see if the Mbr buffer is a valid MBR.\r
+\r
+  @param  Mbr         Parent Handle.\r
+  @param  LastLba     Last Lba address on the device.\r
+   \r
+  @retval TRUE        Mbr is a Valid MBR.\r
+  @retval FALSE       Mbr is not a Valid MBR.\r
+\r
+**/\r
 STATIC\r
 BOOLEAN\r
 PartitionValidMbr (\r
   IN  MASTER_BOOT_RECORD      *Mbr,\r
   IN  EFI_LBA                 LastLba\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Test to see if the Mbr buffer is a valid MBR\r
-\r
-Arguments:       \r
-  Mbr     - Parent Handle \r
-  LastLba - Last Lba address on the device.\r
-\r
-Returns:\r
-  TRUE  - Mbr is a Valid MBR\r
-  FALSE - Mbr is not a Valid MBR\r
-\r
---*/\r
 {\r
   UINT32  StartingLBA;\r
   UINT32  EndingLBA;\r
@@ -102,6 +98,21 @@ Returns:
   return MbrValid;\r
 }\r
 \r
+\r
+/**\r
+  Install child handles if the Handle supports MBR format.\r
+\r
+  @param  This              Calling context.\r
+  @param  Handle            Parent Handle.\r
+  @param  DiskIo            Parent DiskIo interface.\r
+  @param  BlockIo           Parent BlockIo interface.\r
+  @param  DevicePath        Parent Device Path.\r
+   \r
+  @retval EFI_SUCCESS       A child handle was added.\r
+  @retval EFI_MEDIA_CHANGED Media change was detected.\r
+  @retval Others            MBR partition was not found.\r
+\r
+**/\r
 EFI_STATUS\r
 PartitionInstallMbrChildHandles (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -110,24 +121,6 @@ PartitionInstallMbrChildHandles (
   IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,\r
   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Install child handles if the Handle supports MBR format.\r
-\r
-Arguments:       \r
-  This       - Calling context.\r
-  Handle     - Parent Handle \r
-  DiskIo     - Parent DiskIo interface\r
-  BlockIo    - Parent BlockIo interface\r
-  DevicePath - Parent Device Path\r
-\r
-Returns:\r
-  EFI_SUCCESS       - If a child handle was added\r
-  EFI_MEDIA_CHANGED - Media changed Detected\r
-       !EFI_SUCCESS      - Not found MBR partition.\r
-\r
---*/\r
 {\r
   EFI_STATUS                Status;\r
   MASTER_BOOT_RECORD        *Mbr;\r
index 4ece475d98ecd930b6891cd32fc1144eb65feb5b..66fa9507f3202d8730c7fd61a2f22a952763a083 100644 (file)
@@ -555,8 +555,7 @@ PartitionFlushBlocks (
   Create a child handle for a logical block device that represents the\r
   bytes Start to End of the Parent Block IO device.\r
 \r
-  @param[in]  This              Protocol instance pointer.\r
-  @param[in]  This              Calling context.\r
+  @param[in]  This              Protocol instance pointer\r
   @param[in]  ParentHandle      Parent Handle for new child\r
   @param[in]  ParentDiskIo      Parent DiskIo interface\r
   @param[in]  ParentBlockIo     Parent BlockIo interface\r
index 41307629a80b8d9f642d6d09d7f3dca7ef6e8ba3..9d6477cc3a09859e9b04306810e032e267880d84 100644 (file)
@@ -88,6 +88,20 @@ extern EFI_COMPONENT_NAME2_PROTOCOL  gPartitionComponentName2;
 //\r
 // Function Prototypes\r
 //\r
+/**\r
+  Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
+  than contains a BlockIo and DiskIo protocol can be supported.\r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+  @retval other               This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PartitionDriverBindingSupported (\r
@@ -96,6 +110,21 @@ PartitionDriverBindingSupported (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening a Block IO and Disk IO\r
+  protocol, reading Device Path, and creating a child handle with a\r
+  Disk IO and device path protocol.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PartitionDriverBindingStart (\r
@@ -104,6 +133,20 @@ PartitionDriverBindingStart (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  created by this driver.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PartitionDriverBindingStop (\r
@@ -243,6 +286,25 @@ PartitionComponentNameGetControllerName (
   );\r
 \r
 \r
+/**\r
+  Create a child handle for a logical block device that represents the\r
+  bytes Start to End of the Parent Block IO device.\r
+\r
+  @param[in]  This              Protocol instance pointer\r
+  @param[in]  ParentHandle      Parent Handle for new child\r
+  @param[in]  ParentDiskIo      Parent DiskIo interface\r
+  @param[in]  ParentBlockIo     Parent BlockIo interface\r
+  @param[in]  ParentDevicePath  Parent Device Path\r
+  @param[in]  DevicePathNode    Child Device Path node\r
+  @param[in]  Start             Start Block\r
+  @param[in]  End               End Block\r
+  @param[in]  BlockSize         Child block size\r
+  @param[in]  InstallEspGuid    Flag to install EFI System Partition GUID on handle\r
+\r
+  @retval EFI_SUCCESS       A child handle was added\r
+  @retval other             A child handle was not added\r
+\r
+**/\r
 EFI_STATUS\r
 PartitionInstallChildHandle (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -258,6 +320,20 @@ PartitionInstallChildHandle (
   )\r
 ;\r
 \r
+/**\r
+  Install child handles if the Handle supports GPT partition structure.\r
+\r
+  @param[in]  This       - Calling context.\r
+  @param[in]  Handle     - Parent Handle\r
+  @param[in]  DiskIo     - Parent DiskIo interface\r
+  @param[in]  BlockIo    - Parent BlockIo interface\r
+  @param[in]  DevicePath - Parent Device Path\r
+\r
+  @retval EFI_SUCCESS         Valid GPT disk\r
+  @retval EFI_MEDIA_CHANGED   Media changed Detected\r
+  @retval other               Not a valid GPT disk\r
+\r
+**/\r
 EFI_STATUS\r
 PartitionInstallGptChildHandles (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -268,6 +344,21 @@ PartitionInstallGptChildHandles (
   )\r
 ;\r
 \r
+/**\r
+  Install child handles if the Handle supports El Torito format.\r
+\r
+  @param[in]  This        Calling context.\r
+  @param[in]  Handle      Parent Handle\r
+  @param[in]  DiskIo      Parent DiskIo interface\r
+  @param[in]  BlockIo     Parent BlockIo interface\r
+  @param[in]  DevicePath  Parent Device Path\r
+\r
+\r
+  @retval EFI_SUCCESS         Child handle(s) was added\r
+  @retval EFI_MEDIA_CHANGED   Media changed Detected\r
+  @retval other               no child handle was added\r
+\r
+**/\r
 EFI_STATUS\r
 PartitionInstallElToritoChildHandles (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -278,6 +369,20 @@ PartitionInstallElToritoChildHandles (
   )\r
 ;\r
 \r
+/**\r
+  Install child handles if the Handle supports MBR format.\r
+\r
+  @param  This              Calling context.\r
+  @param  Handle            Parent Handle.\r
+  @param  DiskIo            Parent DiskIo interface.\r
+  @param  BlockIo           Parent BlockIo interface.\r
+  @param  DevicePath        Parent Device Path.\r
+   \r
+  @retval EFI_SUCCESS       A child handle was added.\r
+  @retval EFI_MEDIA_CHANGED Media change was detected.\r
+  @retval Others            MBR partition was not found.\r
+\r
+**/\r
 EFI_STATUS\r
 PartitionInstallMbrChildHandles (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r