2 Header file for IP4Config driver.
4 Copyright (c) 2006 - 2008, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at<BR>
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _EFI_IP4CONFIG_H_
16 #define _EFI_IP4CONFIG_H_
20 #include <Protocol/Dhcp4.h>
21 #include <Protocol/Ip4Config.h>
22 #include <Protocol/ManagedNetwork.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiRuntimeServicesTableLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/NetLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/MemoryAllocationLib.h>
33 #include "NicIp4Variable.h"
35 typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE
;
38 IP4_CONFIG_STATE_IDLE
= 0,
39 IP4_CONFIG_STATE_STARTED
,
40 IP4_CONFIG_STATE_CONFIGURED
43 #define IP4_PROTO_ICMP 0x01
44 #define IP4_CONFIG_INSTANCE_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'C')
47 DHCP_TAG_PARA_LIST
= 55,
53 // Configure the DHCP to request the routers and netmask
54 // from server. The DHCP_TAG_NETMASK is included in Head.
58 EFI_DHCP4_PACKET_OPTION Head
;
60 } IP4_CONFIG_DHCP4_OPTION
;
63 struct _IP4_CONFIG_INSTANCE
{
65 EFI_HANDLE Controller
;
68 EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol
;
69 EFI_NIC_IP4_CONFIG_PROTOCOL NicIp4Protocol
;
72 // NicConfig's state, such as IP4_CONFIG_STATE_IDLE
77 // Mnp child to keep the connection with MNP.
79 EFI_MANAGED_NETWORK_PROTOCOL
*Mnp
;
83 // User's requests data
86 EFI_EVENT ReconfigEvent
;
90 // Identity of this interface and some configuration info.
93 UINT16 NicName
[IP4_NIC_NAME_LENGTH
];
95 NIC_IP4_CONFIG_INFO
*NicConfig
;
98 // DHCP handles to access DHCP
100 EFI_DHCP4_PROTOCOL
*Dhcp4
;
101 EFI_HANDLE Dhcp4Handle
;
102 EFI_EVENT Dhcp4Event
;
105 #define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \
106 CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)
108 #define IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG(this) \
109 CR (this, IP4_CONFIG_INSTANCE, NicIp4Protocol, IP4_CONFIG_INSTANCE_SIGNATURE)
111 extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding
;
112 extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName
;
113 extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2
;
114 extern IP4_CONFIG_INSTANCE
*mIp4ConfigNicList
[MAX_IP4_CONFIG_IN_VARIABLE
];
115 extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate
;
116 extern EFI_NIC_IP4_CONFIG_PROTOCOL mNicIp4ConfigProtocolTemplate
;
119 Release all the DHCP related resources.
121 @param This The IP4 configure instance
127 Ip4ConfigCleanDhcp4 (
128 IN IP4_CONFIG_INSTANCE
*This
132 Clean up all the configuration parameters.
134 @param Instance The IP4 configure instance
140 Ip4ConfigCleanConfig (
141 IN IP4_CONFIG_INSTANCE
*Instance