/** @file\r
This file implement the EFI_DHCP4_PROTOCOL interface.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, 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\r
http://opensource.org/licenses/bsd-license.php\r
{\r
EFI_DHCP4_PACKET_OPTION **DstOptions;\r
EFI_DHCP4_PACKET_OPTION **SrcOptions;\r
- INTN Len;\r
+ UINTN Len;\r
UINT32 Index;\r
\r
CopyMem (Dst, Src, sizeof (*Dst));\r
\r
if (DhcpSb->DhcpState == Dhcp4Stopped) {\r
Status = EFI_NOT_STARTED;\r
- goto ON_ERROR;\r
+ goto ON_EXIT;\r
}\r
\r
if (DhcpSb->DhcpState != Dhcp4Bound) {\r
Status = EFI_ACCESS_DENIED;\r
- goto ON_ERROR;\r
+ goto ON_EXIT;\r
}\r
\r
if (DHCP_IS_BOOTP (DhcpSb->Para)) {\r
- return EFI_SUCCESS;\r
+ Status = EFI_SUCCESS;\r
+ goto ON_EXIT;\r
}\r
\r
//\r
DhcpSetState (DhcpSb, Dhcp4Rebinding, FALSE);\r
}\r
\r
+ //\r
+ // Clear initial time to make sure that elapsed-time\r
+ // is set to 0 for first REQUEST in renewal process.\r
+ //\r
+ Instance->ElaspedTime = 0;\r
+\r
Status = DhcpSendMessage (\r
DhcpSb,\r
DhcpSb->Selected,\r
\r
if (EFI_ERROR (Status)) {\r
DhcpSetState (DhcpSb, Dhcp4Bound, FALSE);\r
- goto ON_ERROR;\r
+ goto ON_EXIT;\r
}\r
\r
DhcpSb->ExtraRefresh = TRUE;\r
\r
return EFI_SUCCESS;\r
\r
-ON_ERROR:\r
+ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
@retval other Other error occurs.\r
**/\r
EFI_STATUS\r
+EFIAPI\r
Dhcp4InstanceConfigUdpIo (\r
IN UDP_IO *UdpIo,\r
IN VOID *Context\r
\r
**/\r
VOID\r
+EFIAPI\r
DhcpDummyExtFree (\r
IN VOID *Arg\r
)\r
\r
**/\r
VOID\r
+EFIAPI\r
PxeDhcpInput (\r
NET_BUF *UdpPacket,\r
UDP_END_POINT *EndPoint,\r
\r
return EFI_SUCCESS;\r
}\r
+\r
+/**\r
+ Set the elapsed time based on the given instance and the pointer to the\r
+ elapsed time option.\r
+\r
+ @param[in] Elapsed The pointer to the position to append.\r
+ @param[in] Instance The pointer to the Dhcp4 instance.\r
+**/\r
+VOID\r
+SetElapsedTime (\r
+ IN UINT16 *Elapsed,\r
+ IN DHCP_PROTOCOL *Instance\r
+ )\r
+{\r
+ WriteUnaligned16 (Elapsed, HTONS(Instance->ElaspedTime));\r
+}\r