/** @file\r
Functions implementation related with DHCPv4/v6 for DNS driver.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-This software and associated documentation (if any) is furnished\r
-under a license and may only be used or copied in accordance\r
-with the terms of the license. Except as permitted by such\r
-license, no part of this software or documentation may be\r
-reproduced, stored in a retrieval system, or transmitted in any\r
-form or by any means without the express written consent of\r
-Intel Corporation.\r
+Copyright (c) 2015 - 2017, 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
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
EFI_STATUS Status;\r
EFI_HANDLE Image;\r
EFI_HANDLE Controller;\r
- BOOLEAN MediaPresent;\r
+ EFI_STATUS MediaStatus;\r
EFI_HANDLE MnpChildHandle; \r
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;\r
//\r
// Check media.\r
//\r
- MediaPresent = TRUE;\r
- NetLibDetectMedia (Controller, &MediaPresent);\r
- if (!MediaPresent) {\r
+ MediaStatus = EFI_SUCCESS;\r
+ NetLibDetectMediaWaitTimeout (Controller, DNS_CHECK_MEDIA_GET_DHCP_WAITING_TIME, &MediaStatus);\r
+ if (MediaStatus != EFI_SUCCESS) {\r
return EFI_NO_MEDIA;\r
}\r
\r
\r
ParaList[0]->OpCode = DHCP4_TAG_TYPE;\r
ParaList[0]->Length = 1;\r
- ParaList[0]->Data[0] = DHCP4_MSG_INFORM;\r
+ ParaList[0]->Data[0] = DHCP4_MSG_REQUEST;\r
\r
ParaList[1] = AllocateZeroPool (sizeof (EFI_DHCP4_PACKET_OPTION));\r
if (ParaList[1] == NULL) {\r
EFI_DHCP6_PACKET_OPTION *Oro;\r
EFI_DHCP6_RETRANSMISSION InfoReqReXmit;\r
EFI_EVENT Timer;\r
- BOOLEAN MediaPresent;\r
+ EFI_STATUS MediaStatus;\r
DNS6_SERVER_INFOR DnsServerInfor;\r
\r
Dhcp6Handle = NULL;\r
//\r
// Check media status before doing DHCP.\r
//\r
- MediaPresent = TRUE;\r
- NetLibDetectMedia (Controller, &MediaPresent);\r
- if (!MediaPresent) {\r
+ MediaStatus = EFI_SUCCESS;\r
+ NetLibDetectMediaWaitTimeout (Controller, DNS_CHECK_MEDIA_GET_DHCP_WAITING_TIME, &MediaStatus);\r
+ if (MediaStatus != EFI_SUCCESS) {\r
return EFI_NO_MEDIA;\r
}\r
\r