From 553472f6447941f24bf9ae8c5ac54e04edf90dab Mon Sep 17 00:00:00 2001 From: xdu2 Date: Thu, 1 Apr 2010 07:44:36 +0000 Subject: =?UTF-8?q?Enhance=20SNP=20to=20be=20compatible=20with=20UNDI=20dr?= =?UTF-8?q?iver=20which=20doesn=E2=80=99t=20report=20correct=20network=20c?= =?UTF-8?q?able=20status=20in=20Initialize(),=20i.e.=20force=20MediaPresen?= =?UTF-8?q?t=20in=20Snp=20Mode=20to=20be=20TRUE=20in=20case=20UNDI=20drive?= =?UTF-8?q?r=20report=20no=20media=20but=20actually=20we=20have=20already?= =?UTF-8?q?=20received=20packet=20from=20network=20interface.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10327 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/SnpDxe/Receive.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'MdeModulePkg/Universal/Network/SnpDxe/Receive.c') diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Receive.c b/MdeModulePkg/Universal/Network/SnpDxe/Receive.c index a37156aa0b..9d03499327 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Receive.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Receive.c @@ -132,6 +132,16 @@ PxeReceive ( *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol); } + // + // We have received a packet from network interface, which implies that the + // network cable should be present. While, some UNDI driver may not report + // correct media status during Snp->Initialize(). So, we need ensure + // MediaPresent in SNP mode data is set to correct value. + // + if (Snp->Mode.MediaPresentSupported && !Snp->Mode.MediaPresent) { + Snp->Mode.MediaPresent = TRUE; + } + return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL; } -- cgit v1.2.3