/* Converts a generic text device path node to device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextGenericPath(UINT8 Type, CHAR16 *TextDeviceNode)
/* Converts a generic text device path node to device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextGenericPath(UINT8 Type, CHAR16 *TextDeviceNode)
{
  EFI_DEVICE_PATH_PROTOCOL *Node;
  CHAR16                   *SubtypeStr;
  CHAR16                   *DataStr;
  UINTN                    DataLength;
  SubtypeStr = GetNextParamStr (&TextDeviceNode);
  DataStr    = GetNextParamStr (&TextDeviceNode);
  if (DataStr == NULL) {
    DataLength = 0;
  } else {
    DataLength = StrLen (DataStr) / 2;
  }
  Node = CreateDeviceNode (
           Type,
           (UINT8) Strtoi (SubtypeStr),
           (UINT16) (sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
           );
  StrHexToBytes (DataStr, DataLength * 2, (UINT8 *) (Node + 1), DataLength);
  return Node;
}