/** @file\r
This EFI_DHCP6_PROTOCOL interface implementation.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_TPL OldTpl;\r
DHCP6_INSTANCE *Instance;\r
DHCP6_SERVICE *Service;\r
+ EFI_STATUS MediaStatus;\r
\r
if (This == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- Instance->UdpSts = EFI_ALREADY_STARTED;\r
\r
//\r
- // Need to clear initial time to make sure that elapsed-time\r
- // is set to 0 for first Solicit.\r
+ // Check Media Satus.\r
//\r
- Instance->StartTime = 0;\r
+ MediaStatus = EFI_SUCCESS;\r
+ NetLibDetectMediaWaitTimeout (Service->Controller, DHCP_CHECK_MEDIA_WAITING_TIME, &MediaStatus);\r
+ if (MediaStatus != EFI_SUCCESS) {\r
+ Status = EFI_NO_MEDIA;\r
+ goto ON_ERROR;\r
+ }\r
+\r
+ Instance->UdpSts = EFI_ALREADY_STARTED;\r
\r
//\r
// Send the solicit message to start S.A.R.R process.\r
}\r
Status = Instance->UdpSts;\r
}\r
- \r
+\r
ON_EXIT:\r
//\r
// Clean up the session data for the released Ia.\r
return Status;\r
}\r
\r
- do { \r
+ do {\r
TimerStatus = gBS->CheckEvent (Timer);\r
if (!EFI_ERROR (TimerStatus)) {\r
Status = Dhcp6StartInfoRequest (\r
);\r
}\r
} while (TimerStatus == EFI_NOT_READY);\r
- \r
+\r
gBS->CloseEvent (Timer);\r
}\r
if (EFI_ERROR (Status)) {\r