/* This function will switch the IP4 configuration policy to Static. */
EFI_STATUS IScsiSetIp4Policy(IN EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2)
/* This function will switch the IP4 configuration policy to Static. */
EFI_STATUS IScsiSetIp4Policy(IN EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2)
{
  EFI_IP4_CONFIG2_POLICY  Policy;
  EFI_STATUS              Status;
  UINTN                   DataSize;
  DataSize = sizeof (EFI_IP4_CONFIG2_POLICY);
  Status   = Ip4Config2->GetData (
                           Ip4Config2,
                           Ip4Config2DataTypePolicy,
                           &DataSize,
                           &Policy
                           );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (Policy != Ip4Config2PolicyStatic) {
    Policy = Ip4Config2PolicyStatic;
    Status = Ip4Config2->SetData (
                           Ip4Config2,
                           Ip4Config2DataTypePolicy,
                           sizeof (EFI_IP4_CONFIG2_POLICY),
                           &Policy
                           );
    if (EFI_ERROR (Status)) {
      return Status;
    }
  }
  return EFI_SUCCESS;
}