]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance SNP to be compatible with UNDI driver which doesn’t report correct network...
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 1 Apr 2010 07:44:36 +0000 (07:44 +0000)
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 1 Apr 2010 07:44:36 +0000 (07:44 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10327 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/SnpDxe/Receive.c

index a37156aa0b1fa5c1ac6846ef4c8f89d27896f903..9d03499327860ca4902314b4904fb198a87c4c10 100644 (file)
@@ -132,6 +132,16 @@ PxeReceive (
     *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol);\r
   }\r
 \r
     *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol);\r
   }\r
 \r
+  //\r
+  // We have received a packet from network interface, which implies that the\r
+  // network cable should be present. While, some UNDI driver may not report\r
+  // correct media status during Snp->Initialize(). So, we need ensure\r
+  // MediaPresent in SNP mode data is set to correct value.\r
+  //\r
+  if (Snp->Mode.MediaPresentSupported && !Snp->Mode.MediaPresent) {\r
+    Snp->Mode.MediaPresent = TRUE;\r
+  }\r
+\r
   return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r
 }\r
 \r
   return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r
 }\r
 \r