/** @file\r
Header file for IP4Config driver.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\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<BR>\r
http://opensource.org/licenses/bsd-license.php\r
#include <Protocol/HiiConfigAccess.h>\r
#include <Protocol/HiiDatabase.h>\r
#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/ServiceBinding.h>\r
\r
#include <Guid/MdeModuleHii.h>\r
\r
#include <Library/HiiLib.h>\r
#include <Library/PrintLib.h>\r
#include <Library/DpcLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
\r
#include "NicIp4Variable.h"\r
\r
extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;\r
extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;\r
extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2;\r
- \r
+\r
extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;\r
\r
} IP4_CONFIG_DHCP4_OPTION;\r
#pragma pack()\r
\r
-\r
-typedef struct {\r
- UINTN DeviceNum;\r
- BOOLEAN Enabled;\r
- EFI_IPv4_ADDRESS LocalIp;\r
- EFI_IPv4_ADDRESS SubnetMask;\r
- EFI_IPv4_ADDRESS Gateway;\r
-} IP4_CONFIG_SESSION_DATA;\r
-\r
-typedef struct _IP4_CONFIG_FORM_ENTRY {\r
- LIST_ENTRY Link;\r
- IP4_CONFIG_INSTANCE *Ip4ConfigInstance;\r
- EFI_HANDLE Controller;\r
- CHAR16 *MacString;\r
- EFI_STRING_ID PortTitleToken;\r
- EFI_STRING_ID PortTitleHelpToken;\r
- IP4_CONFIG_SESSION_DATA SessionConfigData;\r
-} IP4CONFIG_FORM_ENTRY;\r
-\r
-#define IP4CONFIG_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'C')\r
-\r
-typedef struct _IP4_FORM_CALLBACK_INFO_INSTANCE {\r
- UINTN Signature;\r
- EFI_HANDLE DriverHandle;\r
- EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;\r
- EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;\r
- EFI_HII_HANDLE RegisteredHandle;\r
- IP4CONFIG_FORM_ENTRY *Current;\r
-} IP4_FORM_CALLBACK_INFO;\r
-\r
-#define IP4CONFIG_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \\r
- CR ( \\r
- Callback, \\r
- IP4_FORM_CALLBACK_INFO, \\r
- ConfigAccess, \\r
- IP4CONFIG_FORM_CALLBACK_INFO_SIGNATURE \\r
- )\r
+typedef struct _IP4CONFIG_CALLBACK_INFO {\r
+ BOOLEAN Configured;\r
+ BOOLEAN DhcpEnabled;\r
+ EFI_IPv4_ADDRESS LocalIp;\r
+ EFI_IPv4_ADDRESS SubnetMask;\r
+ EFI_IPv4_ADDRESS Gateway;\r
+} IP4_SETTING_INFO;\r
\r
struct _IP4_CONFIG_INSTANCE {\r
- UINT32 Signature;\r
- EFI_HANDLE Controller;\r
- EFI_HANDLE Image;\r
+ UINT32 Signature;\r
+ EFI_HANDLE Controller;\r
+ EFI_HANDLE Image;\r
+ EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r
\r
- EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;\r
+ EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;\r
\r
- IP4_FORM_CALLBACK_INFO Ip4FormCallbackInfo;\r
+ EFI_HII_CONFIG_ACCESS_PROTOCOL HiiConfigAccessProtocol;\r
+ EFI_HANDLE ChildHandle;\r
+ EFI_DEVICE_PATH_PROTOCOL *HiiVendorDevicePath;\r
+ EFI_HII_HANDLE RegisteredHandle;\r
+ IP4_SETTING_INFO Ip4ConfigCallbackInfo;\r
\r
//\r
// NicConfig's state, such as IP4_CONFIG_STATE_IDLE\r
//\r
- INTN State;\r
+ INTN State;\r
\r
//\r
// Mnp child to keep the connection with MNP.\r
//\r
- EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
- EFI_HANDLE MnpHandle;\r
+ EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
+ EFI_HANDLE MnpHandle;\r
\r
//\r
// User's requests data\r
//\r
- EFI_EVENT DoneEvent;\r
- EFI_EVENT ReconfigEvent;\r
- EFI_STATUS Result;\r
+ EFI_EVENT DoneEvent;\r
+ EFI_EVENT ReconfigEvent;\r
+ EFI_STATUS Result;\r
\r
//\r
// Identity of this interface and some configuration info.\r
//\r
- NIC_ADDR NicAddr;\r
- UINT16 NicName[IP4_NIC_NAME_LENGTH];\r
- UINT32 NicIndex;\r
- NIC_IP4_CONFIG_INFO *NicConfig;\r
+ NIC_ADDR NicAddr;\r
+ UINT16 NicName[IP4_NIC_NAME_LENGTH];\r
+ UINT32 NicIndex;\r
+ NIC_IP4_CONFIG_INFO *NicConfig;\r
\r
//\r
// DHCP handles to access DHCP\r
//\r
- EFI_DHCP4_PROTOCOL *Dhcp4;\r
- EFI_HANDLE Dhcp4Handle;\r
- EFI_EVENT Dhcp4Event;\r
+ EFI_DHCP4_PROTOCOL *Dhcp4;\r
+ EFI_HANDLE Dhcp4Handle;\r
+ EFI_EVENT Dhcp4Event;\r
};\r
\r
#define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \\r
CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
\r
-#define IP4_CONFIG_INSTANCE_FROM_IP4FORM_CALLBACK_INFO(this) \\r
- CR (this, IP4_CONFIG_INSTANCE, Ip4FormCallbackInfo, IP4_CONFIG_INSTANCE_SIGNATURE)\r
+#define IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS(this) \\r
+ CR (this, IP4_CONFIG_INSTANCE, HiiConfigAccessProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
\r
\r
/**\r
- Set the IP configure parameters for this NIC. \r
+ Set the IP configure parameters for this NIC.\r
\r
- If Reconfig is TRUE, the IP driver will be informed to discard current \r
- auto configure parameter and restart the auto configuration process. \r
+ If Reconfig is TRUE, the IP driver will be informed to discard current\r
+ auto configure parameter and restart the auto configuration process.\r
If current there is a pending auto configuration, EFI_ALREADY_STARTED is\r
returned. You can only change the configure setting when either\r
the configure has finished or not started yet. If NicConfig, the\r
NIC's configure parameter is removed from the variable.\r
\r
@param Instance The IP4 CONFIG instance.\r
- @param NicConfig The new NIC IP4 configure parameter\r
+ @param NicConfig The new NIC IP4 configure parameter.\r
@param Reconfig Inform the IP4 driver to restart the auto\r
- configuration\r
- \r
- @retval EFI_SUCCESS The configure parameter for this NIC was \r
- set successfully .\r
+ configuration.\r
+\r
+ @retval EFI_SUCCESS The configure parameter for this NIC was\r
+ set successfully.\r
@retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is\r
invalid.\r
@retval EFI_ALREADY_STARTED There is a pending auto configuration.\r
- @retval EFI_NOT_FOUND No auto configure parameter is found\r
+ @retval EFI_NOT_FOUND No auto configure parameter is found.\r
\r
**/\r
EFI_STATUS\r
@param NicConfig The buffer to receive the NIC's configure\r
parameter.\r
\r
- @retval EFI_SUCCESS The configure parameter for this NIC was \r
+ @retval EFI_SUCCESS The configure parameter for this NIC was\r
obtained successfully .\r
@retval EFI_INVALID_PARAMETER This or ConfigLen is NULL.\r
@retval EFI_NOT_FOUND There is no configure parameter for the NIC in\r
NVRam.\r
- @retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is \r
+ @retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is\r
NULL.\r
\r
**/\r