]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/UndiRuntimeDxe/Decode.c
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / OptionRomPkg / UndiRuntimeDxe / Decode.c
index d2d4aba888ea924c6bc7dab695ec609563898ea5..56a70127872eed1a44f85ba7f5e6783cab0ea97d 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Provides the basic UNID functions.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -264,7 +264,8 @@ UNDI_GetInitInfo (
   DbPtr->SupportedLoopBackModes = PXE_LOOPBACK_INTERNAL_SUPPORTED |\r
                     PXE_LOOPBACK_EXTERNAL_SUPPORTED;\r
 \r
-  CdbPtr->StatFlags |= PXE_STATFLAGS_CABLE_DETECT_SUPPORTED;\r
+  CdbPtr->StatFlags |= (PXE_STATFLAGS_CABLE_DETECT_SUPPORTED |\r
+                        PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED);\r
   return ;\r
 }\r
 \r
@@ -1086,6 +1087,18 @@ UNDI_Status (
     }\r
   }\r
 \r
+  //\r
+  // Return current media status\r
+  //\r
+  if ((CdbPtr->OpFlags & PXE_OPFLAGS_GET_MEDIA_STATUS) != 0) {\r
+    AdapterInfo->PhyAddress = 0xFF;\r
+    AdapterInfo->CableDetect = 1;\r
+\r
+    if (!PhyDetect (AdapterInfo)) {\r
+      CdbPtr->StatFlags |= PXE_STATFLAGS_GET_STATUS_NO_MEDIA;\r
+    }\r
+  }\r
+\r
   return ;\r
 }\r
 \r