]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
MdeModulePkg Ip4Dxe: Remove a redundant function
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.h
index c49e013c8f44e069a1bb751d6781455d2e37a431..ddca6ce897f6ecdee0e46d1af6ec2b50893bf473 100644 (file)
@@ -1,7 +1,9 @@
 /** @file\r
   Ip4 internal functions and type defintions.\r
-  \r
-Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
+\r
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
+\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,9 +21,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Protocol/IpSec.h>\r
 #include <Protocol/Ip4.h>\r
-#include <Protocol/Ip4Config.h>\r
+#include <Protocol/Ip4Config2.h>\r
 #include <Protocol/Arp.h>\r
 #include <Protocol/ManagedNetwork.h>\r
+#include <Protocol/Dhcp4.h>\r
+#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
+\r
+#include <IndustryStandard/Dhcp.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
@@ -34,6 +41,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/DpcLib.h>\r
 #include <Library/PrintLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
 \r
 #include "Ip4Common.h"\r
 #include "Ip4Driver.h"\r
@@ -44,6 +54,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Ip4Route.h"\r
 #include "Ip4Input.h"\r
 #include "Ip4Output.h"\r
+#include "Ip4Config2Impl.h"\r
+#include "Ip4Config2Nv.h"\r
+#include "Ip4NvData.h"\r
 \r
 #define IP4_PROTOCOL_SIGNATURE  SIGNATURE_32 ('I', 'P', '4', 'P')\r
 #define IP4_SERVICE_SIGNATURE   SIGNATURE_32 ('I', 'P', '4', 'S')\r
@@ -51,12 +64,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // The state of IP4 protocol. It starts from UNCONFIGED. if it is\r
 // successfully configured, it goes to CONFIGED. if configure NULL\r
-// is called, it becomes UNCONFIGED again. If (partly) destroyed, it\r
-// becomes DESTROY.\r
+// is called, it becomes UNCONFIGED again.\r
 //\r
 #define IP4_STATE_UNCONFIGED    0\r
 #define IP4_STATE_CONFIGED      1\r
-#define IP4_STATE_DESTROY       2\r
 \r
 //\r
 // The state of IP4 service. It starts from UNSTARTED. It transits\r
@@ -123,6 +134,8 @@ struct _IP4_PROTOCOL {
   EFI_HANDLE                Handle;\r
   INTN                      State;\r
 \r
+  BOOLEAN                   InDestroy;\r
+\r
   IP4_SERVICE               *Service;\r
   LIST_ENTRY                Link;       // Link to all the IP protocol from the service\r
 \r
@@ -193,14 +206,22 @@ struct _IP4_SERVICE {
   EFI_SIMPLE_NETWORK_MODE         SnpMode;\r
 \r
   EFI_EVENT                       Timer;\r
+  EFI_EVENT                       ReconfigCheckTimer;\r
+  EFI_EVENT                       ReconfigEvent;\r
+\r
+  BOOLEAN                         Reconfig;\r
 \r
   //\r
-  // Auto configure staff\r
+  // Underlying media present status.\r
   //\r
-  EFI_IP4_CONFIG_PROTOCOL         *Ip4Config;\r
-  EFI_EVENT                       DoneEvent;\r
-  EFI_EVENT                       ReconfigEvent;\r
-  EFI_EVENT                       ActiveEvent;\r
+  BOOLEAN                         MediaPresent;\r
+\r
+  //\r
+  // IPv4 Configuration II Protocol instance\r
+  //\r
+  IP4_CONFIG2_INSTANCE            Ip4Config2Instance;\r
+\r
+  CHAR16                          *MacString;\r
 \r
   UINT32                          MaxPacketSize;\r
   UINT32                          OldMaxPacketSize; ///< The MTU before IPsec enable.\r
@@ -212,6 +233,10 @@ struct _IP4_SERVICE {
 #define IP4_SERVICE_FROM_PROTOCOL(Sb)   \\r
           CR ((Sb), IP4_SERVICE, ServiceBinding, IP4_SERVICE_SIGNATURE)\r
 \r
+#define IP4_SERVICE_FROM_CONFIG2_INSTANCE(This) \\r
+  CR (This, IP4_SERVICE, Ip4Config2Instance, IP4_SERVICE_SIGNATURE)\r
+\r
+\r
 #define IP4_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)\r
 \r
 extern EFI_IP4_PROTOCOL mEfiIp4ProtocolTemplete;\r
@@ -258,8 +283,8 @@ Ip4InitProtocol (
 \r
   @param[in]  IpInstance         The IP4 child to clean up.\r
 \r
-  @retval EFI_SUCCESS            The IP4 child is cleaned up\r
-  @retval EFI_DEVICE_ERROR       Some resources failed to be released\r
+  @retval EFI_SUCCESS            The IP4 child is cleaned up.\r
+  @retval EFI_DEVICE_ERROR       Some resources failed to be released.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -270,13 +295,13 @@ Ip4CleanProtocol (
 /**\r
   Cancel the user's receive/transmit request.\r
 \r
-  @param[in]  IpInstance         The IP4 child\r
+  @param[in]  IpInstance         The IP4 child.\r
   @param[in]  Token              The token to cancel. If NULL, all token will be\r
                                  cancelled.\r
 \r
-  @retval EFI_SUCCESS            The token is cancelled\r
+  @retval EFI_SUCCESS            The token is cancelled.\r
   @retval EFI_NOT_FOUND          The token isn't found on either the\r
-                                 transmit/receive queue\r
+                                 transmit/receive queue.\r
   @retval EFI_DEVICE_ERROR       Not all token is cancelled when Token is NULL.\r
 \r
 **/\r
