/** @file\r
\r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\r
All rights reserved. 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\r
return NetLibDefaultUnload (ImageHandle);\r
}\r
\r
+/**\r
+ The entry point for IP4 config driver which install the driver\r
+ binding and component name protocol on its image.\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The system table.\r
\r
+ @retval EFI_SUCCES All the related protocols are installed on the driver.\r
+ @retval Others Failed to install protocols.\r
+\r
+**/\r
EFI_STATUS\r
Ip4ConfigDriverEntryPoint (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- The entry point for IP4 config driver which install the driver\r
- binding and component name protocol on its image.\r
-\r
-Arguments:\r
-\r
- ImageHandle - The Image handle of the driver\r
- SystemTable - The system table\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - All the related protocols are installed on the driver\r
- Others - Failed to install the protocol\r
-\r
---*/\r
{\r
- return NetLibInstallAllDriverProtocolsWithUnload (\r
+ return EfiLibInstallDriverBindingComponentName2 (\r
ImageHandle,\r
SystemTable,\r
&gIp4ConfigDriverBinding,\r
ImageHandle,\r
&gIp4ConfigComponentName,\r
- NULL,\r
- NULL,\r
- EfiIp4ConfigUnload\r
+ &gIp4ConfigComponentName2\r
);\r
}\r
\r
//\r
// Allocate an instance then initialize it\r
//\r
- Instance = NetAllocatePool (sizeof (IP4_CONFIG_INSTANCE));\r
+ Instance = AllocatePool (sizeof (IP4_CONFIG_INSTANCE));\r
\r
if (Instance == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
Instance->Controller = ControllerHandle;\r
Instance->Image = This->DriverBindingHandle;\r
\r
- Instance->Ip4ConfigProtocol = mIp4ConfigProtocolTemplate;\r
- Instance->NicIp4Protocol = mNicIp4ConfigProtocolTemplate;\r
+ CopyMem (&Instance->Ip4ConfigProtocol, &mIp4ConfigProtocolTemplate, sizeof (mIp4ConfigProtocolTemplate));\r
+ CopyMem (&Instance->NicIp4Protocol, &mNicIp4ConfigProtocolTemplate, sizeof (mNicIp4ConfigProtocolTemplate));\r
\r
Instance->State = IP4_CONFIG_STATE_IDLE;\r
Instance->Mnp = Mnp;\r
NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NULL);\r
\r
} else if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {\r
- NetZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));\r
+ ZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));\r
NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NicConfig);\r
\r
}\r
Ip4ConfigWriteVariable (NewVariable);\r
\r
if (NewVariable != NULL) {\r
- NetFreePool (NewVariable);\r
+ gBS->FreePool (NewVariable);\r
}\r
\r
ON_EXIT:\r
- NetFreePool (Variable);\r
+ gBS->FreePool (Variable);\r
\r
if (NicConfig != NULL) {\r
- NetFreePool (NicConfig);\r
+ gBS->FreePool (NicConfig);\r
}\r
\r
return EFI_SUCCESS;\r
\r
ON_ERROR:\r
if (Instance != NULL) {\r
- NetFreePool (Instance);\r
+ gBS->FreePool (Instance);\r
}\r
\r
if (Mnp != NULL) {\r
\r
Ip4ConfigCleanConfig (Instance);\r
mIp4ConfigNicList[Instance->NicIndex] = NULL;\r
- NetFreePool (Instance);\r
+ gBS->FreePool (Instance);\r
\r
return EFI_SUCCESS;\r
}\r