mirror of https://github.com/acidanthera/audk.git
installing HII config access protocol on child handle instead of installing on NIC physical handle, to avoid conflict with the HII config access protocol installed on NIC physical handle.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9665 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8fdcc4123b
commit
d80ea7394c
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
This code implements the IP4Config and NicIp4Config protocols.
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation.<BR>
|
||||
Copyright (c) 2006 - 2009, Intel Corporation.<BR>
|
||||
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<BR>
|
||||
|
@ -82,12 +82,12 @@ Ip4ConfigGetNicInfo (
|
|||
@param NicConfig The buffer to receive the NIC's configure
|
||||
parameter.
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
obtained successfully .
|
||||
@retval EFI_INVALID_PARAMETER This or ConfigLen is NULL.
|
||||
@retval EFI_NOT_FOUND There is no configure parameter for the NIC in
|
||||
NVRam.
|
||||
@retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is
|
||||
@retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is
|
||||
NULL.
|
||||
|
||||
**/
|
||||
|
@ -137,26 +137,26 @@ EfiNicIp4ConfigGetInfo (
|
|||
|
||||
|
||||
/**
|
||||
Set the IP configure parameters for this NIC.
|
||||
Set the IP configure parameters for this NIC.
|
||||
|
||||
If Reconfig is TRUE, the IP driver will be informed to discard current
|
||||
auto configure parameter and restart the auto configuration process.
|
||||
If Reconfig is TRUE, the IP driver will be informed to discard current
|
||||
auto configure parameter and restart the auto configuration process.
|
||||
If current there is a pending auto configuration, EFI_ALREADY_STARTED is
|
||||
returned. You can only change the configure setting when either
|
||||
the configure has finished or not started yet. If NicConfig, the
|
||||
NIC's configure parameter is removed from the variable.
|
||||
|
||||
@param Instance The IP4 CONFIG instance.
|
||||
@param NicConfig The new NIC IP4 configure parameter
|
||||
@param NicConfig The new NIC IP4 configure parameter.
|
||||
@param Reconfig Inform the IP4 driver to restart the auto
|
||||
configuration
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
set successfully .
|
||||
configuration.
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
set successfully.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is
|
||||
invalid.
|
||||
@retval EFI_ALREADY_STARTED There is a pending auto configuration.
|
||||
@retval EFI_NOT_FOUND No auto configure parameter is found
|
||||
@retval EFI_NOT_FOUND No auto configure parameter is found.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
|
@ -342,47 +342,47 @@ ON_EXIT:
|
|||
|
||||
/**
|
||||
Starts running the configuration policy for the EFI IPv4 Protocol driver.
|
||||
|
||||
The Start() function is called to determine and to begin the platform
|
||||
configuration policy by the EFI IPv4 Protocol driver. This determination may
|
||||
be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
|
||||
driver configuration policy. It may be as involved as loading some defaults
|
||||
from nonvolatile storage, downloading dynamic data from a DHCP server, and
|
||||
|
||||
The Start() function is called to determine and to begin the platform
|
||||
configuration policy by the EFI IPv4 Protocol driver. This determination may
|
||||
be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
|
||||
driver configuration policy. It may be as involved as loading some defaults
|
||||
from nonvolatile storage, downloading dynamic data from a DHCP server, and
|
||||
checking permissions with a site policy server.
|
||||
Starting the configuration policy is just the beginning. It may finish almost
|
||||
instantly or it may take several minutes before it fails to retrieve configuration
|
||||
information from one or more servers. Once the policy is started, drivers
|
||||
should use the DoneEvent parameter to determine when the configuration policy
|
||||
has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
|
||||
Starting the configuration policy is just the beginning. It may finish almost
|
||||
instantly or it may take several minutes before it fails to retrieve configuration
|
||||
information from one or more servers. Once the policy is started, drivers
|
||||
should use the DoneEvent parameter to determine when the configuration policy
|
||||
has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
|
||||
determine if the configuration succeeded or failed.
|
||||
Until the configuration completes successfully, EFI IPv4 Protocol driver instances
|
||||
Until the configuration completes successfully, EFI IPv4 Protocol driver instances
|
||||
that are attempting to use default configurations must return EFI_NO_MAPPING.
|
||||
Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
|
||||
signals DoneEvent. The configuration may need to be updated in the future,
|
||||
however; in this case, the EFI IPv4 Configuration Protocol driver must signal
|
||||
ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
|
||||
configurations must return EFI_NO_MAPPING until the configuration policy has
|
||||
Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
|
||||
signals DoneEvent. The configuration may need to be updated in the future,
|
||||
however; in this case, the EFI IPv4 Configuration Protocol driver must signal
|
||||
ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
|
||||
configurations must return EFI_NO_MAPPING until the configuration policy has
|
||||
been rerun.
|
||||
|
||||
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
||||
@param DoneEvent Event that will be signaled when the EFI IPv4
|
||||
Protocol driver configuration policy completes
|
||||
@param DoneEvent Event that will be signaled when the EFI IPv4
|
||||
Protocol driver configuration policy completes
|
||||
execution. This event must be of type EVT_NOTIFY_SIGNAL.
|
||||
@param ReconfigEvent Event that will be signaled when the EFI IPv4
|
||||
Protocol driver configuration needs to be updated.
|
||||
@param ReconfigEvent Event that will be signaled when the EFI IPv4
|
||||
Protocol driver configuration needs to be updated.
|
||||
This event must be of type EVT_NOTIFY_SIGNAL.
|
||||
|
||||
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
||||
|
||||
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
||||
driver is now running.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL:
|
||||
This
|
||||
DoneEvent
|
||||
ReconfigEvent
|
||||
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
||||
@retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
@retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
driver was already started.
|
||||
@retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
|
||||
@retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol
|
||||
@retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol
|
||||
driver configuration.
|
||||
|
||||
**/
|
||||
|
@ -546,18 +546,18 @@ ON_EXIT:
|
|||
|
||||
/**
|
||||
Stops running the configuration policy for the EFI IPv4 Protocol driver.
|
||||
|
||||
The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
|
||||
|
||||
The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
|
||||
All configuration data will be lost after calling Stop().
|
||||
|
||||
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
||||
|
||||
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
||||
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
||||
driver has been stopped.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL.
|
||||
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
driver was not started.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
|
@ -600,26 +600,26 @@ ON_EXIT:
|
|||
/**
|
||||
Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
|
||||
|
||||
The GetData() function returns the current configuration data for the EFI IPv4
|
||||
The GetData() function returns the current configuration data for the EFI IPv4
|
||||
Protocol driver after the configuration policy has completed.
|
||||
|
||||
|
||||
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
||||
@param ConfigDataSize On input, the size of the ConfigData buffer.
|
||||
On output, the count of bytes that were written
|
||||
@param ConfigDataSize On input, the size of the ConfigData buffer.
|
||||
On output, the count of bytes that were written
|
||||
into the ConfigData buffer.
|
||||
@param ConfigData Pointer to the EFI IPv4 Configuration Protocol
|
||||
driver configuration data structure.
|
||||
Type EFI_IP4_IPCONFIG_DATA is defined in
|
||||
@param ConfigData Pointer to the EFI IPv4 Configuration Protocol
|
||||
driver configuration data structure.
|
||||
Type EFI_IP4_IPCONFIG_DATA is defined in
|
||||
"Related Definitions" below.
|
||||
|
||||
@retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL.
|
||||
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
||||
driver is not running.
|
||||
@retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.
|
||||
@retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.
|
||||
Currently not implemented.
|
||||
@retval EFI_BUFFER_TOO_SMALL *ConfigDataSize is smaller than the configuration
|
||||
@retval EFI_BUFFER_TOO_SMALL *ConfigDataSize is smaller than the configuration
|
||||
data buffer or ConfigData is NULL.
|
||||
|
||||
**/
|
||||
|
|
|
@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Protocol/HiiConfigAccess.h>
|
||||
#include <Protocol/HiiDatabase.h>
|
||||
#include <Protocol/HiiConfigRouting.h>
|
||||
#include <Protocol/ServiceBinding.h>
|
||||
|
||||
#include <Guid/MdeModuleHii.h>
|
||||
|
||||
|
@ -38,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Library/HiiLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/DpcLib.h>
|
||||
#include <Library/UefiHiiServicesLib.h>
|
||||
|
||||
#include "NicIp4Variable.h"
|
||||
|
||||
|
@ -49,7 +51,7 @@ typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE;
|
|||
extern EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName;
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2;
|
||||
|
||||
|
||||
extern IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];
|
||||
extern EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate;
|
||||
|
||||
|
@ -76,116 +78,89 @@ typedef struct {
|
|||
} IP4_CONFIG_DHCP4_OPTION;
|
||||
#pragma pack()
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINTN DeviceNum;
|
||||
BOOLEAN Enabled;
|
||||
EFI_IPv4_ADDRESS LocalIp;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
EFI_IPv4_ADDRESS Gateway;
|
||||
} IP4_CONFIG_SESSION_DATA;
|
||||
|
||||
typedef struct _IP4_CONFIG_FORM_ENTRY {
|
||||
LIST_ENTRY Link;
|
||||
IP4_CONFIG_INSTANCE *Ip4ConfigInstance;
|
||||
EFI_HANDLE Controller;
|
||||
CHAR16 *MacString;
|
||||
EFI_STRING_ID PortTitleToken;
|
||||
EFI_STRING_ID PortTitleHelpToken;
|
||||
IP4_CONFIG_SESSION_DATA SessionConfigData;
|
||||
} IP4CONFIG_FORM_ENTRY;
|
||||
|
||||
#define IP4CONFIG_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'C')
|
||||
|
||||
typedef struct _IP4_FORM_CALLBACK_INFO_INSTANCE {
|
||||
UINTN Signature;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
||||
EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
|
||||
EFI_HII_HANDLE RegisteredHandle;
|
||||
IP4CONFIG_FORM_ENTRY *Current;
|
||||
} IP4_FORM_CALLBACK_INFO;
|
||||
|
||||
#define IP4CONFIG_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
|
||||
CR ( \
|
||||
Callback, \
|
||||
IP4_FORM_CALLBACK_INFO, \
|
||||
ConfigAccess, \
|
||||
IP4CONFIG_FORM_CALLBACK_INFO_SIGNATURE \
|
||||
)
|
||||
typedef struct _IP4CONFIG_CALLBACK_INFO {
|
||||
BOOLEAN Enabled;
|
||||
EFI_IPv4_ADDRESS LocalIp;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
EFI_IPv4_ADDRESS Gateway;
|
||||
} IP4_SETTING_INFO;
|
||||
|
||||
struct _IP4_CONFIG_INSTANCE {
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_HANDLE Image;
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_HANDLE Image;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
||||
|
||||
EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;
|
||||
EFI_IP4_CONFIG_PROTOCOL Ip4ConfigProtocol;
|
||||
|
||||
IP4_FORM_CALLBACK_INFO Ip4FormCallbackInfo;
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL HiiConfigAccessProtocol;
|
||||
EFI_HANDLE ChildHandle;
|
||||
EFI_DEVICE_PATH_PROTOCOL *HiiVendorDevicePath;
|
||||
EFI_HII_HANDLE RegisteredHandle;
|
||||
IP4_SETTING_INFO Ip4ConfigCallbackInfo;
|
||||
|
||||
//
|
||||
// NicConfig's state, such as IP4_CONFIG_STATE_IDLE
|
||||
//
|
||||
INTN State;
|
||||
INTN State;
|
||||
|
||||
//
|
||||
// Mnp child to keep the connection with MNP.
|
||||
//
|
||||
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
|
||||
EFI_HANDLE MnpHandle;
|
||||
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
|
||||
EFI_HANDLE MnpHandle;
|
||||
|
||||
//
|
||||
// User's requests data
|
||||
//
|
||||
EFI_EVENT DoneEvent;
|
||||
EFI_EVENT ReconfigEvent;
|
||||
EFI_STATUS Result;
|
||||
EFI_EVENT DoneEvent;
|
||||
EFI_EVENT ReconfigEvent;
|
||||
EFI_STATUS Result;
|
||||
|
||||
//
|
||||
// Identity of this interface and some configuration info.
|
||||
//
|
||||
NIC_ADDR NicAddr;
|
||||
UINT16 NicName[IP4_NIC_NAME_LENGTH];
|
||||
UINT32 NicIndex;
|
||||
NIC_IP4_CONFIG_INFO *NicConfig;
|
||||
NIC_ADDR NicAddr;
|
||||
UINT16 NicName[IP4_NIC_NAME_LENGTH];
|
||||
UINT32 NicIndex;
|
||||
NIC_IP4_CONFIG_INFO *NicConfig;
|
||||
|
||||
//
|
||||
// DHCP handles to access DHCP
|
||||
//
|
||||
EFI_DHCP4_PROTOCOL *Dhcp4;
|
||||
EFI_HANDLE Dhcp4Handle;
|
||||
EFI_EVENT Dhcp4Event;
|
||||
EFI_DHCP4_PROTOCOL *Dhcp4;
|
||||
EFI_HANDLE Dhcp4Handle;
|
||||
EFI_EVENT Dhcp4Event;
|
||||
};
|
||||
|
||||
#define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \
|
||||
CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)
|
||||
|
||||
#define IP4_CONFIG_INSTANCE_FROM_IP4FORM_CALLBACK_INFO(this) \
|
||||
CR (this, IP4_CONFIG_INSTANCE, Ip4FormCallbackInfo, IP4_CONFIG_INSTANCE_SIGNATURE)
|
||||
#define IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS(this) \
|
||||
CR (this, IP4_CONFIG_INSTANCE, HiiConfigAccessProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)
|
||||
|
||||
|
||||
/**
|
||||
Set the IP configure parameters for this NIC.
|
||||
Set the IP configure parameters for this NIC.
|
||||
|
||||
If Reconfig is TRUE, the IP driver will be informed to discard current
|
||||
auto configure parameter and restart the auto configuration process.
|
||||
If Reconfig is TRUE, the IP driver will be informed to discard current
|
||||
auto configure parameter and restart the auto configuration process.
|
||||
If current there is a pending auto configuration, EFI_ALREADY_STARTED is
|
||||
returned. You can only change the configure setting when either
|
||||
the configure has finished or not started yet. If NicConfig, the
|
||||
NIC's configure parameter is removed from the variable.
|
||||
|
||||
@param Instance The IP4 CONFIG instance.
|
||||
@param NicConfig The new NIC IP4 configure parameter
|
||||
@param NicConfig The new NIC IP4 configure parameter.
|
||||
@param Reconfig Inform the IP4 driver to restart the auto
|
||||
configuration
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
set successfully .
|
||||
configuration.
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
set successfully.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is
|
||||
invalid.
|
||||
@retval EFI_ALREADY_STARTED There is a pending auto configuration.
|
||||
@retval EFI_NOT_FOUND No auto configure parameter is found
|
||||
@retval EFI_NOT_FOUND No auto configure parameter is found.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
|
@ -204,12 +179,12 @@ EfiNicIp4ConfigSetInfo (
|
|||
@param NicConfig The buffer to receive the NIC's configure
|
||||
parameter.
|
||||
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
@retval EFI_SUCCESS The configure parameter for this NIC was
|
||||
obtained successfully .
|
||||
@retval EFI_INVALID_PARAMETER This or ConfigLen is NULL.
|
||||
@retval EFI_NOT_FOUND There is no configure parameter for the NIC in
|
||||
NVRam.
|
||||
@retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is
|
||||
@retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is
|
||||
NULL.
|
||||
|
||||
**/
|
||||
|
|
|
@ -42,8 +42,6 @@ EfiIp4ConfigUnload (
|
|||
{
|
||||
UINT32 Index;
|
||||
|
||||
Ip4ConfigFormUnload ();
|
||||
|
||||
//
|
||||
// Stop all the IP4_CONFIG instances
|
||||
//
|
||||
|
@ -81,8 +79,6 @@ Ip4ConfigDriverEntryPoint (
|
|||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
Ip4ConfigFormInit ();
|
||||
|
||||
return EfiLibInstallDriverBindingComponentName2 (
|
||||
ImageHandle,
|
||||
SystemTable,
|
||||
|
@ -161,6 +157,16 @@ Ip4ConfigDriverBindingStart (
|
|||
IP4_CONFIG_VARIABLE *NewVariable;
|
||||
EFI_STATUS Status;
|
||||
UINT32 Index;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ParentDevicePath
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Check for multiple start.
|
||||
|
@ -222,6 +228,7 @@ Ip4ConfigDriverBindingStart (
|
|||
Instance->Signature = IP4_CONFIG_INSTANCE_SIGNATURE;
|
||||
Instance->Controller = ControllerHandle;
|
||||
Instance->Image = This->DriverBindingHandle;
|
||||
Instance->ParentDevicePath = ParentDevicePath;
|
||||
|
||||
CopyMem (&Instance->Ip4ConfigProtocol, &mIp4ConfigProtocolTemplate, sizeof (mIp4ConfigProtocolTemplate));
|
||||
|
||||
|
@ -272,12 +279,6 @@ Ip4ConfigDriverBindingStart (
|
|||
}
|
||||
|
||||
Status = Ip4ConfigDeviceInit (Instance);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Try to add a port configuration page for this controller.
|
||||
//
|
||||
Ip4ConfigUpdateForm (Instance, TRUE);
|
||||
}
|
||||
|
||||
//
|
||||
// Install the IP4_CONFIG and NIC_IP4CONFIG protocols
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#/** @file
|
||||
# Component name for module Ip4Config
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2006 - 2009, Intel Corporation
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
|
@ -28,10 +27,6 @@
|
|||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gIp4ConfigDriverBinding
|
||||
# COMPONENT_NAME = gIp4ConfigComponentName
|
||||
# COMPONENT_NAME2 = gIp4ConfigComponentName2
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
ComponentName.c
|
||||
|
@ -68,9 +63,8 @@
|
|||
gEfiIp4ConfigProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
gEfiManagedNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiDhcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiHiiDatabaseProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiHiiConfigAccessProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
|
||||
[Guids]
|
||||
gEfiIfrTianoGuid ## CONSUMES ## Guid
|
||||
gEfiNicIp4ConfigVariableGuid ## CONSUMES ## Guid
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#define EFI_NETWORK_DEVICE_CLASS 0x04
|
||||
|
||||
formset
|
||||
guid = EFI_NIC_IP4_CONFIG_VARIABLE_GUID,
|
||||
guid = EFI_NIC_IP4_CONFIG_NVDATA_GUID,
|
||||
title = STRING_TOKEN(STR_IP4_CONFIG_FORM_TITLE),
|
||||
help = STRING_TOKEN(STR_IP4_CONFIG_FORM_HELP),
|
||||
class = EFI_NETWORK_DEVICE_CLASS,
|
||||
|
@ -24,17 +24,9 @@ formset
|
|||
|
||||
varstore IP4_CONFIG_IFR_NVDATA,
|
||||
name = EfiNicIp4ConfigVariable,
|
||||
guid = EFI_NIC_IP4_CONFIG_VARIABLE_GUID;
|
||||
guid = EFI_NIC_IP4_CONFIG_NVDATA_GUID;
|
||||
|
||||
form formid = FORMID_MAIN_FORM,
|
||||
title = STRING_TOKEN(STR_IP4_MAIN_FORM_TITLE);
|
||||
|
||||
label DEVICE_ENTRY_LABEL;
|
||||
label LABEL_END;
|
||||
|
||||
endform;
|
||||
|
||||
form formid = FORMID_DEVICE_FORM,
|
||||
title = STRING_TOKEN(STR_IP4_DEVICE_FORM_TITLE);
|
||||
|
||||
checkbox varid = EfiNicIp4ConfigVariable.DhcpEnable,
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -24,31 +24,6 @@ extern UINT8 Ip4ConfigDxeStrings[];
|
|||
#define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE
|
||||
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
/**
|
||||
Updates the network configuration form to add/delete an entry for the network
|
||||
device specified by the Instance.
|
||||
|
||||
@param[in] Instance The IP4 Config instance.
|
||||
@param[in] AddForm Whether to add or delete a form entry.
|
||||
|
||||
@retval EFI_SUCCESS The network configuration form is updated.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
@retval Others Other errors as indicated.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4ConfigUpdateForm (
|
||||
IN IP4_CONFIG_INSTANCE *Instance,
|
||||
IN BOOLEAN AddForm
|
||||
);
|
||||
|
||||
/**
|
||||
Install HII Config Access protocol for network device and allocate resource.
|
||||
|
||||
|
@ -76,29 +51,4 @@ Ip4ConfigDeviceUnload (
|
|||
IN IP4_CONFIG_INSTANCE *Instance
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize the network configuration form, this includes: delete all the network
|
||||
device configuration entries, install the form callback protocol and
|
||||
allocate the resources used.
|
||||
|
||||
@retval EFI_SUCCESS The network configuration form is unloaded.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4ConfigFormInit (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Unload the network configuration form, this includes: delete all the network
|
||||
device configuration entries, uninstall the form callback protocol and
|
||||
free the resources used.
|
||||
|
||||
@retval EFI_SUCCESS The network configuration form is unloaded.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4ConfigFormUnload (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,13 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _NIC_IP4_NV_DATA_H_
|
||||
#define _NIC_IP4_NV_DATA_H_
|
||||
|
||||
|
||||
//
|
||||
// one copy from NicIp4ConfigNvData.h
|
||||
//
|
||||
#define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \
|
||||
#define EFI_NIC_IP4_CONFIG_NVDATA_GUID \
|
||||
{ \
|
||||
0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b } \
|
||||
0x9d5b53f, 0xf4b0, 0x4f59, { 0xa0, 0xb1, 0x7b, 0x57, 0xd3, 0x5c, 0xe, 0x5 } \
|
||||
}
|
||||
|
||||
#define FORMID_MAIN_FORM 1
|
||||
|
@ -33,11 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#define KEY_GATE_WAY 0x104
|
||||
#define KEY_SAVE_CHANGES 0x105
|
||||
|
||||
#define DEVICE_ENTRY_LABEL 0x1234
|
||||
#define LABEL_END 0xffff
|
||||
|
||||
#define KEY_DEVICE_ENTRY_BASE 0x1000
|
||||
|
||||
#define IP_MIN_SIZE 7
|
||||
#define IP_MAX_SIZE 15
|
||||
#define IP4_STR_MAX_SIZE 16
|
||||
|
@ -48,12 +39,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
/// of variable length.
|
||||
///
|
||||
typedef struct {
|
||||
UINT16 NicAddr[3]; ///< NIC MAC address
|
||||
UINT8 Reserved; ///< Reserved bits
|
||||
UINT8 DhcpEnable; ///< Static or DHCP
|
||||
UINT16 NicAddr[3]; ///< NIC MAC address
|
||||
UINT8 Reserved; ///< Reserved bits
|
||||
UINT8 DhcpEnable; ///< Static or DHCP
|
||||
CHAR16 StationAddress[IP4_STR_MAX_SIZE]; ///< IP addresses
|
||||
CHAR16 SubnetMask[IP4_STR_MAX_SIZE]; ///< Subnet address
|
||||
CHAR16 GatewayAddress[IP4_STR_MAX_SIZE]; ///< Gateway address
|
||||
} IP4_CONFIG_IFR_NVDATA;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue