X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Impl.h;h=ddca6ce897f6ecdee0e46d1af6ec2b50893bf473;hb=3028d73e5a4073841fdfc94b1e984c92e8e8fa7a;hp=b43f6073207bc8bce45c24d395ec3a1c74e89815;hpb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index b43f607320..ddca6ce897 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -1,7 +1,9 @@ /** @file Ip4 internal functions and type defintions. - -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+ +Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
+ 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 @@ -19,9 +21,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 +40,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 +54,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 +64,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 +134,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 +174,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 +206,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 +233,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 +283,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 +295,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 +334,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 +349,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,10 +376,10 @@ 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 @@ -370,7 +408,7 @@ 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 @@ -379,6 +417,7 @@ Ip4FreeTxToken ( IN VOID *Context ); -extern EFI_IPSEC_PROTOCOL *mIpSec; +extern EFI_IPSEC2_PROTOCOL *mIpSec; +extern BOOLEAN mIpSec2Installed; #endif