diff options
author | fanwang2 <fan.wang@intel.com> | 2017-12-18 09:20:26 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2017-12-18 16:38:24 +0800 |
commit | 152f2d5e4546b43f5e842d8538c90055c36dcd19 (patch) | |
tree | 1141ca2b04af3afe1f2d38bab8df1c209c0690dd /NetworkPkg/HttpBootDxe | |
parent | 8ce6b650b0df28a0b8aa5784ccbbe4f8259b5626 (diff) | |
download | edk2-152f2d5e4546b43f5e842d8538c90055c36dcd19.tar.gz |
NetworkPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.
Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting
state handling, and it is forward compatible. So apply this Api in NetworkPkg.
V2:
*Define time period in a macro instead of hard code.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: fanwang2 <fan.wang@intel.com>
Diffstat (limited to 'NetworkPkg/HttpBootDxe')
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootImpl.c | 8 | ||||
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootImpl.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe/HttpBootImpl.c index d591db5bd4..7f0616dafc 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c @@ -548,7 +548,7 @@ HttpBootDxeLoadFile ( {
HTTP_BOOT_PRIVATE_DATA *Private;
HTTP_BOOT_VIRTUAL_NIC *VirtualNic;
- BOOLEAN MediaPresent;
+ EFI_STATUS MediaStatus;
BOOLEAN UsingIpv6;
EFI_STATUS Status;
HTTP_BOOT_IMAGE_TYPE ImageType;
@@ -570,9 +570,9 @@ HttpBootDxeLoadFile ( //
// Check media status before HTTP boot start
//
- MediaPresent = TRUE;
- NetLibDetectMedia (Private->Controller, &MediaPresent);
- if (!MediaPresent) {
+ MediaStatus = EFI_SUCCESS;
+ NetLibDetectMediaWaitTimeout (Private->Controller, HTTP_BOOT_CHECK_MEDIA_WAITING_TIME, &MediaStatus);
+ if (MediaStatus != EFI_SUCCESS) {
AsciiPrint ("\n Error: Could not detect network connection.\n");
return EFI_NO_MEDIA;
}
diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.h b/NetworkPkg/HttpBootDxe/HttpBootImpl.h index da58bb6583..53160359f3 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.h +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.h @@ -14,6 +14,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __EFI_HTTP_BOOT_IMPL_H__
#define __EFI_HTTP_BOOT_IMPL_H__
+#define HTTP_BOOT_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
+
/**
Attempt to complete a DHCPv4 D.O.R.A or DHCPv6 S.R.A.A sequence to retrieve the boot resource information.
|