/** @file\r
\r
-Copyright (c) 2006 - 2007, 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
Dhcp4ServiceBindingDestroyChild\r
};\r
\r
+/**\r
+ Entry point of the DHCP driver to install various protocols.\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The system table.\r
+\r
+ @retval EFI_SUCCES if the driver binding and component name protocols are successfully\r
+ @retval Others Failed to install the protocols.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
Dhcp4DriverEntryPoint (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Entry point of the DHCP driver to install various protocols.\r
-\r
-Arguments:\r
-\r
- ImageHandle - The driver's image handle\r
- SystemTable - The system table\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - All the related protocols are installed.\r
- Others - Failed to install the protocols.\r
-\r
---*/\r
{\r
return EfiLibInstallDriverBindingComponentName2 (\r
ImageHandle,\r
UdpConfigData.StationPort = DHCP_CLIENT_PORT;\r
UdpConfigData.RemotePort = DHCP_SERVER_PORT;\r
\r
- NetZeroMem (&UdpConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));\r
- NetZeroMem (&UdpConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
- NetZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));\r
+ ZeroMem (&UdpConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));\r
+ ZeroMem (&UdpConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
+ ZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));\r
\r
return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);;\r
}\r
EFI_STATUS Status;\r
\r
*Service = NULL;\r
- DhcpSb = NetAllocateZeroPool (sizeof (DHCP_SERVICE));\r
+ DhcpSb = AllocateZeroPool (sizeof (DHCP_SERVICE));\r
\r
if (DhcpSb == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
DhcpSb->InDestory = FALSE;\r
DhcpSb->Controller = Controller;\r
DhcpSb->Image = ImageHandle;\r
- NetListInit (&DhcpSb->Children);\r
+ InitializeListHead (&DhcpSb->Children);\r
DhcpSb->DhcpState = Dhcp4Stopped;\r
DhcpSb->Xid = NET_RANDOM (NetRandomInitSeed ());\r
\r
//\r
Status = gBS->CreateEvent (\r
EVT_NOTIFY_SIGNAL | EVT_TIMER,\r
- NET_TPL_TIMER,\r
+ TPL_CALLBACK,\r
DhcpOnTimerTick,\r
DhcpSb,\r
&DhcpSb->Timer\r
\r
ON_ERROR:\r
Dhcp4CloseService (DhcpSb);\r
- NetFreePool (DhcpSb);\r
+ gBS->FreePool (DhcpSb);\r
\r
return Status;\r
}\r
\r
ON_ERROR:\r
Dhcp4CloseService (DhcpSb);\r
- NetFreePool (DhcpSb);\r
+ gBS->FreePool (DhcpSb);\r
return Status;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
if (NumberOfChildren == 0) {\r
\r
\r
Dhcp4CloseService (DhcpSb);\r
\r
- NetFreePool (DhcpSb);\r
+ gBS->FreePool (DhcpSb);\r
} else {\r
//\r
// Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestoryChild\r
// may cause other child to be deleted.\r
//\r
- while (!NetListIsEmpty (&DhcpSb->Children)) {\r
+ while (!IsListEmpty (&DhcpSb->Children)) {\r
Instance = NET_LIST_HEAD (&DhcpSb->Children, DHCP_PROTOCOL, Link);\r
ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);\r
}\r
}\r
}\r
\r
- NET_RESTORE_TPL (OldTpl);\r
+ gBS->RestoreTPL (OldTpl);\r
\r
return Status;\r
}\r
\r
\r
/**\r
- Initialize a new DHCP child\r
+ Initialize a new DHCP child.\r
\r
@param DhcpSb The dhcp service instance\r
@param Instance The dhcp instance to initialize\r
{\r
Instance->Signature = DHCP_PROTOCOL_SIGNATURE;\r
CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (Instance->Dhcp4Protocol));\r
- NetListInit (&Instance->Link);\r
+ InitializeListHead (&Instance->Link);\r
Instance->Handle = NULL;\r
Instance->Service = DhcpSb;\r
Instance->InDestory = FALSE;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Instance = NetAllocatePool (sizeof (*Instance));\r
+ Instance = AllocatePool (sizeof (*Instance));\r
\r
if (Instance == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- NetFreePool (Instance);\r
+ gBS->FreePool (Instance);\r
return Status;\r
}\r
\r
NULL\r
);\r
\r
- NetFreePool (Instance);\r
+ gBS->FreePool (Instance);\r
return Status;\r
}\r
\r
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
- NetListInsertTail (&DhcpSb->Children, &Instance->Link);\r
+ InsertTailList (&DhcpSb->Children, &Instance->Link);\r
DhcpSb->NumChildren++;\r
\r
- NET_RESTORE_TPL (OldTpl);\r
+ gBS->RestoreTPL (OldTpl);\r
\r
return EFI_SUCCESS;\r
}\r
return EFI_SUCCESS;\r
}\r
\r
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
Instance->InDestory = TRUE;\r
\r
//\r
if (EFI_ERROR (Status)) {\r
Instance->InDestory = FALSE;\r
\r
- NET_RESTORE_TPL (OldTpl);\r
+ gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r
DhcpYieldControl (DhcpSb);\r
}\r
\r
- NetListRemoveEntry (&Instance->Link);\r
+ RemoveEntryList (&Instance->Link);\r
DhcpSb->NumChildren--;\r
\r
- NET_RESTORE_TPL (OldTpl);\r
+ gBS->RestoreTPL (OldTpl);\r
\r
- NetFreePool (Instance);\r
+ gBS->FreePool (Instance);\r
return EFI_SUCCESS;\r
}\r