]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for DevicePathDxe driver.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jul 2008 01:10:45 +0000 (01:10 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jul 2008 01:10:45 +0000 (01:10 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5479 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
MdeModulePkg/Universal/DevicePathDxe/DevicePathUtilities.c

index 3149184a34584abb1555b7856bc75a16fe9e9807..660b595de5e4207ac5781a2605964161e87d953a 100644 (file)
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 EFI_HANDLE  mDevicePathHandle = NULL;\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r
   GetDevicePathSizeProtocolInterface,\r
   DuplicateDevicePathProtocolInterface,\r
   AppendDevicePathProtocolInterface,\r
@@ -28,42 +28,43 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePa
   CreateDeviceNodeProtocolInterface\r
 };\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL   mDevicePathToText = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL   mDevicePathToText = {\r
   ConvertDeviceNodeToText,\r
   ConvertDevicePathToText\r
 };\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r
-  ConvertTextToDeviceNode,  \r
-  ConvertTextToDevicePath  \r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r
+  ConvertTextToDeviceNode,\r
+  ConvertTextToDevicePath\r
 };\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid             = DEVICE_PATH_MESSAGING_SAS;\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingSASGuid             = DEVICE_PATH_MESSAGING_SAS;\r
 \r
+\r
+\r
+/**\r
+  The user Entry Point for DevicePath module.\r
+\r
+  This is the entrhy point for DevicePath module. It installs the UEFI Device Path Utility Protocol and\r
+  optionall the Device Path to Text and Device Path from Text protocols based on feature flags.\r
+\r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param[in] SystemTable    A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+  @retval Others            Some error occurs when executing this entry point.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DevicePathEntryPoint (\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Entry point for EFI drivers.\r
-\r
-  Arguments:\r
-   ImageHandle - EFI_HANDLE\r
-   SystemTable - EFI_SYSTEM_TABLE\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    others\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
\r
+\r
   Status = EFI_UNSUPPORTED;\r
   if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r
     if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
index 7cd0626b90e8a77e2e36746aa7e7ab2f9f73a691..073f9b99597a75b15d4aa137afda1a3aaa169570 100644 (file)
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _DEVICE_PATH_DRIVER_H\r
-#define _DEVICE_PATH_DRIVER_H\r
+#ifndef _DEVICE_PATH_DRIVER_H_\r
+#define _DEVICE_PATH_DRIVER_H_\r
 \r
 #include <PiDxe.h>\r
 #include <Protocol/DevicePathUtilities.h>\r
@@ -51,7 +51,7 @@ extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
 #define DEVICE_PATH_INSTANCE_END   2\r
 #define DEVICE_PATH_END            3\r
 \r
-#define SetDevicePathInstanceEndNode(a) {                \\r
+#define SET_DEVICE_PATH_INSTANCE_END_NODE(a) {                \\r
     (a)->Type       = END_DEVICE_PATH_TYPE;              \\r
     (a)->SubType    = END_INSTANCE_DEVICE_PATH_SUBTYPE;  \\r
     (a)->Length[0]  = sizeof (EFI_DEVICE_PATH_PROTOCOL); \\r
@@ -67,6 +67,12 @@ typedef struct {
   UINTN   MaxLen;\r
 } POOL_PRINT;\r
 \r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL  *\r
+(*DUMP_NODE) (\r
+  IN  CHAR16 *DeviceNodeStr\r
+  );\r
+\r
 typedef struct {\r
   UINT8   Type;\r
   UINT8   SubType;\r
@@ -75,7 +81,7 @@ typedef struct {
 \r
 typedef struct {\r
   CHAR16                    *DevicePathNodeText;\r
-  EFI_DEVICE_PATH_PROTOCOL  * (*Function) (CHAR16 *);\r
+  DUMP_NODE                 Function;\r
 } DEVICE_PATH_FROM_TEXT_TABLE;\r
 \r
 typedef struct {\r
@@ -148,273 +154,279 @@ typedef struct {
 \r
 #pragma pack()\r
 \r
+/**\r
+  Converts a device node to its string representation.\r
+\r
+  @param DeviceNode        A Pointer to the device node to be converted.\r
+  @param DisplayOnly       If DisplayOnly is TRUE, then the shorter text representation\r
+                           of the display node is used, where applicable. If DisplayOnly\r
+                           is FALSE, then the longer text representation of the display node\r
+                           is used.\r
+  @param AllowShortcuts    If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                           representation for a device node can be used, where applicable.\r
+\r
+  @return A pointer to the allocated text representation of the device node or NULL if DeviceNode\r
+          is NULL or there was insufficient memory.\r
+\r
+**/\r
 CHAR16 *\r
+EFIAPI\r
 ConvertDeviceNodeToText (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DeviceNode,\r
   IN BOOLEAN                         DisplayOnly,\r
   IN BOOLEAN                         AllowShortcuts\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Convert a device node to its text representation.\r
+/**\r
+  Converts a device path to its text representation.\r
 \r
-  Arguments:\r
-    DeviceNode       -   Points to the device node to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
+  @param DevicePath      A Pointer to the device to be converted.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
                          is FALSE, then the longer text representation of the display node\r
                          is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
                          representation for a device node can be used, where applicable.\r
 \r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device node.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
-\r
---*/\r
-;\r
+  @return A pointer to the allocated text representation of the device path or\r
+          NULL if DeviceNode is NULL or there was insufficient memory.\r
 \r
+**/\r
 CHAR16 *\r
+EFIAPI\r
 ConvertDevicePathToText (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DeviceNode,\r
-  IN BOOLEAN                         DisplayOnly,\r
-  IN BOOLEAN                         AllowShortcuts\r
-  )\r
-/*++\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  );\r
 \r
-  Routine Description:\r
-    Convert a device path to its text representation.\r
+/**\r
+  Convert text to the binary representation of a device node.\r
 \r
-  Arguments:\r
-    DeviceNode       -   Points to the device path to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
-                         of the display node is used, where applicable. If DisplayOnly\r
-                         is FALSE, then the longer text representation of the display node\r
-                         is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
-                         representation for a device node can be used, where applicable.\r
-\r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device path.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
+  @param TextDeviceNode  TextDeviceNode points to the text representation of a device\r
+                         node. Conversion starts with the first character and continues\r
+                         until the first non-device node character.\r
 \r
---*/\r
-;\r
+  @return A pointer to the EFI device node or NULL if TextDeviceNode is NULL or there was\r
+          insufficient memory or text unsupported.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 ConvertTextToDeviceNode (\r
   IN CONST CHAR16 *TextDeviceNode\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Convert text to the binary representation of a device node.\r
+/**\r
+  Convert text to the binary representation of a device path.\r
 \r
-  Arguments:\r
-    TextDeviceNode   -   TextDeviceNode points to the text representation of a device\r
-                         node. Conversion starts with the first character and continues\r
-                         until the first non-device node character.\r
 \r
-  Returns:\r
-    A pointer        -   Pointer to the EFI device node.\r
-    NULL             -   if TextDeviceNode is NULL or there was insufficient memory.\r
+  @param TextDevicePath  TextDevicePath points to the text representation of a device\r
+                         path. Conversion starts with the first character and continues\r
+                         until the first non-device node character.\r
 \r
---*/\r
-;\r
+  @return A pointer to the allocated device path or NULL if TextDeviceNode is NULL or\r
+          there was insufficient memory.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 ConvertTextToDevicePath (\r
   IN CONST CHAR16 *TextDevicePath\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Convert text to the binary representation of a device path.\r
+/**\r
+  Returns the size of a device path in bytes.\r
 \r
-  Arguments:\r
-    TextDevicePath   -   TextDevicePath points to the text representation of a device\r
-                         path. Conversion starts with the first character and continues\r
-                         until the first non-device node character.\r
+  This function returns the size, in bytes, of the device path data structure specified by\r
+  DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
 \r
-  Returns:\r
-    A pointer        -   Pointer to the allocated device path.\r
-    NULL             -   if TextDeviceNode is NULL or there was insufficient memory.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
---*/\r
-;\r
+  @return The size of a device path in bytes.\r
 \r
+**/\r
 UINTN\r
+EFIAPI\r
 GetDevicePathSizeProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Returns the size of the device path, in bytes.\r
+/**\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the start of the EFI device path.\r
+  This function allocates space for a new copy of the device path specified by DevicePath.  If\r
+  DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
+  contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+  is returned.  Otherwise, NULL is returned.\r
 \r
-  Returns:\r
-    Size        -   Size of the specified device path, in bytes, including the end-of-path tag.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
---*/\r
-;\r
+  @return A pointer to the duplicated device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 DuplicateDevicePathProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Create a duplicate of the specified path.\r
+/**\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the source EFI device path.\r
+  This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+  FirstDevicePath in a newly allocated buffer.  Only the end-of-device-path device node from\r
+  SecondDevicePath is retained. The newly created device path is returned.\r
+  If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.\r
+  If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.\r
+  If both FirstDevicePath and SecondDevicePath are NULL, then a copy of an end-of-device-path is\r
+  returned.\r
+  If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the\r
+  responsibility of the caller to free the memory allocated.\r
 \r
-  Returns:\r
-    Pointer     -   A pointer to the duplicate device path.\r
-    NULL        -   Insufficient memory.\r
+  @param  FirstDevicePath            A pointer to a device path data structure.\r
+  @param  SecondDevicePath           A pointer to a device path data structure.\r
 \r
---*/\r
-;\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDevicePathProtocolInterface (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Create a new path by appending the second device path to the first.\r
-\r
-  Arguments:\r
-    Src1      -   Points to the first device path. If NULL, then it is ignored.\r
-    Src2      -   Points to the second device path. If NULL, then it is ignored.\r
-\r
-  Returns:\r
-    Pointer   -   A pointer to the newly created device path.\r
-    NULL      -   Memory could not be allocated\r
-                  or either DevicePath or DeviceNode is NULL.\r
-\r
---*/\r
-;\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath\r
+  );\r
+\r
+/**\r
+  Creates a new path by appending the device node to the device path.\r
+\r
+  This function creates a new device path by appending a copy of the device node specified by\r
+  DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device node.\r
+  If DevicePathNode is NULL then a copy of DevicePath is returned.\r
+  If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device path device\r
+  node is returned.\r
+  If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path device node\r
+  is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathNode             A pointer to a single device path node.\r
+\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDeviceNodeProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
-  )\r
-/*++\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode\r
+  );\r
 \r
-  Routine Description:\r
-    Creates a new path by appending the device node to the device path.\r
+/**\r
+  Creates a new device path by appending the specified device path instance to the specified device\r
+  path.\r
 \r
-  Arguments:\r
-    DevicePath   -   Points to the device path.\r
-    DeviceNode   -   Points to the device node.\r
+  This function creates a new device path by appending a copy of the device path instance specified\r
+  by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device path instance\r
+  and a new end-of-device-path-instance node is inserted between.\r
+  If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+  If DevicePathInstance is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
 \r
-  Returns:\r
-    Pointer      -   A pointer to the allocated device node.\r
-    NULL         -   Memory could not be allocated\r
-                     or either DevicePath or DeviceNode is NULL.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathInstance         A pointer to a device path instance.\r
 \r
---*/\r
-;\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDevicePathInstanceProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Creates a new path by appending the specified device path instance to the specified device path.\r
-\r
-  Arguments:\r
-    DevicePath           -   Points to the device path. If NULL, then ignored.\r
-    DevicePathInstance   -   Points to the device path instance.\r
-\r
-  Returns:\r
-    Pointer              -   A pointer to the newly created device path\r
-    NULL                 -   Memory could not be allocated or DevicePathInstance is NULL.\r
-\r
---*/\r
-;\r
+  );\r
+\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a copy of the current device path instance. It also updates DevicePath to\r
+  point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+  to hold the size of the device path instance copy.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  If Size is NULL, then ASSERT().\r
+\r
+  @param  DevicePath                 On input, this holds the pointer to the current device path\r
+                                     instance. On output, this holds the pointer to the next device\r
+                                     path instance or NULL if there are no more device path\r
+                                     instances in the device path pointer to a device path data\r
+                                     structure.\r
+  @param  Size                       On output, this holds the size of the device path instance, in\r
+                                     bytes or zero, if DevicePath is NULL.\r
+\r
+  @return A pointer to the current device path instance.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 GetNextDevicePathInstanceProtocolInterface (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePathInstance,\r
-  OUT UINTN                         *DevicePathInstanceSize\r
-  )\r
-/*++\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePath,\r
+  OUT UINTN                         *Size\r
+  );\r
 \r
-  Routine Description:\r
-    Creates a copy of the current device path instance and returns a pointer to the next device path instance.\r
+/**\r
+  Determines if a device path is single or multi-instance.\r
 \r
-  Arguments:\r
-    DevicePathInstance       -   On input, this holds the pointer to the current device path\r
-                                 instance. On output, this holds the pointer to the next\r
-                                 device path instance or NULL if there are no more device\r
-                                 path instances in the device path.\r
-    DevicePathInstanceSize   -   On output, this holds the size of the device path instance,\r
-                                 in bytes or zero, if DevicePathInstance is zero.\r
+  This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+  Otherwise, FALSE is returned.  If DevicePath is NULL, then FALSE is returned.\r
 \r
-  Returns:\r
-    Pointer                  -   A pointer to the copy of the current device path instance.\r
-    NULL                     -   DevicePathInstace was NULL on entry or there was insufficient memory.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
---*/\r
-;\r
+  @retval  TRUE                      DevicePath is multi-instance.\r
+  @retval  FALSE                     DevicePath is not multi-instance or DevicePath is NULL.\r
 \r
+**/\r
 BOOLEAN\r
+EFIAPI\r
 IsDevicePathMultiInstanceProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
-  )\r
-/*++\r
+  );\r
 \r
-  Routine Description:\r
-    Returns whether a device path is multi-instance.\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the device path. If NULL, then ignored.\r
+  This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+  initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
+  is returned.\r
+  If NodeLength is smaller than a device path header, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
 \r
-  Returns:\r
-    TRUE        -   The device path has more than one instance\r
-    FALSE       -   The device path is empty or contains only a single instance.\r
+  @param  NodeType                   The device node type for the new device node.\r
+  @param  NodeSubType                The device node sub-type for the new device node.\r
+  @param  NodeLength                 The length of the new device node.\r
 \r
---*/\r
-;\r
+  @return The new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 CreateDeviceNodeProtocolInterface (\r
   IN UINT8  NodeType,\r
   IN UINT8  NodeSubType,\r
   IN UINT16 NodeLength\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Creates a device node\r
-\r
-  Arguments:\r
-    NodeType     -    NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
-                      the new device node.\r
-    NodeSubType  -    NodeSubType is the device node sub-type\r
-                      EFI_DEVICE_PATH.SubType) for the new device node.\r
-    NodeLength   -    NodeLength is the length of the device node\r
-                      (EFI_DEVICE_PATH.Length) for the new device node.\r
-\r
-  Returns:\r
-    Pointer      -    A pointer to the newly created device node.\r
-    NULL         -    NodeLength is less than\r
-                      the size of the header or there was insufficient memory.\r
-\r
---*/\r
-;\r
+  );\r
 \r
 #endif\r
