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
This commit is contained in:
xdu2 2010-04-01 07:44:36 +00:00
parent 35a895c9f8
commit 553472f644
1 changed files with 10 additions and 0 deletions

View File

@ -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;
}