@@ -309,10 +334,9 @@ Ip4Groups (
   );\r
 \r
 /**\r
-  The heart beat timer of IP4 service instance. It times out\r
-  all of its IP4 children's received-but-not-delivered and\r
-  transmitted-but-not-recycle packets, and provides time input\r
-  for its IGMP protocol.\r
+  This heart beat timer of IP4 service instance times out all of its IP4 children's\r
+  received-but-not-delivered and transmitted-but-not-recycle packets, and provides\r
+  time input for its IGMP protocol.\r
 \r
   @param[in]  Event                  The IP4 service instance's heart beat timer.\r
   @param[in]  Context                The IP4 service instance.\r
@@ -325,6 +349,25 @@ Ip4TimerTicking (
   IN VOID                   *Context\r
   );\r
 \r
+/**\r
+  This dedicated timer is used to poll underlying network media status. In case\r
+  of cable swap or wireless network switch, a new round auto configuration will\r
+  be initiated. The timer will signal the IP4 to run DHCP configuration again.\r
+  IP4 driver will free old IP address related resource, such as route table and\r
+  Interface, then initiate a DHCP process to acquire new IP, eventually create\r
+  route table for new IP address.\r
+\r
+  @param[in]  Event                  The IP4 service instance's heart beat timer.\r
+  @param[in]  Context                The IP4 service instance.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+Ip4TimerReconfigChecking (\r
+  IN EFI_EVENT              Event,\r
+  IN VOID                   *Context\r
+  );\r
+\r
 /**\r
   Decrease the life of the transmitted packets. If it is\r
   decreased to zero, cancel the packet. This function is\r
@@ -333,10 +376,10 @@ Ip4TimerTicking (
   packets.\r
 \r
   @param[in]  Map                    The IP4 child's transmit map.\r
-  @param[in]  Item                   Current transmitted packet\r
+  @param[in]  Item                   Current transmitted packet.\r
   @param[in]  Context                Not used.\r
 \r
-  @retval EFI_SUCCESS            Always returns EFI_SUCCESS\r
+  @retval EFI_SUCCESS            Always returns EFI_SUCCESS.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -365,7 +408,7 @@ Ip4SentPacketTicking (
   are bound together. Check the comments in Ip4Output for information\r
   about IP fragmentation.\r
 \r
-  @param[in]  Context                The token's wrap\r
+  @param[in]  Context                The token's wrap.\r
 \r
 **/\r
 VOID\r
@@ -375,5 +418,6 @@ Ip4FreeTxToken (
   );\r
 \r
 extern EFI_IPSEC2_PROTOCOL   *mIpSec;\r
+extern BOOLEAN               mIpSec2Installed;\r
 \r
 #endif\r