/* Converts a text device path node to SATA device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextSata(IN CHAR16 *TextDeviceNode)
/* Converts a text device path node to SATA device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextSata(IN CHAR16 *TextDeviceNode)
{
  SATA_DEVICE_PATH  *Sata;
  CHAR16            *Param1;
  CHAR16            *Param2;
  CHAR16            *Param3;
  Param1 = GetNextParamStr (&TextDeviceNode);
  Param2 = GetNextParamStr (&TextDeviceNode);
  Param3 = GetNextParamStr (&TextDeviceNode);
  Sata = (SATA_DEVICE_PATH *)CreateDeviceNode (
                               MESSAGING_DEVICE_PATH,
                               MSG_SATA_DP,
                               (UINT16)sizeof (SATA_DEVICE_PATH)
                               );
  Sata->HBAPortNumber = (UINT16)Strtoi (Param1);
  if (*Param2 == L'\0' ) {
    Sata->PortMultiplierPortNumber = 0xFFFF;
  } else {
    Sata->PortMultiplierPortNumber = (UINT16)Strtoi (Param2);
  }
  Sata->Lun = (UINT16)Strtoi (Param3);
  return (EFI_DEVICE_PATH_PROTOCOL *)Sata;
}