summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c')
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index df9d2df5be..f0fc48f8ac 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
@@ -2585,6 +2585,7 @@ EfiPxeLoadFile (
BOOLEAN NewMakeCallback;
EFI_STATUS Status;
UINT64 TmpBufSize;
+ BOOLEAN MediaPresent;
Private = PXEBC_PRIVATE_DATA_FROM_LOADFILE (This);
PxeBc = &Private->PxeBc;
@@ -2603,6 +2604,15 @@ EfiPxeLoadFile (
return EFI_UNSUPPORTED;
}
+ //
+ // Check media status before PXE start
+ //
+ MediaPresent = TRUE;
+ NetLibDetectMedia (Private->Controller, &MediaPresent);
+ if (!MediaPresent) {
+ return EFI_NO_MEDIA;
+ }
+
Status = PxeBc->Start (PxeBc, FALSE);
if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
return Status;