enhanced UefiPxeBcDxe to support
1. AutoArp. 2. SendGuid. 3 TftpError. 4. IcmpError. 5. RouteTable. 6. ArpCache. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4981 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -220,6 +220,28 @@ PxeBcDriverBindingStart (
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = NetLibCreateServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiIp4ServiceBindingProtocolGuid,
|
||||
&Private->Ip4Child
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Ip4Child,
|
||||
&gEfiIp4ProtocolGuid,
|
||||
(VOID **) &Private->Ip4,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = NetLibCreateServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
@@ -280,6 +302,17 @@ PxeBcDriverBindingStart (
|
||||
Private->Udp4CfgData.UseDefaultAddress = FALSE;
|
||||
|
||||
PxeBcInitSeedPacket (&Private->SeedPacket, Private->Udp4);
|
||||
Private->MacLen = Private->SeedPacket.Dhcp4.Header.HwAddrLen;
|
||||
CopyMem (&Private->Mac, &Private->SeedPacket.Dhcp4.Header.ClientHwAddr[0], Private->MacLen);
|
||||
|
||||
|
||||
ZeroMem (&Private->Ip4ConfigData, sizeof (EFI_IP4_CONFIG_DATA));
|
||||
Private->Ip4ConfigData.DefaultProtocol = EFI_IP_PROTO_ICMP;
|
||||
Private->Ip4ConfigData.AcceptIcmpErrors = TRUE;
|
||||
Private->Ip4ConfigData.TypeOfService = DEFAULT_ToS;
|
||||
Private->Ip4ConfigData.TimeToLive = DEFAULT_TTL;
|
||||
Private->Ip4ConfigData.DoNotFragment = FALSE;
|
||||
Private->Ip4ConfigData.RawData = FALSE;
|
||||
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
@@ -328,6 +361,22 @@ ON_ERROR:
|
||||
);
|
||||
}
|
||||
|
||||
if (Private->Ip4Child != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Private->Ip4Child,
|
||||
&gEfiIp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
ControllerHandle,
|
||||
This->DriverBindingHandle,
|
||||
&gEfiIp4ServiceBindingProtocolGuid,
|
||||
Private->Ip4Child
|
||||
);
|
||||
}
|
||||
|
||||
if (Private->Dhcp4Child != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Private->Dhcp4Child,
|
||||
|
Reference in New Issue
Block a user