From: xdu2 Date: Fri, 12 Feb 2010 08:45:38 +0000 (+0000) Subject: Update UNDI driver to expose dynamic media detect capability. X-Git-Tag: edk2-stable201903~16341 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=135ec2db42941107fc2ec69107784828a1f81e91 Update UNDI driver to expose dynamic media detect capability. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9995 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/OptionRomPkg/UndiRuntimeDxe/Decode.c b/OptionRomPkg/UndiRuntimeDxe/Decode.c index d2d4aba888..65ff692f7f 100644 --- a/OptionRomPkg/UndiRuntimeDxe/Decode.c +++ b/OptionRomPkg/UndiRuntimeDxe/Decode.c @@ -1,7 +1,7 @@ /** @file Provides the basic UNID functions. -Copyright (c) 2006 - 2009, Intel Corporation +Copyright (c) 2006 - 2010, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -264,7 +264,8 @@ UNDI_GetInitInfo ( DbPtr->SupportedLoopBackModes = PXE_LOOPBACK_INTERNAL_SUPPORTED | PXE_LOOPBACK_EXTERNAL_SUPPORTED; - CdbPtr->StatFlags |= PXE_STATFLAGS_CABLE_DETECT_SUPPORTED; + CdbPtr->StatFlags |= (PXE_STATFLAGS_CABLE_DETECT_SUPPORTED | + PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED); return ; } @@ -1086,6 +1087,18 @@ UNDI_Status ( } } + // + // Return current media status + // + if ((CdbPtr->OpFlags & PXE_OPFLAGS_GET_MEDIA_STATUS) != 0) { + AdapterInfo->PhyAddress = 0xFF; + AdapterInfo->CableDetect = 1; + + if (!PhyDetect (AdapterInfo)) { + CdbPtr->StatFlags |= PXE_STATFLAGS_GET_STATUS_NO_MEDIA; + } + } + return ; }