summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-13 05:07:35 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-13 05:07:35 +0000
commit72ed3d7575874e6cad64dd4fe5bc6b5aa467b705 (patch)
tree05aa739a84896e47b486494f2b22060376d0b187 /MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
parent430fbbe0968c9ce6748203776a13e96d367c3bce (diff)
downloadedk2-platforms-72ed3d7575874e6cad64dd4fe5bc6b5aa467b705.tar.xz
Refine code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10648 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c66
1 files changed, 55 insertions, 11 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
index dfa4cdcd8f..c620abd70b 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
@@ -26,6 +26,60 @@ EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding = {
NULL
};
+//
+// The intance of template of IP4 Config private data
+//
+IP4_CONFIG_INSTANCE mIp4ConfigTemplate = {
+ IP4_CONFIG_INSTANCE_SIGNATURE,
+ NULL,
+ NULL,
+ (EFI_DEVICE_PATH_PROTOCOL *) NULL,
+ {
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ NULL,
+ NULL,
+ NULL
+ },
+ NULL,
+ (EFI_DEVICE_PATH_PROTOCOL *) NULL,
+ NULL,
+ {
+ FALSE,
+ FALSE,
+ {
+ 0
+ },
+ {
+ 0
+ },
+ {
+ 0
+ }
+ },
+ 0,
+ (EFI_MANAGED_NETWORK_PROTOCOL *) NULL,
+ NULL,
+ NULL,
+ NULL,
+ EFI_NOT_READY,
+ {
+ 0,
+ 0,
+ {
+ 0
+ }
+ },
+ (CHAR16 *) NULL,
+ (NIC_IP4_CONFIG_INFO *) NULL,
+ (EFI_DHCP4_PROTOCOL *) NULL,
+ NULL,
+ NULL
+};
+
/**
The entry point for IP4 config driver which install the driver
binding and component name protocol on its image.
@@ -180,14 +234,13 @@ Ip4ConfigDriverBindingStart (
//
// Allocate an instance then initialize it
//
- Instance = AllocateZeroPool (sizeof (IP4_CONFIG_INSTANCE));
+ Instance = AllocateCopyPool (sizeof (IP4_CONFIG_INSTANCE), &mIp4ConfigTemplate);
if (Instance == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_ERROR;
}
- Instance->Signature = IP4_CONFIG_INSTANCE_SIGNATURE;
Instance->Controller = ControllerHandle;
Instance->Image = This->DriverBindingHandle;
Instance->ParentDevicePath = ParentDevicePath;
@@ -198,15 +251,6 @@ Ip4ConfigDriverBindingStart (
Instance->Mnp = Mnp;
Instance->MnpHandle = MnpHandle;
- Instance->DoneEvent = NULL;
- Instance->ReconfigEvent = NULL;
- Instance->Result = EFI_NOT_READY;
- Instance->NicConfig = NULL;
-
- Instance->Dhcp4 = NULL;
- Instance->Dhcp4Handle = NULL;
- Instance->Dhcp4Event = NULL;
-
Status = Mnp->GetModeData (Mnp, NULL, &SnpMode);
if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {