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>
if (MediaInfo != NULL) {\r
FreePool (MediaInfo);\r
}\r
+\r
+ if (Status == EFI_UNSUPPORTED) {\r
+\r
+ //\r
+ // If gEfiAdapterInfoMediaStateGuid is not supported, call NetLibDetectMedia to get media state!\r
+ //\r
+ MediaPresent = TRUE;\r
+ Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);\r
+ if (!EFI_ERROR (Status)) {\r
+ if (MediaPresent == TRUE) {\r
+ *MediaState = EFI_SUCCESS;\r
+ } else {\r
+ *MediaState = EFI_NO_MEDIA;\r
+ }\r
+ }\r
+ return Status;\r
+ }\r
+\r
return Status;\r
}\r
\r