index f6fe98eeb8204edb3195c1cbd8aa9f9177ad88cb..8036570b09fe1a2c22b1e5791a51f83e8360908e 100644 (file)
@@ -1,19 +1,19 @@
 #/** @file\r
-#  \r
+#\r
 #    Component description file for Device Path Driver.\r
-#  \r
+#\r
 #   This driver implement these three UEFI deveice path protocols (\r
 #    DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them.\r
-#  \r
+#\r
 #  Copyright (c) 2006 - 2008, Intel Corporation. <BR>\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
+#\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
+#\r
 #**/\r
 \r
 [Defines]\r
index 75e5cf8a32084ad3ea60ac6f67b938ede26be277..e183abbfe054d3ab51e7fda75f9a17fc052893b2 100644 (file)
@@ -14,54 +14,40 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "DevicePath.h"\r
 \r
-STATIC\r
-CHAR16 *\r
-StrDuplicate (\r
-  IN CONST CHAR16  *Src\r
-  )\r
-/*++\r
 \r
-  Routine Description:\r
-    Duplicate a string\r
+/**\r
 \r
-  Arguments:\r
-    Src - Source string\r
+  Duplicates a string.\r
 \r
-  Returns:\r
-    Duplicated string\r
+  @param  Src  Source string.\r
 \r
---*/\r
+  @return The duplicated string.\r
+\r
+**/\r
+CHAR16 *\r
+StrDuplicate (\r
+  IN CONST CHAR16  *Src\r
+  )\r
 {\r
-  UINTN   Length;\r
-  CHAR16  *ReturnStr;\r
+  return AllocateCopyPool (StrSize (Src), Src);\r
+}\r
 \r
-  Length = StrLen ((CHAR16 *) Src);\r
+/**\r
 \r
-  ReturnStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), (VOID *) Src);\r
+  Get parameter in a pair of parentheses follow the given node name.\r
+  For example, given the "Pci(0,1)" and NodeName "Pci", it returns "0,1".\r
 \r
-  return ReturnStr;\r
-}\r
+  @param  Str      Device Path Text.\r
+  @param  NodeName Name of the node.\r
 \r
-STATIC\r
+  @return Parameter text for the node.\r
+\r
+**/\r
 CHAR16 *\r
 GetParamByNodeName (\r
   IN CHAR16 *Str,\r
   IN CHAR16 *NodeName\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get parameter in a pair of parentheses follow the given node name.\r
-    For example, given the "Pci(0,1)" and NodeName "Pci", it returns "0,1".\r
-\r
-  Arguments:\r
-    Str      - Device Path Text\r
-    NodeName - Name of the node\r
-\r
-  Returns:\r
-    Parameter text for the node\r
-\r
---*/\r
 {\r
   CHAR16  *ParamStr;\r
   CHAR16  *StrPointer;\r
@@ -113,28 +99,23 @@ GetParamByNodeName (
   return ParamStr;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Gets current sub-string from a string list, before return\r
+  the list header is moved to next sub-string. The sub-string is separated\r
+  by the specified character. For example, the separator is ',', the string\r
+  list is "2,0,3", it returns "2", the remain list move to "0,3"\r
+\r
+  @param  List        A string list separated by the specified separator\r
+  @param  Separator   The separator character\r
+\r
+  @return A pointer to the current sub-string\r
+\r
+**/\r
 CHAR16 *\r
 SplitStr (\r
   IN OUT CHAR16 **List,\r
   IN     CHAR16 Separator\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get current sub-string from a string list, before return\r
-    the list header is moved to next sub-string. The sub-string is separated\r
-    by the specified character. For example, the separator is ',', the string\r
-    list is "2,0,3", it returns "2", the remain list move to "0,3"\r
-\r
-  Arguments:\r
-    List       - A string list separated by the specified separator\r
-    Separator  - The separator character\r
-\r
-  Returns:\r
-    pointer    - The current sub-string\r
-\r
---*/\r
 {\r
   CHAR16  *Str;\r
   CHAR16  *ReturnStr;\r
@@ -172,7 +153,14 @@ SplitStr (
   return ReturnStr;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Gets the next parameter string from the list.\r
+\r
+  @param List            A string list separated by the specified separator\r
+\r
+  @return A pointer to the current sub-string\r
+\r
+**/\r
 CHAR16 *\r
 GetNextParamStr (\r
   IN OUT CHAR16 **List\r
@@ -184,26 +172,20 @@ GetNextParamStr (
   return SplitStr (List, L',');\r
 }\r
 \r
-STATIC\r
+/**\r
+  Get one device node from entire device path text.\r
+\r
+  @param DevicePath      On input, the current Device Path node; on output, the next device path node\r
+  @param IsInstanceEnd   This node is the end of a device path instance\r
+\r
+  @return A device node text or NULL if no more device node available\r
+\r
+**/\r
 CHAR16 *\r
 GetNextDeviceNodeStr (\r
   IN OUT CHAR16   **DevicePath,\r
   OUT    BOOLEAN  *IsInstanceEnd\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get one device node from entire device path text.\r
-\r
-  Arguments:\r
-    Str           - The entire device path text string\r
-    IsInstanceEnd - This node is the end of a device path instance\r
-\r
-  Returns:\r
-    a pointer     - A device node text\r
-    NULL          - No more device node available\r
-\r
---*/\r
 {\r
   CHAR16  *Str;\r
   CHAR16  *ReturnStr;\r
@@ -272,43 +254,39 @@ GetNextDeviceNodeStr (
 }\r
 \r
 \r
-STATIC\r
+/**\r
+  Skip the leading white space and '0x' or '0X' of a integer string\r
+\r
+  @param Str             The integer string\r
+  @param IsHex           TRUE: Hex string, FALSE: Decimal string\r
+\r
+  @return The trimmed Hex string.\r
+\r
+**/\r
 CHAR16 *\r
 TrimHexStr (\r
   IN CHAR16   *Str,\r
   OUT BOOLEAN *IsHex\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Skip the leading white space and '0x' or '0X' of a integer string\r
-\r
-  Arguments:\r
-    Str   -  The integer string\r
-    IsHex -  1: Hex string,  0: Decimal string\r
-\r
-  Returns:\r
-\r
---*/\r
 {\r
   *IsHex = FALSE;\r
 \r
   //\r
   // skip preceeding white space\r
   //\r
-  while (*Str && *Str == ' ') {\r
+  while ((*Str != 0) && *Str == ' ') {\r
     Str += 1;\r
   }\r
   //\r
   // skip preceeding zeros\r
   //\r
-  while (*Str && *Str == '0') {\r
+  while ((*Str != 0) && *Str == '0') {\r
     Str += 1;\r
   }\r
   //\r
   // skip preceeding character 'x' or 'X'\r
   //\r
-  if (*Str && (*Str == 'x' || *Str == 'X')) {\r
+  if ((*Str != 0) && (*Str == 'x' || *Str == 'X')) {\r
     Str += 1;\r
     *IsHex = TRUE;\r
   }\r
@@ -316,24 +294,19 @@ TrimHexStr (
   return Str;\r
 }\r
 \r
-STATIC\r
-UINTN\r
-Xtoi (\r
-  IN CHAR16  *Str\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
-  Convert hex string to uint\r
+  Convert hex string to uint.\r
 \r
-Arguments:\r
+  @param Str             The hex string\r
 \r
-  Str  -  The string\r
-  \r
-Returns:\r
+  @return A UINTN value represented by Str\r
 \r
---*/\r
+**/\r
+UINTN\r
+Xtoi (\r
+  IN CHAR16  *Str\r
+  )\r
 {\r
   UINTN   Rvalue;\r
   UINTN   Length;\r
@@ -350,25 +323,19 @@ Returns:
   return Rvalue;\r
 }\r
 \r
-STATIC\r
-VOID\r
-Xtoi64 (\r
-  IN CHAR16  *Str,\r
-  IN UINT64  *Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Convert hex string to 64 bit data.\r
 \r
-Arguments:\r
-\r
-  Str  -  The string\r
-  \r
-Returns:\r
+  @param Str             The hex string\r
+  @param Data            A pointer to the UINT64 value represented by Str\r
 \r
---*/\r
+**/\r
+VOID\r
+Xtoi64 (\r
+  IN  CHAR16  *Str,\r
+  OUT UINT64  *Data\r
+  )\r
 {\r
   UINTN  Length;\r
 \r
@@ -377,46 +344,41 @@ Returns:
   HexStringToBuf ((UINT8 *) Data, &Length, Str, NULL);\r
 }\r
 \r
-STATIC\r
-UINTN\r
-Dtoi (\r
-  IN CHAR16  *str\r
-  )\r
-/*++\r
+/**\r
 \r
-Routine Description:\r
+  Convert decimal string to uint.\r
 \r
-  Convert decimal string to uint\r
+  @param Str             The decimal string\r
 \r
-Arguments:\r
+  @return A UINTN value represented by Str\r
 \r
-  Str  -  The string\r
-  \r
-Returns:\r
-\r
---*/\r
+**/\r
+UINTN\r
+Dtoi (\r
+  IN CHAR16  *Str\r
+  )\r
 {\r
   UINTN   Rvalue;\r
   CHAR16  Char;\r
   UINTN   High;\r
   UINTN   Low;\r
 \r
-  ASSERT (str != NULL);\r
+  ASSERT (Str != NULL);\r
 \r
   High = (UINTN) -1 / 10;\r
   Low  = (UINTN) -1 % 10;\r
   //\r
   // skip preceeding white space\r
   //\r
-  while (*str && *str == ' ') {\r
-    str += 1;\r
+  while ((*Str != 0) && *Str == ' ') {\r
+    Str += 1;\r
   }\r
   //\r
   // convert digits\r
   //\r
   Rvalue = 0;\r
-  Char = *(str++);\r
-  while (Char) {\r
+  Char = *(Str++);\r
+  while (Char != 0) {\r
     if (Char >= '0' && Char <= '9') {\r
       if ((Rvalue > High || Rvalue == High) && (Char - '0' > (INTN) Low)) {\r
         return (UINTN) -1;\r
@@ -427,52 +389,46 @@ Returns:
       break;\r
     }\r
 \r
-    Char = *(str++);\r
+    Char = *(Str++);\r
   }\r
 \r
   return Rvalue;\r
 }\r
 \r
-STATIC\r
+/**\r
+\r
+  Convert decimal string to uint.\r
+\r
+  @param Str             The decimal string\r
+  @param Data            A pointer to the UINT64 value represented by Str\r
+\r
+**/\r
 VOID\r
 Dtoi64 (\r
-  IN CHAR16  *str,\r
+  IN CHAR16  *Str,\r
   OUT UINT64 *Data\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert decimal string to uint\r
-\r
-Arguments:\r
-\r
-  Str  -  The string\r
-\r
-Returns:\r
-\r
---*/\r
 {\r
   UINT64   Rvalue;\r
   CHAR16   Char;\r
   UINT64   High;\r
   UINT64   Low;\r
 \r
-  ASSERT (str != NULL);\r
+  ASSERT (Str != NULL);\r
   ASSERT (Data != NULL);\r
 \r
   //\r
   // skip preceeding white space\r
   //\r
-  while (*str && *str == ' ') {\r
-    str += 1;\r
+  while ((*Str != 0) && *Str == ' ') {\r
+    Str += 1;\r
   }\r
   //\r
   // convert digits\r
   //\r
   Rvalue = 0;\r
-  Char = *(str++);\r
-  while (Char) {\r
+  Char = *(Str++);\r
+  while (Char != 0) {\r
     if (Char >= '0' && Char <= '9') {\r
       High = LShiftU64 (Rvalue, 3);\r
       Low = LShiftU64 (Rvalue, 1);\r
@@ -481,30 +437,25 @@ Returns:
       break;\r
     }\r
 \r
-    Char = *(str++);\r
+    Char = *(Str++);\r
   }\r
 \r
   *Data = Rvalue;\r
 }\r
 \r
-STATIC\r
-UINTN\r
-Strtoi (\r
-  IN CHAR16  *Str\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Convert integer string to uint.\r
 \r
-Arguments:\r
+  @param Str             The integer string. If leading with "0x" or "0X", it's heximal.\r
 \r
-  Str  -  The integer string. If leading with "0x" or "0X", it's heximal.\r
+  @return A UINTN value represented by Str\r
 \r
-Returns:\r
-\r
---*/\r
+**/\r
+UINTN\r
+Strtoi (\r
+  IN CHAR16  *Str\r
+  )\r
 {\r
   BOOLEAN IsHex;\r
 \r
@@ -517,25 +468,19 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-VOID\r
-Strtoi64 (\r
-  IN CHAR16  *Str,\r
-  IN UINT64  *Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Convert integer string to 64 bit data.\r
 \r
-Arguments:\r
-\r
-  Str  -  The integer string. If leading with "0x" or "0X", it's heximal.\r
-\r
-Returns:\r
+  @param Str             The integer string. If leading with "0x" or "0X", it's heximal.\r
+  @param Data            A pointer to the UINT64 value represented by Str\r
 \r
---*/\r
+**/\r
+VOID\r
+Strtoi64 (\r
+  IN  CHAR16  *Str,\r
+  OUT UINT64  *Data\r
+  )\r
 {\r
   BOOLEAN IsHex;\r
 \r
@@ -548,8 +493,17 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-EFI_STATUS \r
+/**\r
+  Converts a list of string to a specified buffer.\r
+\r
+  @param Buf             The output buffer that contains the string.\r
+  @param BufferLength    The length of the buffer\r
+  @param Str             The input string that contains the hex number\r
+\r
+  @retval EFI_SUCCESS    The string was successfully converted to the buffer.\r
+\r
+**/\r
+EFI_STATUS\r
 StrToBuf (\r
   OUT UINT8    *Buf,\r
   IN  UINTN    BufferLength,\r
@@ -590,7 +544,17 @@ StrToBuf (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a string to GUID value.\r
+\r
+  @param Str              The registry format GUID string that contains the GUID value.\r
+  @param Guid             A pointer to the converted GUID value.\r
+\r
+  @retval EFI_SUCCESS     The GUID string was successfully converted to the GUID value.\r
+  @retval EFI_UNSUPPORTED The input string is not in registry format.\r
+  @return others          Some error occurred when converting part of GUID value.\r
+\r
+**/\r
 EFI_STATUS\r
 StrToGuid (\r
   IN  CHAR16   *Str,\r
@@ -608,7 +572,7 @@ StrToGuid (
   }\r
   Str += ConvertedStrLen;\r
   if (IS_HYPHEN (*Str)) {\r
-    Str++;   \r
+    Str++;\r
   } else {\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -653,7 +617,13 @@ StrToGuid (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a string to IPv4 address\r
+\r
+  @param Str             A string representation of IPv4 address.\r
+  @param IPv4Addr        A pointer to the converted IPv4 address.\r
+\r
+**/\r
 VOID\r
 StrToIPv4Addr (\r
   IN OUT CHAR16           **Str,\r
@@ -667,7 +637,13 @@ StrToIPv4Addr (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a string to IPv4 address\r
+\r
+  @param Str             A string representation of IPv6 address.\r
+  @param IPv6Addr        A pointer to the converted IPv6 address.\r
+\r
+**/\r
 VOID\r
 StrToIPv6Addr (\r
   IN OUT CHAR16           **Str,\r
@@ -684,7 +660,14 @@ StrToIPv6Addr (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Unicode string to ASCII string.\r
+\r
+  @param Str             The equiventant Unicode string\r
+  @param AsciiStr        On input, it points to destination ASCII string buffer; on output, it points\r
+                         to the next ASCII string next to it\r
+\r
+**/\r
 VOID\r
 StrToAscii (\r
   IN     CHAR16 *Str,\r
@@ -705,7 +688,14 @@ StrToAscii (
   *AsciiStr = Dest + 1;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Hardware PCI device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to Hardware PCI device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextPci (\r
   IN CHAR16 *TextDeviceNode\r
@@ -729,7 +719,14 @@ DevPathFromTextPci (
   return (EFI_DEVICE_PATH_PROTOCOL *) Pci;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Hardware PC card device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to Hardware PC card device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextPcCard (\r
   IN CHAR16 *TextDeviceNode\r
@@ -750,7 +747,14 @@ DevPathFromTextPcCard (
   return (EFI_DEVICE_PATH_PROTOCOL *) Pccard;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Hardware memory map device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to Hardware memory map device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextMemoryMapped (\r
   IN CHAR16 *TextDeviceNode\r
@@ -777,7 +781,17 @@ DevPathFromTextMemoryMapped (
   return (EFI_DEVICE_PATH_PROTOCOL *) MemMap;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor device path structure based on the input Type\r
+  and SubType.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+  @param Type            The type of device path node.\r
+  @param SubType         The subtype of device path node.\r
+\r
+  @return A pointer to the newly-created Vendor device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 ConvertFromTextVendor (\r
   IN CHAR16 *TextDeviceNode,\r
@@ -811,7 +825,14 @@ ConvertFromTextVendor (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor Hardware device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor Hardware device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenHw (\r
   IN CHAR16 *TextDeviceNode\r
@@ -824,7 +845,14 @@ DevPathFromTextVenHw (
            );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Hardware Controller device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Hardware Controller device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextCtrl (\r
   IN CHAR16 *TextDeviceNode\r
@@ -844,7 +872,13 @@ DevPathFromTextCtrl (
   return (EFI_DEVICE_PATH_PROTOCOL *) Controller;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a string to EisaId.\r
+\r
+  @param Text   The input string.\r
+  @param EisaId A pointer to the output EisaId.\r
+\r
+**/\r
 VOID\r
 EisaIdFromText (\r
   IN CHAR16 *Text,\r
@@ -854,12 +888,20 @@ EisaIdFromText (
   UINTN PnpId;\r
 \r
   PnpId = Xtoi (Text + 3);\r
-  *EisaId = (((Text[0] - '@') & 0x1f) << 10) + \r
-            (((Text[1] - '@') & 0x1f) << 5) + \r
+  *EisaId = (((Text[0] - '@') & 0x1f) << 10) +\r
+            (((Text[1] - '@') & 0x1f) << 5) +\r
             ((Text[2] - '@') & 0x1f) +\r
             (UINT32) (PnpId << 16);\r
 }\r
 \r
+/**\r
+  Converts a text device path node to ACPI HID device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created ACPI HID device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextAcpi (\r
   IN CHAR16 *TextDeviceNode\r
@@ -883,7 +925,15 @@ DevPathFromTextAcpi (
   return (EFI_DEVICE_PATH_PROTOCOL *) Acpi;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to ACPI HID device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+  @param PnPId           The input plug and play identification.\r
+\r
+  @return A pointer to the newly-created ACPI HID device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 ConvertFromTextAcpi (\r
   IN CHAR16 *TextDeviceNode,\r
@@ -906,7 +956,14 @@ ConvertFromTextAcpi (
   return (EFI_DEVICE_PATH_PROTOCOL *) Acpi;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to PCI root device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created PCI root device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextPciRoot (\r
   IN CHAR16 *TextDeviceNode\r
@@ -915,7 +972,14 @@ DevPathFromTextPciRoot (
   return ConvertFromTextAcpi (TextDeviceNode, 0x0a03);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Floppy device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Floppy device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextFloppy (\r
   IN CHAR16 *TextDeviceNode\r
@@ -924,7 +988,14 @@ DevPathFromTextFloppy (
   return ConvertFromTextAcpi (TextDeviceNode, 0x0604);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Keyboard device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created  Keyboard device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextKeyboard (\r
   IN CHAR16 *TextDeviceNode\r
@@ -933,7 +1004,14 @@ DevPathFromTextKeyboard (
   return ConvertFromTextAcpi (TextDeviceNode, 0x0301);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Serial device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Serial device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextSerial (\r
   IN CHAR16 *TextDeviceNode\r
@@ -942,7 +1020,14 @@ DevPathFromTextSerial (
   return ConvertFromTextAcpi (TextDeviceNode, 0x0501);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Parallel Port device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Parallel Port device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextParallelPort (\r
   IN CHAR16 *TextDeviceNode\r
@@ -951,7 +1036,14 @@ DevPathFromTextParallelPort (
   return ConvertFromTextAcpi (TextDeviceNode, 0x0401);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to ACPI extention device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created ACPI extention device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextAcpiEx (\r
   IN CHAR16 *TextDeviceNode\r
@@ -995,7 +1087,14 @@ DevPathFromTextAcpiEx (
   return (EFI_DEVICE_PATH_PROTOCOL *) AcpiEx;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to ACPI extention device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created ACPI extention device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextAcpiExp (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1040,7 +1139,14 @@ DevPathFromTextAcpiExp (
   return (EFI_DEVICE_PATH_PROTOCOL *) AcpiEx;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Parallel Port device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Parallel Port device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextAta (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1068,7 +1174,14 @@ DevPathFromTextAta (
   return (EFI_DEVICE_PATH_PROTOCOL *) Atapi;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to SCSI device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created SCSI device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextScsi (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1092,7 +1205,14 @@ DevPathFromTextScsi (
   return (EFI_DEVICE_PATH_PROTOCOL *) Scsi;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Fibre device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Fibre device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextFibre (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1117,29 +1237,43 @@ DevPathFromTextFibre (
   return (EFI_DEVICE_PATH_PROTOCOL *) Fibre;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to 1394 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created 1394 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromText1394 (\r
   IN CHAR16 *TextDeviceNode\r
   )\r
 {\r
   CHAR16            *GuidStr;\r
-  F1394_DEVICE_PATH *F1394;\r
+  F1394_DEVICE_PATH *F1394DevPath;\r
 \r
   GuidStr = GetNextParamStr (&TextDeviceNode);\r
-  F1394  = (F1394_DEVICE_PATH *) CreateDeviceNode (\r
-                                   MESSAGING_DEVICE_PATH,\r
-                                   MSG_1394_DP,\r
-                                   sizeof (F1394_DEVICE_PATH)\r
-                                   );\r
+  F1394DevPath  = (F1394_DEVICE_PATH *) CreateDeviceNode (\r
+                                          MESSAGING_DEVICE_PATH,\r
+                                          MSG_1394_DP,\r
+                                          sizeof (F1394_DEVICE_PATH)\r
+                                          );\r
 \r
-  F1394->Reserved = 0;\r
-  Xtoi64 (GuidStr, &F1394->Guid);\r
+  F1394DevPath->Reserved = 0;\r
+  Xtoi64 (GuidStr, &F1394DevPath->Guid);\r
 \r
-  return (EFI_DEVICE_PATH_PROTOCOL *) F1394;\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) F1394DevPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsb (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1163,28 +1297,42 @@ DevPathFromTextUsb (
   return (EFI_DEVICE_PATH_PROTOCOL *) Usb;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to I20 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created I20 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextI2O (\r
   IN CHAR16 *TextDeviceNode\r
   )\r
 {\r
   CHAR16          *TIDStr;\r
-  I2O_DEVICE_PATH *I2O;\r
+  I2O_DEVICE_PATH *I2ODevPath;\r
 \r
-  TIDStr    = GetNextParamStr (&TextDeviceNode);\r
-  I2O       = (I2O_DEVICE_PATH *) CreateDeviceNode (\r
+  TIDStr     = GetNextParamStr (&TextDeviceNode);\r
+  I2ODevPath = (I2O_DEVICE_PATH *) CreateDeviceNode (\r
                                     MESSAGING_DEVICE_PATH,\r
                                     MSG_I2O_DP,\r
                                     sizeof (I2O_DEVICE_PATH)\r
                                     );\r
 \r
-  I2O->Tid  = (UINT32) Strtoi (TIDStr);\r
+  I2ODevPath->Tid  = (UINT32) Strtoi (TIDStr);\r
 \r
-  return (EFI_DEVICE_PATH_PROTOCOL *) I2O;\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) I2ODevPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Infini Band device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Infini Band device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextInfiniband (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1219,7 +1367,14 @@ DevPathFromTextInfiniband (
   return (EFI_DEVICE_PATH_PROTOCOL *) InfiniBand;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor-Defined Messaging device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor-Defined Messaging device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenMsg (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1232,7 +1387,14 @@ DevPathFromTextVenMsg (
             );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor defined PC-ANSI device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor defined PC-ANSI device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenPcAnsi (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1249,7 +1411,14 @@ DevPathFromTextVenPcAnsi (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor defined VT100 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor defined VT100 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenVt100 (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1266,7 +1435,14 @@ DevPathFromTextVenVt100 (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor defined VT100 Plus device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor defined VT100 Plus device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenVt100Plus (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1283,7 +1459,14 @@ DevPathFromTextVenVt100Plus (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor defined UTF8 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor defined UTF8 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenUtf8 (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1300,7 +1483,14 @@ DevPathFromTextVenUtf8 (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vendor;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to UART Flow Control device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created UART Flow Control device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUartFlowCtrl (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1328,7 +1518,14 @@ DevPathFromTextUartFlowCtrl (
   return (EFI_DEVICE_PATH_PROTOCOL *) UartFlowControl;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Serial Attached SCSI device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Serial Attached SCSI device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextSAS (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1391,7 +1588,14 @@ DevPathFromTextSAS (
   return (EFI_DEVICE_PATH_PROTOCOL *) Sas;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Debug Port device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Debug Port device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextDebugPort (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1410,7 +1614,14 @@ DevPathFromTextDebugPort (
   return (EFI_DEVICE_PATH_PROTOCOL *) Vend;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to MAC device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created MAC device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextMAC (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1419,25 +1630,32 @@ DevPathFromTextMAC (
   CHAR16                *AddressStr;\r
   CHAR16                *IfTypeStr;\r
   UINTN                 Length;\r
-  MAC_ADDR_DEVICE_PATH  *MAC;\r
+  MAC_ADDR_DEVICE_PATH  *MACDevPath;\r
 \r
   AddressStr    = GetNextParamStr (&TextDeviceNode);\r
   IfTypeStr     = GetNextParamStr (&TextDeviceNode);\r
-  MAC           = (MAC_ADDR_DEVICE_PATH *) CreateDeviceNode (\r
+  MACDevPath    = (MAC_ADDR_DEVICE_PATH *) CreateDeviceNode (\r
                                               MESSAGING_DEVICE_PATH,\r
                                               MSG_MAC_ADDR_DP,\r
                                               sizeof (MAC_ADDR_DEVICE_PATH)\r
                                               );\r
 \r
-  MAC->IfType   = (UINT8) Strtoi (IfTypeStr);\r
+  MACDevPath->IfType   = (UINT8) Strtoi (IfTypeStr);\r
 \r
   Length = sizeof (EFI_MAC_ADDRESS);\r
-  StrToBuf (&MAC->MacAddress.Addr[0], Length, AddressStr);\r
+  StrToBuf (&MACDevPath->MacAddress.Addr[0], Length, AddressStr);\r
 \r
-  return (EFI_DEVICE_PATH_PROTOCOL *) MAC;\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to IPV4 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created IPV4 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextIPv4 (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1475,7 +1693,14 @@ DevPathFromTextIPv4 (
   return (EFI_DEVICE_PATH_PROTOCOL *) IPv4;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to IPV6 device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created IPV6 device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextIPv6 (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1513,7 +1738,14 @@ DevPathFromTextIPv6 (
   return (EFI_DEVICE_PATH_PROTOCOL *) IPv6;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to UART device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created UART device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUart (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1580,7 +1812,15 @@ DevPathFromTextUart (
   return (EFI_DEVICE_PATH_PROTOCOL *) Uart;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB class device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+  @param UsbClassText    A pointer to USB_CLASS_TEXT structure to be integrated to USB Class Text.\r
+\r
+  @return A pointer to the newly-created USB class device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 ConvertFromTextUsbClass (\r
   IN CHAR16         *TextDeviceNode,\r
@@ -1613,7 +1853,7 @@ ConvertFromTextUsbClass (
     UsbClass->DeviceSubClass = (UINT8) Strtoi (SubClassStr);\r
   } else {\r
     UsbClass->DeviceSubClass = UsbClassText->SubClass;\r
-  }  \r
+  }\r
 \r
   ProtocolStr = GetNextParamStr (&TextDeviceNode);\r
 \r
@@ -1625,7 +1865,14 @@ ConvertFromTextUsbClass (
 }\r
 \r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB class device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB class device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbClass (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1639,7 +1886,14 @@ DevPathFromTextUsbClass (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB audio device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB audio device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbAudio (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1654,7 +1908,14 @@ DevPathFromTextUsbAudio (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB CDC Control device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB CDC Control device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbCDCControl (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1669,7 +1930,14 @@ DevPathFromTextUsbCDCControl (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB HID device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB HID device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbHID (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1684,7 +1952,14 @@ DevPathFromTextUsbHID (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB Image device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB Image device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbImage (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1699,7 +1974,14 @@ DevPathFromTextUsbImage (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB Print device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB Print device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbPrinter (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1714,7 +1996,14 @@ DevPathFromTextUsbPrinter (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB mass storage device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB mass storage device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbMassStorage (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1729,7 +2018,14 @@ DevPathFromTextUsbMassStorage (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB HUB device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB HUB device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbHub (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1744,7 +2040,14 @@ DevPathFromTextUsbHub (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB CDC data device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB CDC data device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbCDCData (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1759,7 +2062,14 @@ DevPathFromTextUsbCDCData (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB smart card device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB smart card device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbSmartCard (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1774,7 +2084,14 @@ DevPathFromTextUsbSmartCard (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB video device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB video device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbVideo (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1789,7 +2106,14 @@ DevPathFromTextUsbVideo (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB diagnostic device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB diagnostic device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbDiagnostic (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1804,7 +2128,14 @@ DevPathFromTextUsbDiagnostic (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB wireless device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB wireless device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbWireless (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1819,7 +2150,14 @@ DevPathFromTextUsbWireless (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB device firmware update device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB device firmware update device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbDeviceFirmwareUpdate (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1835,7 +2173,14 @@ DevPathFromTextUsbDeviceFirmwareUpdate (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB IRDA bridge device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB IRDA bridge device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbIrdaBridge (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1851,7 +2196,14 @@ DevPathFromTextUsbIrdaBridge (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB text and measurement device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB text and measurement device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbTestAndMeasurement (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1867,7 +2219,14 @@ DevPathFromTextUsbTestAndMeasurement (
   return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to USB WWID device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created USB WWID device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUsbWwid (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1897,7 +2256,14 @@ DevPathFromTextUsbWwid (
   return (EFI_DEVICE_PATH_PROTOCOL *) UsbWwid;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Logic Unit device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Logic Unit device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextUnit (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1918,7 +2284,14 @@ DevPathFromTextUnit (
   return (EFI_DEVICE_PATH_PROTOCOL *) LogicalUnit;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to iSCSI device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created iSCSI device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextiSCSI (\r
   IN CHAR16 *TextDeviceNode\r
@@ -1933,7 +2306,7 @@ DevPathFromTextiSCSI (
   CHAR16                      *AuthenticationStr;\r
   CHAR16                      *ProtocolStr;\r
   CHAR8                       *AsciiStr;\r
-  ISCSI_DEVICE_PATH_WITH_NAME *iSCSI;\r
+  ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;\r
 \r
   NameStr           = GetNextParamStr (&TextDeviceNode);\r
   PortalGroupStr    = GetNextParamStr (&TextDeviceNode);\r
@@ -1942,17 +2315,17 @@ DevPathFromTextiSCSI (
   DataDigestStr     = GetNextParamStr (&TextDeviceNode);\r
   AuthenticationStr = GetNextParamStr (&TextDeviceNode);\r
   ProtocolStr       = GetNextParamStr (&TextDeviceNode);\r
-  iSCSI             = (ISCSI_DEVICE_PATH_WITH_NAME *) CreateDeviceNode (\r
+  ISCSIDevPath      = (ISCSI_DEVICE_PATH_WITH_NAME *) CreateDeviceNode (\r
                                                         MESSAGING_DEVICE_PATH,\r
                                                         MSG_ISCSI_DP,\r
                                                         (UINT16) (sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + StrLen (NameStr))\r
                                                         );\r
 \r
-  AsciiStr = iSCSI->iSCSITargetName;\r
+  AsciiStr = ISCSIDevPath->iSCSITargetName;\r
   StrToAscii (NameStr, &AsciiStr);\r
 \r
-  iSCSI->TargetPortalGroupTag = (UINT16) Strtoi (PortalGroupStr);\r
-  Strtoi64 (LunStr, &iSCSI->Lun);\r
+  ISCSIDevPath->TargetPortalGroupTag = (UINT16) Strtoi (PortalGroupStr);\r
+  Strtoi64 (LunStr, &ISCSIDevPath->Lun);\r
 \r
   Options = 0x0000;\r
   if (StrCmp (HeaderDigestStr, L"CRC32C") == 0) {\r
@@ -1971,14 +2344,21 @@ DevPathFromTextiSCSI (
     Options |= 0x1000;\r
   }\r
 \r
-  iSCSI->LoginOption      = (UINT16) Options;\r
+  ISCSIDevPath->LoginOption      = (UINT16) Options;\r
 \r
-  iSCSI->NetworkProtocol  = (UINT16) StrCmp (ProtocolStr, L"TCP");\r
+  ISCSIDevPath->NetworkProtocol  = (UINT16) StrCmp (ProtocolStr, L"TCP");\r
 \r
-  return (EFI_DEVICE_PATH_PROTOCOL *) iSCSI;\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) ISCSIDevPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to HD device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created HD device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextHD (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2031,7 +2411,14 @@ DevPathFromTextHD (
   return (EFI_DEVICE_PATH_PROTOCOL *) Hd;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to CDROM device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created CDROM device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextCDROM (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2040,25 +2427,32 @@ DevPathFromTextCDROM (
   CHAR16            *EntryStr;\r
   CHAR16            *StartStr;\r
   CHAR16            *SizeStr;\r
-  CDROM_DEVICE_PATH *CDROM;\r
+  CDROM_DEVICE_PATH *CDROMDevPath;\r
 \r
   EntryStr              = GetNextParamStr (&TextDeviceNode);\r
   StartStr              = GetNextParamStr (&TextDeviceNode);\r
   SizeStr               = GetNextParamStr (&TextDeviceNode);\r
-  CDROM                 = (CDROM_DEVICE_PATH *) CreateDeviceNode (\r
+  CDROMDevPath          = (CDROM_DEVICE_PATH *) CreateDeviceNode (\r
                                                   MEDIA_DEVICE_PATH,\r
                                                   MEDIA_CDROM_DP,\r
                                                   sizeof (CDROM_DEVICE_PATH)\r
                                                   );\r
 \r
-  CDROM->BootEntry      = (UINT32) Strtoi (EntryStr);\r
-  Strtoi64 (StartStr, &CDROM->PartitionStart);\r
-  Strtoi64 (SizeStr, &CDROM->PartitionSize);\r
+  CDROMDevPath->BootEntry = (UINT32) Strtoi (EntryStr);\r
+  Strtoi64 (StartStr, &CDROMDevPath->PartitionStart);\r
+  Strtoi64 (SizeStr, &CDROMDevPath->PartitionSize);\r
 \r
-  return (EFI_DEVICE_PATH_PROTOCOL *) CDROM;\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) CDROMDevPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Vendor-defined media device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Vendor-defined media device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextVenMEDIA (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2071,7 +2465,14 @@ DevPathFromTextVenMEDIA (
            );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to File device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created File device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextFilePath (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2090,7 +2491,14 @@ DevPathFromTextFilePath (
   return (EFI_DEVICE_PATH_PROTOCOL *) File;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to Media protocol device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created Media protocol device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextMedia (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2111,7 +2519,14 @@ DevPathFromTextMedia (
   return (EFI_DEVICE_PATH_PROTOCOL *) Media;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to firmware volume device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created firmware volume device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextFv (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2132,7 +2547,14 @@ DevPathFromTextFv (
   return (EFI_DEVICE_PATH_PROTOCOL *) Fv;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to firmware file device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created firmware file device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextFvFile (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2153,7 +2575,14 @@ DevPathFromTextFvFile (
   return (EFI_DEVICE_PATH_PROTOCOL *) FvFile;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to BIOS Boot Specification device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created BIOS Boot Specificationa device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextBBS (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2198,7 +2627,14 @@ DevPathFromTextBBS (
   return (EFI_DEVICE_PATH_PROTOCOL *) Bbs;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a text device path node to SATA device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created SATA device path structure.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 DevPathFromTextSata (\r
   IN CHAR16 *TextDeviceNode\r
@@ -2299,27 +2735,24 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[]
   {NULL, NULL}\r
 };\r
 \r
-EFI_DEVICE_PATH_PROTOCOL *\r
-ConvertTextToDeviceNode (\r
-  IN CONST CHAR16 *TextDeviceNode\r
-  )\r
-/*++\r
+/**\r
+  Convert text to the binary representation of a device node.\r
 \r
-  Routine Description:\r
-    Convert text to the binary representation of a device node.\r
-\r
-  Arguments:\r
-    TextDeviceNode   -   TextDeviceNode points to the text representation of a device\r
+  @param TextDeviceNode  TextDeviceNode points to the text representation of a device\r
                          node. Conversion starts with the first character and continues\r
                          until the first non-device node character.\r
 \r
-  Returns:\r
-    A pointer        -   Pointer to the EFI device node.\r
-    NULL             -   If TextDeviceNode is NULL or there was insufficient memory or text unsupported.\r
+  @return A pointer to the EFI device node or NULL if TextDeviceNode is NULL or there was\r
+          insufficient memory or text unsupported.\r
 \r
---*/\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+ConvertTextToDeviceNode (\r
+  IN CONST CHAR16 *TextDeviceNode\r
+  )\r
 {\r
-  EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *);\r
+  DUMP_NODE                DumpNode;\r
   CHAR16                   *ParamStr;\r
   EFI_DEVICE_PATH_PROTOCOL *DeviceNode;\r
   CHAR16                   *DeviceNodeStr;\r
@@ -2357,27 +2790,25 @@ ConvertTextToDeviceNode (
   return DeviceNode;\r
 }\r
 \r
-EFI_DEVICE_PATH_PROTOCOL *\r
-ConvertTextToDevicePath (\r
-  IN CONST CHAR16 *TextDevicePath\r
-  )\r
-/*++\r
+/**\r
+  Convert text to the binary representation of a device path.\r
 \r
-  Routine Description:\r
-    Convert text to the binary representation of a device path.\r
 \r
-  Arguments:\r
-    TextDevicePath   -   TextDevicePath points to the text representation of a device\r
+  @param TextDevicePath  TextDevicePath points to the text representation of a device\r
                          path. Conversion starts with the first character and continues\r
                          until the first non-device node character.\r
 \r
-  Returns:\r
-    A pointer        -   Pointer to the allocated device path.\r
-    NULL             -   If TextDeviceNode is NULL or there was insufficient memory.\r
+  @return A pointer to the allocated device path or NULL if TextDeviceNode is NULL or\r
+          there was insufficient memory.\r
 \r
---*/\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+ConvertTextToDevicePath (\r
+  IN CONST CHAR16 *TextDevicePath\r
+  )\r
 {\r
-  EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *);\r
+  DUMP_NODE                DumpNode;\r
   CHAR16                   *ParamStr;\r
   EFI_DEVICE_PATH_PROTOCOL *DeviceNode;\r
   UINTN                    Index;\r
@@ -2426,9 +2857,9 @@ ConvertTextToDevicePath (
     FreePool (DeviceNode);\r
     DevicePath = NewDevicePath;\r
 \r
-    if (IsInstanceEnd) {\r
+    if (IsInstanceEnd != 0) {\r
       DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);\r
-      SetDevicePathInstanceEndNode (DeviceNode);\r
+      SET_DEVICE_PATH_INSTANCE_END_NODE (DeviceNode);\r
 \r
       NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode);\r
       FreePool (DevicePath);\r
index 0ba2a25618e2687b7f9ea95da94c11e54ee1607d..a1d560cfd536b045601f458add37ae5e3e62ff0b 100644 (file)
@@ -14,25 +14,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "DevicePath.h"\r
 \r
-STATIC\r
+/**\r
+  Function unpacks a device path data structure so that all the nodes of a device path\r
+  are naturally aligned.\r
+\r
+  @param DevPath         A pointer to a device path data structure\r
+\r
+  @return If the memory for the device path is successfully allocated, then a pointer to the\r
+          new device path is returned.  Otherwise, NULL is returned.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 UnpackDevicePath (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevPath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Function unpacks a device path data structure so that all the nodes of a device path \r
-    are naturally aligned.\r
-\r
-  Arguments:\r
-    DevPath        - A pointer to a device path data structure\r
-\r
-  Returns:\r
-    If the memory for the device path is successfully allocated, then a pointer to the \r
-    new device path is returned.  Otherwise, NULL is returned.\r
-\r
---*/\r
 {\r
   CONST EFI_DEVICE_PATH_PROTOCOL  *Src;\r
   EFI_DEVICE_PATH_PROTOCOL  *Dest;\r
@@ -89,39 +84,32 @@ UnpackDevicePath (
   return NewPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Adjusts the size of a previously allocated buffer.\r
+\r
+  @param OldPool         A pointer to the buffer whose size is being adjusted.\r
+  @param OldSize         The size of the current buffer.\r
+  @param NewSize         The size of the new buffer.\r
+\r
+  @return A pointer to the new buffer or NULL if allocation fails.\r
+\r
+**/\r
 VOID *\r
 ReallocatePool (\r
   IN VOID                 *OldPool,\r
   IN UINTN                OldSize,\r
   IN UINTN                NewSize\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Adjusts the size of a previously allocated buffer.\r
-\r
-  Arguments:\r
-    OldPool               - A pointer to the buffer whose size is being adjusted.\r
-    OldSize               - The size of the current buffer.\r
-    NewSize               - The size of the new buffer.\r
-\r
-  Returns:\r
-    EFI_SUCEESS           - The requested number of bytes were allocated.\r
-    EFI_OUT_OF_RESOURCES  - The pool requested could not be allocated.\r
-    EFI_INVALID_PARAMETER - The buffer was invalid.\r
-\r
---*/\r
 {\r
   VOID  *NewPool;\r
 \r
   NewPool = NULL;\r
-  if (NewSize) {\r
+  if (NewSize != 0) {\r
     NewPool = AllocateZeroPool (NewSize);\r
   }\r
 \r
-  if (OldPool) {\r
-    if (NewPool) {\r
+  if (OldPool != NULL) {\r
+    if (NewPool != NULL) {\r
       CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
     }\r
 \r
@@ -131,30 +119,26 @@ ReallocatePool (
   return NewPool;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Concatenates a formatted unicode string to allocated pool. The caller must\r
+  free the resulting buffer.\r
+\r
+  @param Str             Tracks the allocated pool, size in use, and\r
+                         amount of pool allocated.\r
+  @param Fmt             The format string\r
+  @param ...             Variable arguments based on the format string.\r
+\r
+  @return Allocated buffer with the formatted string printed in it.\r
+          The caller must free the allocated buffer. The buffer\r
+          allocation is not packed.\r
+\r
+**/\r
 CHAR16 *\r
 CatPrint (\r
   IN OUT POOL_PRINT   *Str,\r
   IN CHAR16           *Fmt,\r
   ...\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Concatenates a formatted unicode string to allocated pool.  \r
-    The caller must free the resulting buffer.\r
-\r
-  Arguments:\r
-    Str         - Tracks the allocated pool, size in use, and \r
-                  amount of pool allocated.\r
-    Fmt         - The format string\r
-\r
-  Returns:\r
-    Allocated buffer with the formatted string printed in it.  \r
-    The caller must free the allocated buffer.   The buffer\r
-    allocation is not packed.\r
-\r
---*/\r
 {\r
   UINT16  *AppendStr;\r
   VA_LIST Args;\r
@@ -173,7 +157,7 @@ CatPrint (
     Str->Str  = AllocateZeroPool (Size);\r
     ASSERT (Str->Str != NULL);\r
   } else {\r
-    Size = StrSize (AppendStr)  - sizeof (UINT16);\r
+    Size = StrSize (AppendStr) - sizeof (UINT16);\r
     Size = Size + StrSize (Str->Str);\r
     Str->Str = ReallocatePool (\r
                 Str->Str,\r
@@ -193,7 +177,19 @@ CatPrint (
   return Str->Str;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a PCI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextPci (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -208,7 +204,19 @@ DevPathToTextPci (
   CatPrint (Str, L"Pci(0x%x,0x%x)", Pci->Device, Pci->Function);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a PC Card device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextPccard (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -223,7 +231,19 @@ DevPathToTextPccard (
   CatPrint (Str, L"PcCard(0x%x)", Pccard->FunctionNumber);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Memory Map device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMemMap (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -244,7 +264,19 @@ DevPathToTextMemMap (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Vendor device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextVendor (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -316,9 +348,9 @@ DevPathToTextVendor (
           CatPrint (\r
             Str,\r
             L"%s,%s,%s,",\r
-            (Info & (0x1 << 4)) ? L"SATA" : L"SAS",\r
-            (Info & (0x1 << 5)) ? L"External" : L"Internal",\r
-            (Info & (0x1 << 6)) ? L"Expanded" : L"Direct"\r
+            ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
+            ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
+            ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
             );\r
           if ((Info & 0x0f) == 1) {\r
             CatPrint (Str, L"0,");\r
@@ -359,7 +391,19 @@ DevPathToTextVendor (
   CatPrint (Str, L")");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Controller device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextController (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -378,7 +422,19 @@ DevPathToTextController (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -421,11 +477,17 @@ DevPathToTextAcpi (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts EISA identification to string.\r
+\r
+  @param EisaId        The input EISA identification.\r
+  @param Text          A pointer to the output string.\r
+\r
+**/\r
 VOID\r
 EisaIdToText (\r
   IN UINT32         EisaId,\r
-  IN OUT CHAR16    *Text\r
+  IN OUT CHAR16     *Text\r
   )\r
 {\r
   CHAR16 PnpIdStr[17];\r
@@ -446,7 +508,19 @@ EisaIdToText (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI extended HID device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpiEx (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -518,7 +592,19 @@ DevPathToTextAcpiEx (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI address device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpiAdr (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -543,7 +629,19 @@ DevPathToTextAcpiAdr (
   CatPrint (Str, L")");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ATAPI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAtapi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -569,7 +667,19 @@ DevPathToTextAtapi (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a SCSI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextScsi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -584,7 +694,19 @@ DevPathToTextScsi (
   CatPrint (Str, L"Scsi(0x%x,0x%x)", Scsi->Pun, Scsi->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Fibre device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFibre (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -599,7 +721,19 @@ DevPathToTextFibre (
   CatPrint (Str, L"Fibre(0x%lx,0x%lx)", Fibre->WWN, Fibre->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a 1394 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToText1394 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -608,16 +742,28 @@ DevPathToText1394 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  F1394_DEVICE_PATH *F1394;\r
+  F1394_DEVICE_PATH *F1394DevPath;\r
 \r
-  F1394 = DevPath;\r
+  F1394DevPath = DevPath;\r
   //\r
   // Guid has format of IEEE-EUI64\r
   //\r
-  CatPrint (Str, L"I1394(%016lx)", F1394->Guid);\r
+  CatPrint (Str, L"I1394(%016lx)", F1394DevPath->Guid);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsb (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -632,7 +778,19 @@ DevPathToTextUsb (
   CatPrint (Str, L"USB(0x%x,0x%x)", Usb->ParentPortNumber, Usb->InterfaceNumber);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB WWID device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsbWWID (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -669,7 +827,19 @@ DevPathToTextUsbWWID (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Logic Unit device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextLogicalUnit (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -684,7 +854,19 @@ DevPathToTextLogicalUnit (
   CatPrint (Str, L"Unit(0x%x)", LogicalUnit->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB class device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsbClass (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -808,7 +990,19 @@ DevPathToTextUsbClass (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a SATA device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextSata (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -829,7 +1023,19 @@ DevPathToTextSata (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a I20 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextI2O (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -838,13 +1044,25 @@ DevPathToTextI2O (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  I2O_DEVICE_PATH *I2O;\r
+  I2O_DEVICE_PATH *I2ODevPath;\r
 \r
-  I2O = DevPath;\r
-  CatPrint (Str, L"I2O(0x%x)", I2O->Tid);\r
+  I2ODevPath = DevPath;\r
+  CatPrint (Str, L"I2O(0x%x)", I2ODevPath->Tid);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a MAC address device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMacAddr (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -853,27 +1071,39 @@ DevPathToTextMacAddr (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  MAC_ADDR_DEVICE_PATH  *MAC;\r
+  MAC_ADDR_DEVICE_PATH  *MacDevPath;\r
   UINTN                 HwAddressSize;\r
   UINTN                 Index;\r
 \r
-  MAC           = DevPath;\r
+  MacDevPath = DevPath;\r
 \r
   HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
-  if (MAC->IfType == 0x01 || MAC->IfType == 0x00) {\r
+  if (MacDevPath->IfType == 0x01 || MacDevPath->IfType == 0x00) {\r
     HwAddressSize = 6;\r
   }\r
 \r
   CatPrint (Str, L"MAC(");\r
 \r
   for (Index = 0; Index < HwAddressSize; Index++) {\r
-    CatPrint (Str, L"%02x", MAC->MacAddress.Addr[Index]);\r
+    CatPrint (Str, L"%02x", MacDevPath->MacAddress.Addr[Index]);\r
   }\r
 \r
-  CatPrint (Str, L",0x%x)", MAC->IfType);\r
+  CatPrint (Str, L",0x%x)", MacDevPath->IfType);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a IPv4 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextIPv4 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -882,17 +1112,17 @@ DevPathToTextIPv4 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  IPv4_DEVICE_PATH  *IP;\r
+  IPv4_DEVICE_PATH  *IPDevPath;\r
 \r
-  IP = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  IPDevPath = DevPath;\r
+  if (DisplayOnly) {\r
     CatPrint (\r
       Str,\r
       L"IPv4(%d.%d.%d.%d)",\r
-      IP->RemoteIpAddress.Addr[0],\r
-      IP->RemoteIpAddress.Addr[1],\r
-      IP->RemoteIpAddress.Addr[2],\r
-      IP->RemoteIpAddress.Addr[3]\r
+      IPDevPath->RemoteIpAddress.Addr[0],\r
+      IPDevPath->RemoteIpAddress.Addr[1],\r
+      IPDevPath->RemoteIpAddress.Addr[2],\r
+      IPDevPath->RemoteIpAddress.Addr[3]\r
       );\r
     return ;\r
   }\r
@@ -900,20 +1130,32 @@ DevPathToTextIPv4 (
   CatPrint (\r
     Str,\r
     L"IPv4(%d.%d.%d.%d,%s,%s,%d.%d.%d.%d)",\r
-    IP->RemoteIpAddress.Addr[0],\r
-    IP->RemoteIpAddress.Addr[1],\r
-    IP->RemoteIpAddress.Addr[2],\r
-    IP->RemoteIpAddress.Addr[3],\r
-    IP->Protocol ? L"TCP" : L"UDP",\r
-    (IP->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IP->LocalIpAddress.Addr[0],\r
-    IP->LocalIpAddress.Addr[1],\r
-    IP->LocalIpAddress.Addr[2],\r
-    IP->LocalIpAddress.Addr[3]\r
+    IPDevPath->RemoteIpAddress.Addr[0],\r
+    IPDevPath->RemoteIpAddress.Addr[1],\r
+    IPDevPath->RemoteIpAddress.Addr[2],\r
+    IPDevPath->RemoteIpAddress.Addr[3],\r
+    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
+    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
+    IPDevPath->LocalIpAddress.Addr[0],\r
+    IPDevPath->LocalIpAddress.Addr[1],\r
+    IPDevPath->LocalIpAddress.Addr[2],\r
+    IPDevPath->LocalIpAddress.Addr[3]\r
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a IPv6 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextIPv6 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -922,29 +1164,29 @@ DevPathToTextIPv6 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  IPv6_DEVICE_PATH  *IP;\r
+  IPv6_DEVICE_PATH  *IPDevPath;\r
 \r
-  IP = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  IPDevPath = DevPath;\r
+  if (DisplayOnly) {\r
     CatPrint (\r
       Str,\r
       L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-      IP->RemoteIpAddress.Addr[0],\r
-      IP->RemoteIpAddress.Addr[1],\r
-      IP->RemoteIpAddress.Addr[2],\r
-      IP->RemoteIpAddress.Addr[3],\r
-      IP->RemoteIpAddress.Addr[4],\r
-      IP->RemoteIpAddress.Addr[5],\r
-      IP->RemoteIpAddress.Addr[6],\r
-      IP->RemoteIpAddress.Addr[7],\r
-      IP->RemoteIpAddress.Addr[8],\r
-      IP->RemoteIpAddress.Addr[9],\r
-      IP->RemoteIpAddress.Addr[10],\r
-      IP->RemoteIpAddress.Addr[11],\r
-      IP->RemoteIpAddress.Addr[12],\r
-      IP->RemoteIpAddress.Addr[13],\r
-      IP->RemoteIpAddress.Addr[14],\r
-      IP->RemoteIpAddress.Addr[15]\r
+      IPDevPath->RemoteIpAddress.Addr[0],\r
+      IPDevPath->RemoteIpAddress.Addr[1],\r
+      IPDevPath->RemoteIpAddress.Addr[2],\r
+      IPDevPath->RemoteIpAddress.Addr[3],\r
+      IPDevPath->RemoteIpAddress.Addr[4],\r
+      IPDevPath->RemoteIpAddress.Addr[5],\r
+      IPDevPath->RemoteIpAddress.Addr[6],\r
+      IPDevPath->RemoteIpAddress.Addr[7],\r
+      IPDevPath->RemoteIpAddress.Addr[8],\r
+      IPDevPath->RemoteIpAddress.Addr[9],\r
+      IPDevPath->RemoteIpAddress.Addr[10],\r
+      IPDevPath->RemoteIpAddress.Addr[11],\r
+      IPDevPath->RemoteIpAddress.Addr[12],\r
+      IPDevPath->RemoteIpAddress.Addr[13],\r
+      IPDevPath->RemoteIpAddress.Addr[14],\r
+      IPDevPath->RemoteIpAddress.Addr[15]\r
       );\r
     return ;\r
   }\r
@@ -952,44 +1194,56 @@ DevPathToTextIPv6 (
   CatPrint (\r
     Str,\r
     L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,%s,%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-    IP->RemoteIpAddress.Addr[0],\r
-    IP->RemoteIpAddress.Addr[1],\r
-    IP->RemoteIpAddress.Addr[2],\r
-    IP->RemoteIpAddress.Addr[3],\r
-    IP->RemoteIpAddress.Addr[4],\r
-    IP->RemoteIpAddress.Addr[5],\r
-    IP->RemoteIpAddress.Addr[6],\r
-    IP->RemoteIpAddress.Addr[7],\r
-    IP->RemoteIpAddress.Addr[8],\r
-    IP->RemoteIpAddress.Addr[9],\r
-    IP->RemoteIpAddress.Addr[10],\r
-    IP->RemoteIpAddress.Addr[11],\r
-    IP->RemoteIpAddress.Addr[12],\r
-    IP->RemoteIpAddress.Addr[13],\r
-    IP->RemoteIpAddress.Addr[14],\r
-    IP->RemoteIpAddress.Addr[15],\r
-    IP->Protocol ? L"TCP" : L"UDP",\r
-    (IP->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IP->LocalIpAddress.Addr[0],\r
-    IP->LocalIpAddress.Addr[1],\r
-    IP->LocalIpAddress.Addr[2],\r
-    IP->LocalIpAddress.Addr[3],\r
-    IP->LocalIpAddress.Addr[4],\r
-    IP->LocalIpAddress.Addr[5],\r
-    IP->LocalIpAddress.Addr[6],\r
-    IP->LocalIpAddress.Addr[7],\r
-    IP->LocalIpAddress.Addr[8],\r
-    IP->LocalIpAddress.Addr[9],\r
-    IP->LocalIpAddress.Addr[10],\r
-    IP->LocalIpAddress.Addr[11],\r
-    IP->LocalIpAddress.Addr[12],\r
-    IP->LocalIpAddress.Addr[13],\r
-    IP->LocalIpAddress.Addr[14],\r
-    IP->LocalIpAddress.Addr[15]\r
+    IPDevPath->RemoteIpAddress.Addr[0],\r
+    IPDevPath->RemoteIpAddress.Addr[1],\r
+    IPDevPath->RemoteIpAddress.Addr[2],\r
+    IPDevPath->RemoteIpAddress.Addr[3],\r
+    IPDevPath->RemoteIpAddress.Addr[4],\r
+    IPDevPath->RemoteIpAddress.Addr[5],\r
+    IPDevPath->RemoteIpAddress.Addr[6],\r
+    IPDevPath->RemoteIpAddress.Addr[7],\r
+    IPDevPath->RemoteIpAddress.Addr[8],\r
+    IPDevPath->RemoteIpAddress.Addr[9],\r
+    IPDevPath->RemoteIpAddress.Addr[10],\r
+    IPDevPath->RemoteIpAddress.Addr[11],\r
+    IPDevPath->RemoteIpAddress.Addr[12],\r
+    IPDevPath->RemoteIpAddress.Addr[13],\r
+    IPDevPath->RemoteIpAddress.Addr[14],\r
+    IPDevPath->RemoteIpAddress.Addr[15],\r
+    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
+    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
+    IPDevPath->LocalIpAddress.Addr[0],\r
+    IPDevPath->LocalIpAddress.Addr[1],\r
+    IPDevPath->LocalIpAddress.Addr[2],\r
+    IPDevPath->LocalIpAddress.Addr[3],\r
+    IPDevPath->LocalIpAddress.Addr[4],\r
+    IPDevPath->LocalIpAddress.Addr[5],\r
+    IPDevPath->LocalIpAddress.Addr[6],\r
+    IPDevPath->LocalIpAddress.Addr[7],\r
+    IPDevPath->LocalIpAddress.Addr[8],\r
+    IPDevPath->LocalIpAddress.Addr[9],\r
+    IPDevPath->LocalIpAddress.Addr[10],\r
+    IPDevPath->LocalIpAddress.Addr[11],\r
+    IPDevPath->LocalIpAddress.Addr[12],\r
+    IPDevPath->LocalIpAddress.Addr[13],\r
+    IPDevPath->LocalIpAddress.Addr[14],\r
+    IPDevPath->LocalIpAddress.Addr[15]\r
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an Infini Band device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextInfiniBand (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1012,7 +1266,19 @@ DevPathToTextInfiniBand (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a UART device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUart (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1092,7 +1358,19 @@ DevPathToTextUart (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an iSCSI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextiSCSI (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1101,34 +1379,46 @@ DevPathToTextiSCSI (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  ISCSI_DEVICE_PATH_WITH_NAME *iSCSI;\r
+  ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;\r
   UINT16                      Options;\r
 \r
-  iSCSI = DevPath;\r
+  ISCSIDevPath = DevPath;\r
   CatPrint (\r
     Str,\r
     L"iSCSI(%a,0x%x,0x%lx,",\r
-    iSCSI->iSCSITargetName,\r
-    iSCSI->TargetPortalGroupTag,\r
-    iSCSI->Lun\r
+    ISCSIDevPath->iSCSITargetName,\r
+    ISCSIDevPath->TargetPortalGroupTag,\r
+    ISCSIDevPath->Lun\r
     );\r
 \r
-  Options = iSCSI->LoginOption;\r
-  CatPrint (Str, L"%s,", ((Options >> 1) & 0x0001) ? L"CRC32C" : L"None");\r
-  CatPrint (Str, L"%s,", ((Options >> 3) & 0x0001) ? L"CRC32C" : L"None");\r
-  if ((Options >> 11) & 0x0001) {\r
+  Options = ISCSIDevPath->LoginOption;\r
+  CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
+  CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
+  if (((Options >> 11) & 0x0001) != 0) {\r
     CatPrint (Str, L"%s,", L"None");\r
-  } else if ((Options >> 12) & 0x0001) {\r
+  } else if (((Options >> 12) & 0x0001) != 0) {\r
     CatPrint (Str, L"%s,", L"CHAP_UNI");\r
   } else {\r
     CatPrint (Str, L"%s,", L"CHAP_BI");\r
 \r
   }\r
 \r
-  CatPrint (Str, L"%s)", (iSCSI->NetworkProtocol == 0) ? L"TCP" : L"reserved");\r
+  CatPrint (Str, L"%s)", (ISCSIDevPath->NetworkProtocol == 0) ? L"TCP" : L"reserved");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Hard drive device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextHardDrive (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1174,7 +1464,19 @@ DevPathToTextHardDrive (
   CatPrint (Str, L"0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a CDROM device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextCDROM (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1186,7 +1488,7 @@ DevPathToTextCDROM (
   CDROM_DEVICE_PATH *Cd;\r
 \r
   Cd = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  if (DisplayOnly) {\r
     CatPrint (Str, L"CDROM(0x%x)", Cd->BootEntry);\r
     return ;\r
   }\r
@@ -1194,7 +1496,19 @@ DevPathToTextCDROM (
   CatPrint (Str, L"CDROM(0x%x,0x%lx,0x%lx)", Cd->BootEntry, Cd->PartitionStart, Cd->PartitionSize);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a File device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFilePath (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1209,7 +1523,19 @@ DevPathToTextFilePath (
   CatPrint (Str, L"%s", Fp->PathName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Media protocol device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMediaProtocol (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1224,7 +1550,19 @@ DevPathToTextMediaProtocol (
   CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Firmware Volume device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFv (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1239,7 +1577,19 @@ DevPathToTextFv (
   CatPrint (Str, L"Fv(%g)", &Fv->FvName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Firmware Volume File device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFvFile (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1254,7 +1604,19 @@ DevPathToTextFvFile (
   CatPrint (Str, L"FvFile(%g)", &FvFile->FvFileName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a BIOS Boot Specification device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextBBS (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1303,7 +1665,7 @@ DevPathToTextBBS (
     CatPrint (Str, L"BBS(0x%x,%a", Bbs->DeviceType, Bbs->String);\r
   }\r
 \r
-  if (DisplayOnly == TRUE) {\r
+  if (DisplayOnly) {\r
     CatPrint (Str, L")");\r
     return ;\r
   }\r
@@ -1311,7 +1673,19 @@ DevPathToTextBBS (
   CatPrint (Str, L",0x%x)", Bbs->StatusFlag);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an End-of-Device-Path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextEndInstance (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1323,7 +1697,19 @@ DevPathToTextEndInstance (
   CatPrint (Str, L",");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an unknown device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextNodeUnknown (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1374,31 +1760,28 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable
   {0, 0, NULL}\r
 };\r
 \r
+/**\r
+  Converts a device node to its string representation.\r
+\r
+  @param DeviceNode        A Pointer to the device node to be converted.\r
+  @param DisplayOnly       If DisplayOnly is TRUE, then the shorter text representation\r
+                           of the display node is used, where applicable. If DisplayOnly\r
+                           is FALSE, then the longer text representation of the display node\r
+                           is used.\r
+  @param AllowShortcuts    If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                           representation for a device node can be used, where applicable.\r
+\r
+  @return A pointer to the allocated text representation of the device node or NULL if DeviceNode\r
+          is NULL or there was insufficient memory.\r
+\r
+**/\r
 CHAR16 *\r
+EFIAPI\r
 ConvertDeviceNodeToText (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DeviceNode,\r
   IN BOOLEAN                         DisplayOnly,\r
   IN BOOLEAN                         AllowShortcuts\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Convert a device node to its text representation.\r
-\r
-  Arguments:\r
-    DeviceNode       -   Points to the device node to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
-                         of the display node is used, where applicable. If DisplayOnly\r
-                         is FALSE, then the longer text representation of the display node\r
-                         is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
-                         representation for a device node can be used, where applicable.\r
-\r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device node.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
-\r
---*/\r
 {\r
   POOL_PRINT  Str;\r
   UINTN       Index;\r
@@ -1445,31 +1828,28 @@ ConvertDeviceNodeToText (
   return Str.Str;\r
 }\r
 \r
-CHAR16 *\r
-ConvertDevicePathToText (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
-  IN BOOLEAN                          DisplayOnly,\r
-  IN BOOLEAN                          AllowShortcuts\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Convert a device path to its text representation.\r
+/**\r
+  Converts a device path to its text representation.\r
 \r
-  Arguments:\r
-    DeviceNode       -   Points to the device path to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
+  @param DevicePath      A Pointer to the device to be converted.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
                          is FALSE, then the longer text representation of the display node\r
                          is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
                          representation for a device node can be used, where applicable.\r
 \r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device path.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
+  @return A pointer to the allocated text representation of the device path or\r
+          NULL if DeviceNode is NULL or there was insufficient memory.\r
 \r
---*/\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+ConvertDevicePathToText (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
 {\r
   POOL_PRINT                Str;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevPathNode;\r
@@ -1517,7 +1897,7 @@ ConvertDevicePathToText (
     //\r
     //  Put a path seperator in if needed\r
     //\r
-    if (Str.Len && DumpNode != DevPathToTextEndInstance) {\r
+    if ((Str.Len != 0) && DumpNode != DevPathToTextEndInstance) {\r
       if (*(Str.Str + Str.Len / sizeof (CHAR16) - 1) != L',') {\r
         CatPrint (&Str, L"/");\r
       }\r
index 4484ddae27aa322f1f3862a1999c1b485c267b59..ba031d5365d55f7d51cf07bde43f9b3c8af6e2cc 100644 (file)
@@ -14,191 +14,221 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "DevicePath.h"\r
 \r
+/**\r
+  Returns the size of a device path in bytes.\r
+\r
+  This function returns the size, in bytes, of the device path data structure specified by\r
+  DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+\r
+  @return The size of a device path in bytes.\r
+\r
+**/\r
 UINTN\r
+EFIAPI\r
 GetDevicePathSizeProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
-/*++\r
+{\r
+  return GetDevicePathSize (DevicePath);\r
+}\r
 \r
-  Routine Description:\r
-    Returns the size of the device path, in bytes.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the start of the EFI device path.\r
+/**\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
-  Returns:\r
-    Size        -   Size of the specified device path, in bytes, including the end-of-path tag.\r
+  This function allocates space for a new copy of the device path specified by DevicePath.  If\r
+  DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
+  contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+  is returned.  Otherwise, NULL is returned.\r
 \r
---*/\r
-{\r
-  return GetDevicePathSize (DevicePath);\r
-}\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+\r
+  @return A pointer to the duplicated device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 DuplicateDevicePathProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
-/*++\r
+{\r
+  return DuplicateDevicePath (DevicePath);\r
+}\r
 \r
-  Routine Description:\r
-    Create a duplicate of the specified path.\r
+/**\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the source EFI device path.\r
+  This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+  FirstDevicePath in a newly allocated buffer.  Only the end-of-device-path device node from\r
+  SecondDevicePath is retained. The newly created device path is returned.\r
+  If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.\r
+  If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.\r
+  If both FirstDevicePath and SecondDevicePath are NULL, then a copy of an end-of-device-path is\r
+  returned.\r
+  If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the\r
+  responsibility of the caller to free the memory allocated.\r
 \r
-  Returns:\r
-    Pointer     -   A pointer to the duplicate device path.\r
-    NULL        -   Insufficient memory.\r
+  @param  FirstDevicePath            A pointer to a device path data structure.\r
+  @param  SecondDevicePath           A pointer to a device path data structure.\r
 \r
---*/\r
-{\r
-  return DuplicateDevicePath (DevicePath);\r
-}\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDevicePathProtocolInterface (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath\r
   )\r
-/*++\r
+{\r
+  return AppendDevicePath (FirstDevicePath, SecondDevicePath);\r
+}\r
 \r
-  Routine Description:\r
-    Create a new path by appending the second device path to the first.\r
+/**\r
+  Creates a new path by appending the device node to the device path.\r
 \r
-  Arguments:\r
-    Src1      -   Points to the first device path. If NULL, then it is ignored.\r
-    Src2      -   Points to the second device path. If NULL, then it is ignored.\r
+  This function creates a new device path by appending a copy of the device node specified by\r
+  DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device node.\r
+  If DevicePathNode is NULL then a copy of DevicePath is returned.\r
+  If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device path device\r
+  node is returned.\r
+  If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path device node\r
+  is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
 \r
-  Returns:\r
-    Pointer   -   A pointer to the newly created device path.\r
-    NULL      -   Memory could not be allocated\r
-                  or either DevicePath or DeviceNode is NULL.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathNode             A pointer to a single device path node.\r
 \r
---*/\r
-{\r
-  return AppendDevicePath (Src1, Src2);\r
-}\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDeviceNodeProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode\r
   )\r
-/*++\r
+{\r
+  return AppendDevicePathNode (DevicePath, DevicePathNode);\r
+}\r
 \r
-  Routine Description:\r
-    Creates a new path by appending the device node to the device path.\r
+/**\r
+  Creates a new device path by appending the specified device path instance to the specified device\r
+  path.\r
 \r
-  Arguments:\r
-    DevicePath   -   Points to the device path.\r
-    DeviceNode   -   Points to the device node.\r
+  This function creates a new device path by appending a copy of the device path instance specified\r
+  by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device path instance\r
+  and a new end-of-device-path-instance node is inserted between.\r
+  If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+  If DevicePathInstance is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
 \r
-  Returns:\r
-    Pointer      -   A pointer to the allocated device node.\r
-    NULL         -   Memory could not be allocated\r
-                     or either DevicePath or DeviceNode is NULL.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathInstance         A pointer to a device path instance.\r
 \r
---*/\r
-{\r
-  return AppendDevicePathNode (DevicePath, DeviceNode);\r
-}\r
+  @return A pointer to the new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 AppendDevicePathInstanceProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Creates a new path by appending the specified device path instance to the specified device path.\r
-\r
-  Arguments:\r
-    DevicePath           -   Points to the device path. If NULL, then ignored.\r
-    DevicePathInstance   -   Points to the device path instance.\r
-\r
-  Returns:\r
-    Pointer              -   A pointer to the newly created device path\r
-    NULL                 -   Memory could not be allocated or DevicePathInstance is NULL.\r
-\r
---*/\r
 {\r
   return AppendDevicePathInstance (DevicePath, DevicePathInstance);\r
 }\r
 \r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a copy of the current device path instance. It also updates DevicePath to\r
+  point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+  to hold the size of the device path instance copy.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  If Size is NULL, then ASSERT().\r
+\r
+  @param  DevicePath                 On input, this holds the pointer to the current device path\r
+                                     instance. On output, this holds the pointer to the next device\r
+                                     path instance or NULL if there are no more device path\r
+                                     instances in the device path pointer to a device path data\r
+                                     structure.\r
+  @param  Size                       On output, this holds the size of the device path instance, in\r
+                                     bytes or zero, if DevicePath is NULL.\r
+\r
+  @return A pointer to the current device path instance.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 GetNextDevicePathInstanceProtocolInterface (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePathInstance,\r
-  OUT UINTN                         *DevicePathInstanceSize\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePath,\r
+  OUT UINTN                         *Size\r
   )\r
-/*++\r
+{\r
+  return GetNextDevicePathInstance (DevicePath, Size);\r
+}\r
 \r
-  Routine Description:\r
-    Creates a copy of the current device path instance and returns a pointer to the next device path instance.\r
+/**\r
+  Determines if a device path is single or multi-instance.\r
 \r
-  Arguments:\r
-    DevicePathInstance       -   On input, this holds the pointer to the current device path\r
-                                 instance. On output, this holds the pointer to the next\r
-                                 device path instance or NULL if there are no more device\r
-                                 path instances in the device path.\r
-    DevicePathInstanceSize   -   On output, this holds the size of the device path instance,\r
-                                 in bytes or zero, if DevicePathInstance is zero.\r
+  This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+  Otherwise, FALSE is returned.  If DevicePath is NULL, then FALSE is returned.\r
 \r
-  Returns:\r
-    Pointer                  -   A pointer to the copy of the current device path instance.\r
-    NULL                     -   DevicePathInstace was NULL on entry or there was insufficient memory.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
---*/\r
-{\r
-  return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize);\r
-}\r
+  @retval  TRUE                      DevicePath is multi-instance.\r
+  @retval  FALSE                     DevicePath is not multi-instance or DevicePath is NULL.\r
 \r
+**/\r
 BOOLEAN\r
+EFIAPI\r
 IsDevicePathMultiInstanceProtocolInterface (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
   )\r
-/*++\r
+{\r
+  return IsDevicePathMultiInstance (DevicePath);\r
+}\r
 \r
-  Routine Description:\r
-    Returns whether a device path is multi-instance.\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
 \r
-  Arguments:\r
-    DevicePath  -   Points to the device path. If NULL, then ignored.\r
+  This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+  initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
+  is returned.\r
+  If NodeLength is smaller than a device path header, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.\r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
 \r
-  Returns:\r
-    TRUE        -   The device path has more than one instance\r
-    FALSE       -   The device path is empty or contains only a single instance.\r
+  @param  NodeType                   The device node type for the new device node.\r
+  @param  NodeSubType                The device node sub-type for the new device node.\r
+  @param  NodeLength                 The length of the new device node.\r
 \r
---*/\r
-{\r
-  return IsDevicePathMultiInstance (DevicePath);\r
-}\r
+  @return The new device path.\r
 \r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
 CreateDeviceNodeProtocolInterface (\r
   IN UINT8  NodeType,\r
   IN UINT8  NodeSubType,\r
   IN UINT16 NodeLength\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Creates a device node\r
-\r
-  Arguments:\r
-    NodeType     -    NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
-                      the new device node.\r
-    NodeSubType  -    NodeSubType is the device node sub-type\r
-                      EFI_DEVICE_PATH.SubType) for the new device node.\r
-    NodeLength   -    NodeLength is the length of the device node\r
-                      (EFI_DEVICE_PATH.Length) for the new device node.\r
-\r
-  Returns:\r
-    Pointer      -    A pointer to the newly created device node.\r
-    NULL         -    NodeLength is less than\r
-                      the size of the header or there was insufficient memory.\r
-\r
---*/\r
 {\r
   return CreateDeviceNode (NodeType, NodeSubType, NodeLength);\r
 }\r