mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/NetLib: Fix an error when AIP doesn't support network media state detection
AIP may not support detecting network media state, in this case, should call NetLibDetectMedia to get media state. This patch is to fix this issue. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <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> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
8bf0380e5e
commit
5d0e003c8c
|
@ -2605,6 +2605,24 @@ NetLibDetectMediaWaitTimeout (
|
|||
if (MediaInfo != NULL) {
|
||||
FreePool (MediaInfo);
|
||||
}
|
||||
|
||||
if (Status == EFI_UNSUPPORTED) {
|
||||
|
||||
//
|
||||
// If gEfiAdapterInfoMediaStateGuid is not supported, call NetLibDetectMedia to get media state!
|
||||
//
|
||||
MediaPresent = TRUE;
|
||||
Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (MediaPresent == TRUE) {
|
||||
*MediaState = EFI_SUCCESS;
|
||||
} else {
|
||||
*MediaState = EFI_NO_MEDIA;
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue