/* Changes the state of a network interface from "started" to "stopped". */
EFI_STATUS EFIAPI VirtioNetStop(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
/* Changes the state of a network interface from "started" to "stopped". */
EFI_STATUS EFIAPI VirtioNetStop(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
{
  VNET_DEV    *Dev;
  EFI_TPL     OldTpl;
  EFI_STATUS  Status;
  if (This == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Dev    = VIRTIO_NET_FROM_SNP (This);
  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
  if (Dev->Snm.State != EfiSimpleNetworkStarted) {
    Status = EFI_NOT_STARTED;
  } else {
    Dev->Snm.State = EfiSimpleNetworkStopped;
    Status         = EFI_SUCCESS;
  }
  gBS->RestoreTPL (OldTpl);
  return Status;
}