/* Initialize the timer event for RTT (round trip time). */
EFI_STATUS PingInitRttTimer(PING_PRIVATE_DATA *Private)
/* Initialize the timer event for RTT (round trip time). */
EFI_STATUS PingInitRttTimer(PING_PRIVATE_DATA *Private)
{
  EFI_STATUS  Status;
  Private->TimerPeriod = GetTimerPeriod ();
  if (Private->TimerPeriod == 0) {
    return EFI_ABORTED;
  }
  Private->RttTimerTick = 0;
  Status                = gBS->CreateEvent (
                                 EVT_TIMER | EVT_NOTIFY_SIGNAL,
                                 TPL_NOTIFY,
                                 RttTimerTickRoutine,
                                 &Private->RttTimerTick,
                                 &Private->RttTimer
                                 );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = gBS->SetTimer (
                  Private->RttTimer,
                  TimerPeriodic,
                  TICKS_PER_MS
                  );
  if (EFI_ERROR (Status)) {
    gBS->CloseEvent (Private->RttTimer);
    return Status;
  }
  return EFI_SUCCESS;
}