/* This routine will try to invoke Snp->GetStatus() to get the media status. If media present status switches from unpresent to present, a link movement is detected. Note that the underlying UNDI driver may not support reporting media status from GET_STATUS command. If that, fail to detect link movement. */
BOOLEAN Dhcp6LinkMovDetect(IN DHCP6_INSTANCE *Instance)
/* This routine will try to invoke Snp->GetStatus() to get the media status. If media present status switches from unpresent to present, a link movement is detected. Note that the underlying UNDI driver may not support reporting media status from GET_STATUS command. If that, fail to detect link movement. */
BOOLEAN Dhcp6LinkMovDetect(IN DHCP6_INSTANCE *Instance)
{
  UINT32                       InterruptStatus;
  BOOLEAN                      MediaPresent;
  EFI_STATUS                   Status;
  EFI_SIMPLE_NETWORK_PROTOCOL  *Snp;
  ASSERT (Instance != NULL);
  Snp          = Instance->Service->Snp;
  MediaPresent = Instance->MediaPresent;
  if (!Snp->Mode->MediaPresentSupported) {
    return FALSE;
  }
  Status = Snp->GetStatus (Snp, &InterruptStatus, NULL);
  if (EFI_ERROR (Status)) {
    return FALSE;
  }
  Instance->MediaPresent = Snp->Mode->MediaPresent;
  if (!MediaPresent && Instance->MediaPresent) {
    return TRUE;
  }
  return FALSE;
}