/* This function stops a network interface. This call is only valid if the network interface is in the started state. If the network interface was successfully stopped, then EFI_SUCCESS will be returned. */
EFI_STATUS EFIAPI SnpUndi32Stop(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
/* This function stops a network interface. This call is only valid if the network interface is in the started state. If the network interface was successfully stopped, then EFI_SUCCESS will be returned. */
EFI_STATUS EFIAPI SnpUndi32Stop(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
{
  SNP_DRIVER  *Snp;
  EFI_TPL     OldTpl;
  EFI_STATUS  Status;
  if (This == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
  switch (Snp->Mode.State) {
    case EfiSimpleNetworkStarted:
      break;
    case EfiSimpleNetworkStopped:
      Status = EFI_NOT_STARTED;
      goto ON_EXIT;
    default:
      Status = EFI_DEVICE_ERROR;
      goto ON_EXIT;
  }
  Status = PxeStop (Snp);
ON_EXIT:
  gBS->RestoreTPL (OldTpl);
  return Status;
}