Get MaxPacketSize from IP4 mode data and reduce the head size of UDP and MTFTP, and take it as BlockSize to download.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9894 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ljin6
2010-02-01 03:32:28 +00:00
parent 9f7d5b46aa
commit fa6d3ee491
4 changed files with 29 additions and 11 deletions

View File

@@ -152,6 +152,7 @@ PxeBcDriverBindingStart (
PXEBC_PRIVATE_DATA *Private;
UINTN Index;
EFI_STATUS Status;
EFI_IP4_MODE_DATA Ip4ModeData;
Private = AllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA));
if (Private == NULL) {
@@ -253,6 +254,16 @@ PxeBcDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Get max packet size from Ip4 to calculate block size for Tftp later.
//
Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Private->Ip4MaxPacketSize = Ip4ModeData.MaxPacketSize;
Status = NetLibCreateServiceChild (
ControllerHandle,