Reviewed-by: Fu Siyuan <siyuan...@intel.com>
> -----Original Message----- > From: Wu, Jiaxin > Sent: Thursday, February 25, 2016 12:22 PM > To: edk2-devel@lists.01.org > Cc: Subramanian Sriram <srira...@hpe.com>; El-Haj-Mahmoud Samer > <samer.el-haj-mahm...@hpe.com>; Ye, Ting <ting...@intel.com>; Fu, > Siyuan <siyuan...@intel.com> > Subject: [Patch 3/4] NetworkPkg: Revert git 'eb213f2f' fix > > 'eb213f2f' is associated with '3d0a49ad' commit. So, this patch is > used to respond the revert for '3d0a49ad' to adapt the Ipv4 config > policy update. > > Cc: Subramanian Sriram <srira...@hpe.com> > Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahm...@hpe.com> > Cc: Ye Ting <ting...@intel.com> > Cc: Fu Siyuan <siyuan...@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiaxin Wu <jiaxin...@intel.com> > --- > NetworkPkg/DnsDxe/DnsDhcp.c | 158 > +------------------------------------------ > NetworkPkg/DnsDxe/DnsDxe.inf | 4 +- > 2 files changed, 2 insertions(+), 160 deletions(-) > > diff --git a/NetworkPkg/DnsDxe/DnsDhcp.c b/NetworkPkg/DnsDxe/DnsDhcp.c > index 6b409ba..00fc0ef 100644 > --- a/NetworkPkg/DnsDxe/DnsDhcp.c > +++ b/NetworkPkg/DnsDxe/DnsDhcp.c > @@ -1,9 +1,9 @@ > /** @file > Functions implementation related with DHCPv4/v6 for DNS driver. > > -Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> > +Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD > License > which accompanies this distribution. The full text of the license may be > found at > http://opensource.org/licenses/bsd-license.php > > @@ -13,156 +13,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF > ANY KIND, EITHER EXPRESS OR IMPLIED. > **/ > > #include "DnsImpl.h" > > /** > - The callback function for the timer event used to get map. > - > - @param[in] Event The event this function is registered to. > - @param[in] Context The context registered to the event. > -**/ > -VOID > -EFIAPI > -TimeoutToGetMap ( > - IN EFI_EVENT Event, > - IN VOID *Context > - ) > -{ > - *((BOOLEAN *) Context) = TRUE; > - return ; > -} > - > -/** > - Create an IP child, use it to start the auto configuration, then destroy > it. > - > - @param[in] Controller The controller which has the service installed. > - @param[in] Image The image handle used to open service. > - > - @retval EFI_SUCCESS The configuration is done. > - @retval Others Other errors as indicated. > -**/ > -EFI_STATUS > -EFIAPI > -DnsStartIp4( > - IN EFI_HANDLE Controller, > - IN EFI_HANDLE Image > - ) > -{ > - EFI_IP4_PROTOCOL *Ip4; > - EFI_HANDLE Ip4Handle; > - EFI_EVENT TimerToGetMap; > - EFI_IP4_CONFIG_DATA Ip4ConfigData; > - EFI_IP4_MODE_DATA Ip4Mode; > - EFI_STATUS Status; > - > - BOOLEAN Timeout; > - > - // > - // Get the Ip4ServiceBinding Protocol > - // > - Ip4Handle = NULL; > - Ip4 = NULL; > - TimerToGetMap = NULL; > - > - Timeout = FALSE; > - > - Status = NetLibCreateServiceChild ( > - Controller, > - Image, > - &gEfiIp4ServiceBindingProtocolGuid, > - &Ip4Handle > - ); > - > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - Status = gBS->OpenProtocol ( > - Ip4Handle, > - &gEfiIp4ProtocolGuid, > - (VOID **) &Ip4, > - Controller, > - Image, > - EFI_OPEN_PROTOCOL_GET_PROTOCOL > - ); > - > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > - > - Ip4ConfigData.DefaultProtocol = EFI_IP_PROTO_ICMP; > - Ip4ConfigData.AcceptAnyProtocol = FALSE; > - Ip4ConfigData.AcceptIcmpErrors = FALSE; > - Ip4ConfigData.AcceptBroadcast = FALSE; > - Ip4ConfigData.AcceptPromiscuous = FALSE; > - Ip4ConfigData.UseDefaultAddress = TRUE; > - ZeroMem (&Ip4ConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS)); > - ZeroMem (&Ip4ConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS)); > - Ip4ConfigData.TypeOfService = 0; > - Ip4ConfigData.TimeToLive = 1; > - Ip4ConfigData.DoNotFragment = FALSE; > - Ip4ConfigData.RawData = FALSE; > - Ip4ConfigData.ReceiveTimeout = 0; > - Ip4ConfigData.TransmitTimeout = 0; > - > - Status = Ip4->Configure (Ip4, &Ip4ConfigData); > - > - if (Status == EFI_NO_MAPPING) { > - Status = gBS->CreateEvent ( > - EVT_NOTIFY_SIGNAL | EVT_TIMER, > - TPL_CALLBACK, > - TimeoutToGetMap, > - &Timeout, > - &TimerToGetMap > - ); > - > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > - > - Status = gBS->SetTimer ( > - TimerToGetMap, > - TimerRelative, > - MultU64x32 (10000000, 5) > - ); > - > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > - > - while (!Timeout) { > - Ip4->Poll (Ip4); > - > - if (!EFI_ERROR (Ip4->GetModeData (Ip4, &Ip4Mode, NULL, NULL)) && > - Ip4Mode.IsConfigured) { > - break; > - } > - } > - > - if (Timeout) { > - Status = EFI_DEVICE_ERROR; > - } > - } > - > -ON_EXIT: > - > - if (TimerToGetMap != NULL) { > - gBS->SetTimer (TimerToGetMap, TimerCancel, 0); > - gBS->CloseEvent (TimerToGetMap); > - } > - > - NetLibDestroyServiceChild ( > - Controller, > - Image, > - &gEfiIp4ServiceBindingProtocolGuid, > - Ip4Handle > - ); > - > - return Status; > -} > - > -/** > This function initialize the DHCP4 message instance. > > This function will pad each item of dhcp4 message packet. > > @param Seed Pointer to the message instance of the DHCP4 > packet. > @@ -467,20 +321,10 @@ GetDns4ServerFromDhcp4 ( > if (!MediaPresent) { > return EFI_NO_MEDIA; > } > > // > - // Start the auto configuration if UseDefaultSetting. > - // > - if (Instance->Dns4CfgData.UseDefaultSetting) { > - Status = DnsStartIp4 (Controller, Image); > - if (EFI_ERROR(Status)) { > - return Status; > - } > - } > - > - // > // Create a Mnp child instance, get the protocol and config for it. > // > Status = NetLibCreateServiceChild ( > Controller, > Image, > diff --git a/NetworkPkg/DnsDxe/DnsDxe.inf b/NetworkPkg/DnsDxe/DnsDxe.inf > index bf9dc3d..483cfac 100644 > --- a/NetworkPkg/DnsDxe/DnsDxe.inf > +++ b/NetworkPkg/DnsDxe/DnsDxe.inf > @@ -1,9 +1,9 @@ > ## @file > # Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL > interfaces. > # > -# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> > +# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR> > # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the > BSD License > # which accompanies this distribution. The full text of the license may be > found at > # http://opensource.org/licenses/bsd-license.php > @@ -60,12 +60,10 @@ > gEfiUdp4ServiceBindingProtocolGuid ## TO_START > gEfiUdp4ProtocolGuid ## TO_START > gEfiDhcp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES > gEfiDhcp4ProtocolGuid ## SOMETIMES_CONSUMES > gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES > - gEfiIp4ServiceBindingProtocolGuid ## SOMETIMES_CONSUMES > - gEfiIp4ProtocolGuid ## SOMETIMES_CONSUMES > gEfiManagedNetworkServiceBindingProtocolGuid ## > SOMETIMES_CONSUMES > gEfiManagedNetworkProtocolGuid ## SOMETIMES_CONSUMES > > gEfiDns6ServiceBindingProtocolGuid ## BY_START > gEfiDns6ProtocolGuid ## BY_START > -- > 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel