[Description]:
Problem with PXE boot to Windows Server 2008 install. The reason is that UdpRead and UdpWrite interfaces cannot work well with the same UDP instance. [Solution] Use separate instances for UDP Read and UDP write in UefiPxeBC module. [Impaction]: UefiPxeBcDxe and Udp4Dxe module. [Reference Info]: EDK tracker 1133 - Problem with PXE boot to Windows Server 2008 install. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5303 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -270,17 +270,20 @@ PxeBcDriverBindingStart (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
&Private->Udp4Child
|
||||
&Private->Udp4ReadChild
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The UDP instance for EfiPxeBcUdpRead
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp4Child,
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
(VOID **) &Private->Udp4,
|
||||
(VOID **) &Private->Udp4Read,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -290,18 +293,42 @@ PxeBcDriverBindingStart (
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The UDP instance for EfiPxeBcUdpWrite
|
||||
//
|
||||
Status = NetLibCreateServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
&Private->Udp4WriteChild
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp4WriteChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
(VOID **) &Private->Udp4Write,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
ZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA));
|
||||
Private->Udp4CfgData.AcceptBroadcast = FALSE;
|
||||
Private->Udp4CfgData.AcceptPromiscuous = FALSE;
|
||||
Private->Udp4CfgData.AcceptAnyPort = FALSE;
|
||||
Private->Udp4CfgData.AcceptAnyPort = TRUE;
|
||||
Private->Udp4CfgData.AllowDuplicatePort = TRUE;
|
||||
Private->Udp4CfgData.TypeOfService = DEFAULT_ToS;
|
||||
Private->Udp4CfgData.TimeToLive = DEFAULT_TTL;
|
||||
Private->Udp4CfgData.DoNotFragment = FALSE;
|
||||
Private->Udp4CfgData.ReceiveTimeout = 10000; // 10 milliseconds
|
||||
Private->Udp4CfgData.ReceiveTimeout = 50000; // 50 milliseconds
|
||||
Private->Udp4CfgData.UseDefaultAddress = FALSE;
|
||||
|
||||
PxeBcInitSeedPacket (&Private->SeedPacket, Private->Udp4);
|
||||
PxeBcInitSeedPacket (&Private->SeedPacket, Private->Udp4Read);
|
||||
Private->MacLen = Private->SeedPacket.Dhcp4.Header.HwAddrLen;
|
||||
CopyMem (&Private->Mac, &Private->SeedPacket.Dhcp4.Header.ClientHwAddr[0], Private->MacLen);
|
||||
|
||||
@@ -330,9 +357,24 @@ PxeBcDriverBindingStart (
|
||||
|
||||
ON_ERROR:
|
||||
|
||||
if (Private->Udp4Child != NULL) {
|
||||
if (Private->Udp4WriteChild != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp4Child,
|
||||
Private->Udp4WriteChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
NetLibDestroyServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
Private->Udp4WriteChild
|
||||
);
|
||||
}
|
||||
|
||||
if (Private->Udp4ReadChild != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
@@ -341,7 +383,7 @@ ON_ERROR:
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
Private->Udp4Child
|
||||
Private->Udp4ReadChild
|
||||
);
|
||||
}
|
||||
|
||||
@@ -491,7 +533,20 @@ PxeBcDriverBindingStop (
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp4Child,
|
||||
Private->Udp4WriteChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
NicHandle
|
||||
);
|
||||
NetLibDestroyServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
Private->Udp4WriteChild
|
||||
);
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
NicHandle
|
||||
@@ -500,7 +555,7 @@ PxeBcDriverBindingStop (
|
||||
NicHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiUdp4ServiceBindingProtocolGuid,
|
||||
Private->Udp4Child
|
||||
Private->Udp4ReadChild
|
||||
);
|
||||
|
||||
gBS->CloseProtocol (
|
||||
|
Reference in New Issue
Block a user