]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update UNDI driver to expose dynamic media detect capability.
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Feb 2010 08:45:38 +0000 (08:45 +0000)
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Feb 2010 08:45:38 +0000 (08:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9995 6f19259b-4bc3-4df7-8a09-765794883524

OptionRomPkg/UndiRuntimeDxe/Decode.c

index d2d4aba888ea924c6bc7dab695ec609563898ea5..65ff692f7f78125e84659de6151162f8abe32ef2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides the basic UNID functions.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -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