/* The Stop() function is used to stop the DHCP configuration process. After this function is called successfully, the EFI DHCPv4 Protocol driver is transferred into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called before DHCP configuration process can be started again. This function can be called when the EFI DHCPv4 Protocol driver is in any state. */
EFI_STATUS EFIAPI EfiDhcp4Stop(IN EFI_DHCP4_PROTOCOL *This)
/* The Stop() function is used to stop the DHCP configuration process. After this function is called successfully, the EFI DHCPv4 Protocol driver is transferred into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called before DHCP configuration process can be started again. This function can be called when the EFI DHCPv4 Protocol driver is in any state. */
EFI_STATUS EFIAPI EfiDhcp4Stop(IN EFI_DHCP4_PROTOCOL *This)
{
  DHCP_PROTOCOL  *Instance;
  DHCP_SERVICE   *DhcpSb;
  EFI_TPL        OldTpl;
  if (This == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Instance = DHCP_INSTANCE_FROM_THIS (This);
  if (Instance->Signature != DHCP_PROTOCOL_SIGNATURE) {
    return EFI_INVALID_PARAMETER;
  }
  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
  DhcpSb = Instance->Service;
  DhcpCleanLease (DhcpSb);
  DhcpSb->DhcpState    = Dhcp4Stopped;
  DhcpSb->ServiceState = DHCP_UNCONFIGED;
  gBS->RestoreTPL (OldTpl);
  return EFI_SUCCESS;
}