X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Impl.h;h=a322a85981a57ec10d7c6b6c57889201fefe4aa4;hp=43d6765add8910f7a84bf0e3a6c941f98e52f39c;hb=9d510e61fceee7b92955ef9a3c20343752d8ce3f;hpb=a1503a32a887c0b9a735613a7caf5d1493affd01
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
index 43d6765add..a322a85981 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
@@ -1,14 +1,10 @@
/** @file
Ip4 internal functions and type defintions.
-
-Copyright (c) 2005 - 2009, Intel Corporation.
-All rights reserved. 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
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -19,9 +15,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include
#include
-#include
+#include
#include
#include
+#include
+#include
+#include
+
+#include
#include
#include
@@ -33,6 +34,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include
#include
#include
+#include
+#include
+#include
+#include
#include "Ip4Common.h"
#include "Ip4Driver.h"
@@ -43,6 +48,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Ip4Route.h"
#include "Ip4Input.h"
#include "Ip4Output.h"
+#include "Ip4Config2Impl.h"
+#include "Ip4Config2Nv.h"
+#include "Ip4NvData.h"
#define IP4_PROTOCOL_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'P')
#define IP4_SERVICE_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'S')
@@ -50,23 +58,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// The state of IP4 protocol. It starts from UNCONFIGED. if it is
// successfully configured, it goes to CONFIGED. if configure NULL
-// is called, it becomes UNCONFIGED again. If (partly) destoried, it
-// becomes DESTORY.
+// is called, it becomes UNCONFIGED again.
//
#define IP4_STATE_UNCONFIGED 0
#define IP4_STATE_CONFIGED 1
-#define IP4_STATE_DESTORY 2
//
// The state of IP4 service. It starts from UNSTARTED. It transits
// to STARTED if autoconfigure is started. If default address is
-// configured, it becomes CONFIGED. and if partly destoried, it goes
-// to DESTORY.
+// configured, it becomes CONFIGED. and if partly destroyed, it goes
+// to DESTROY.
//
#define IP4_SERVICE_UNSTARTED 0
#define IP4_SERVICE_STARTED 1
#define IP4_SERVICE_CONFIGED 2
-#define IP4_SERVICE_DESTORY 3
+#define IP4_SERVICE_DESTROY 3
///
@@ -122,6 +128,8 @@ struct _IP4_PROTOCOL {
EFI_HANDLE Handle;
INTN State;
+ BOOLEAN InDestroy;
+
IP4_SERVICE *Service;
LIST_ENTRY Link; // Link to all the IP protocol from the service
@@ -160,7 +168,6 @@ struct _IP4_SERVICE {
UINT32 Signature;
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
INTN State;
- BOOLEAN InDestory;
//
// List of all the IP instances and interfaces, and default
@@ -193,20 +200,23 @@ struct _IP4_SERVICE {
EFI_SIMPLE_NETWORK_MODE SnpMode;
EFI_EVENT Timer;
+ EFI_EVENT ReconfigCheckTimer;
+ EFI_EVENT ReconfigEvent;
+
+ BOOLEAN Reconfig;
//
- // Auto configure staff
+ // Underlying media present status.
//
- EFI_IP4_CONFIG_PROTOCOL *Ip4Config;
- EFI_EVENT DoneEvent;
- EFI_EVENT ReconfigEvent;
- EFI_EVENT ActiveEvent;
+ BOOLEAN MediaPresent;
//
- // The string representation of the current mac address of the
- // NIC this IP4_SERVICE works on.
+ // IPv4 Configuration II Protocol instance
//
+ IP4_CONFIG2_INSTANCE Ip4Config2Instance;
+
CHAR16 *MacString;
+
UINT32 MaxPacketSize;
UINT32 OldMaxPacketSize; ///< The MTU before IPsec enable.
};
@@ -217,6 +227,10 @@ struct _IP4_SERVICE {
#define IP4_SERVICE_FROM_PROTOCOL(Sb) \
CR ((Sb), IP4_SERVICE, ServiceBinding, IP4_SERVICE_SIGNATURE)
+#define IP4_SERVICE_FROM_CONFIG2_INSTANCE(This) \
+ CR (This, IP4_SERVICE, Ip4Config2Instance, IP4_SERVICE_SIGNATURE)
+
+
#define IP4_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)
extern EFI_IP4_PROTOCOL mEfiIp4ProtocolTemplete;
@@ -263,8 +277,8 @@ Ip4InitProtocol (
@param[in] IpInstance The IP4 child to clean up.
- @retval EFI_SUCCESS The IP4 child is cleaned up
- @retval EFI_DEVICE_ERROR Some resources failed to be released
+ @retval EFI_SUCCESS The IP4 child is cleaned up.
+ @retval EFI_DEVICE_ERROR Some resources failed to be released.
**/
EFI_STATUS
@@ -275,13 +289,13 @@ Ip4CleanProtocol (
/**
Cancel the user's receive/transmit request.
- @param[in] IpInstance The IP4 child
+ @param[in] IpInstance The IP4 child.
@param[in] Token The token to cancel. If NULL, all token will be
cancelled.
- @retval EFI_SUCCESS The token is cancelled
+ @retval EFI_SUCCESS The token is cancelled.
@retval EFI_NOT_FOUND The token isn't found on either the
- transmit/receive queue
+ transmit/receive queue.
@retval EFI_DEVICE_ERROR Not all token is cancelled when Token is NULL.
**/
@@ -314,10 +328,9 @@ Ip4Groups (
);
/**
- The heart beat timer of IP4 service instance. It times out
- all of its IP4 children's received-but-not-delivered and
- transmitted-but-not-recycle packets, and provides time input
- for its IGMP protocol.
+ This heart beat timer of IP4 service instance times out all of its IP4 children's
+ received-but-not-delivered and transmitted-but-not-recycle packets, and provides
+ time input for its IGMP protocol.
@param[in] Event The IP4 service instance's heart beat timer.
@param[in] Context The IP4 service instance.
@@ -330,6 +343,25 @@ Ip4TimerTicking (
IN VOID *Context
);
+/**
+ This dedicated timer is used to poll underlying network media status. In case
+ of cable swap or wireless network switch, a new round auto configuration will
+ be initiated. The timer will signal the IP4 to run DHCP configuration again.
+ IP4 driver will free old IP address related resource, such as route table and
+ Interface, then initiate a DHCP process to acquire new IP, eventually create
+ route table for new IP address.
+
+ @param[in] Event The IP4 service instance's heart beat timer.
+ @param[in] Context The IP4 service instance.
+
+**/
+VOID
+EFIAPI
+Ip4TimerReconfigChecking (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
/**
Decrease the life of the transmitted packets. If it is
decreased to zero, cancel the packet. This function is
@@ -338,13 +370,14 @@ Ip4TimerTicking (
packets.
@param[in] Map The IP4 child's transmit map.
- @param[in] Item Current transmitted packet
+ @param[in] Item Current transmitted packet.
@param[in] Context Not used.
- @retval EFI_SUCCESS Always returns EFI_SUCCESS
+ @retval EFI_SUCCESS Always returns EFI_SUCCESS.
**/
EFI_STATUS
+EFIAPI
Ip4SentPacketTicking (
IN NET_MAP *Map,
IN NET_MAP_ITEM *Item,
@@ -369,14 +402,16 @@ Ip4SentPacketTicking (
are bound together. Check the comments in Ip4Output for information
about IP fragmentation.
- @param[in] Context The token's wrap
+ @param[in] Context The token's wrap.
**/
VOID
+EFIAPI
Ip4FreeTxToken (
IN VOID *Context
);
-extern EFI_IPSEC_PROTOCOL *mIpSec;
+extern EFI_IPSEC2_PROTOCOL *mIpSec;
+extern BOOLEAN mIpSec2Installed;
#endif