summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-01 07:44:36 +0000
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-01 07:44:36 +0000
commit553472f6447941f24bf9ae8c5ac54e04edf90dab (patch)
tree4aa44c71b2503d6ab9cf849e69bc69259e862206
parent35a895c9f8b544ae8eac04731905c7676dc2b408 (diff)
downloadedk2-platforms-553472f6447941f24bf9ae8c5ac54e04edf90dab.tar.xz
Enhance SNP to be compatible with UNDI driver which doesn’t report correct network cable status in Initialize(), i.e. force MediaPresent in Snp Mode to be TRUE in case UNDI driver report no media but actually we have already received packet from network interface.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10327 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/Network/SnpDxe/Receive.c10
1 files changed, 10 insertions, 0 deletions
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;
}