/* Converts a text device path node to NVM Express Namespace device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextNVMe(CHAR16 *TextDeviceNode)
/* Converts a text device path node to NVM Express Namespace device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextNVMe(CHAR16 *TextDeviceNode)
{
  CHAR16                     *NamespaceIdStr;
  CHAR16                     *NamespaceUuidStr;
  NVME_NAMESPACE_DEVICE_PATH *Nvme;
  UINT8                      *Uuid;
  UINTN                      Index;
  NamespaceIdStr   = GetNextParamStr (&TextDeviceNode);
  NamespaceUuidStr = GetNextParamStr (&TextDeviceNode);
  Nvme = (NVME_NAMESPACE_DEVICE_PATH *) CreateDeviceNode (
    MESSAGING_DEVICE_PATH,
    MSG_NVME_NAMESPACE_DP,
    (UINT16) sizeof (NVME_NAMESPACE_DEVICE_PATH)
    );
  Nvme->NamespaceId = (UINT32) Strtoi (NamespaceIdStr);
  Uuid = (UINT8 *) &Nvme->NamespaceUuid;
  Index = sizeof (Nvme->NamespaceUuid) / sizeof (UINT8);
  while (Index-- != 0) {
    Uuid[Index] = (UINT8) StrHexToUint64 (SplitStr (&NamespaceUuidStr, L'-'));
  }
  return (EFI_DEVICE_PATH_PROTOCOL *) Nvme;
}