2 Driver Binding functions implementationfor for UefiPxeBc Driver.
4 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include "PxeBcImpl.h"
14 EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp4DriverBinding
= {
15 PxeBcIp4DriverBindingSupported
,
16 PxeBcIp4DriverBindingStart
,
17 PxeBcIp4DriverBindingStop
,
23 EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp6DriverBinding
= {
24 PxeBcIp6DriverBindingSupported
,
25 PxeBcIp6DriverBindingStart
,
26 PxeBcIp6DriverBindingStop
,
33 Get the Nic handle using any child handle in the IPv4 stack.
35 @param[in] ControllerHandle Pointer to child handle over IPv4.
37 @return NicHandle The pointer to the Nic handle.
41 PxeBcGetNicByIp4Children (
42 IN EFI_HANDLE ControllerHandle
47 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiArpProtocolGuid
);
48 if (NicHandle
== NULL
) {
49 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiIp4ProtocolGuid
);
50 if (NicHandle
== NULL
) {
51 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiUdp4ProtocolGuid
);
52 if (NicHandle
== NULL
) {
53 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiDhcp4ProtocolGuid
);
54 if (NicHandle
== NULL
) {
55 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiMtftp4ProtocolGuid
);
56 if (NicHandle
== NULL
) {
69 Get the Nic handle using any child handle in the IPv6 stack.
71 @param[in] ControllerHandle Pointer to child handle over IPv6.
73 @return NicHandle The pointer to the Nic handle.
77 PxeBcGetNicByIp6Children (
78 IN EFI_HANDLE ControllerHandle
83 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiIp6ProtocolGuid
);
84 if (NicHandle
== NULL
) {
85 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiUdp6ProtocolGuid
);
86 if (NicHandle
== NULL
) {
87 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiDhcp6ProtocolGuid
);
88 if (NicHandle
== NULL
) {
89 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiMtftp6ProtocolGuid
);
90 if (NicHandle
== NULL
) {
102 Destroy the opened instances based on IPv4.
104 @param[in] This Pointer to the EFI_DRIVER_BINDING_PROTOCOL.
105 @param[in] Private Pointer to PXEBC_PRIVATE_DATA.
109 PxeBcDestroyIp4Children (
110 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
111 IN PXEBC_PRIVATE_DATA
*Private
114 ASSERT(Private
!= NULL
);
116 if (Private
->ArpChild
!= NULL
) {
118 // Close Arp for PxeBc->Arp and destroy the instance.
122 &gEfiArpProtocolGuid
,
123 This
->DriverBindingHandle
,
127 NetLibDestroyServiceChild (
129 This
->DriverBindingHandle
,
130 &gEfiArpServiceBindingProtocolGuid
,
135 if (Private
->Ip4Child
!= NULL
) {
137 // Close Ip4 for background ICMP error message and destroy the instance.
141 &gEfiIp4ProtocolGuid
,
142 This
->DriverBindingHandle
,
146 NetLibDestroyServiceChild (
148 This
->DriverBindingHandle
,
149 &gEfiIp4ServiceBindingProtocolGuid
,
154 if (Private
->Udp4WriteChild
!= NULL
) {
156 // Close Udp4 for PxeBc->UdpWrite and destroy the instance.
159 Private
->Udp4WriteChild
,
160 &gEfiUdp4ProtocolGuid
,
161 This
->DriverBindingHandle
,
165 NetLibDestroyServiceChild (
167 This
->DriverBindingHandle
,
168 &gEfiUdp4ServiceBindingProtocolGuid
,
169 Private
->Udp4WriteChild
173 if (Private
->Udp4ReadChild
!= NULL
) {
175 // Close Udp4 for PxeBc->UdpRead and destroy the instance.
178 Private
->Udp4ReadChild
,
179 &gEfiUdp4ProtocolGuid
,
180 This
->DriverBindingHandle
,
184 NetLibDestroyServiceChild (
186 This
->DriverBindingHandle
,
187 &gEfiUdp4ServiceBindingProtocolGuid
,
188 Private
->Udp4ReadChild
192 if (Private
->Mtftp4Child
!= NULL
) {
194 // Close Mtftp4 for PxeBc->Mtftp4 and destroy the instance.
197 Private
->Mtftp4Child
,
198 &gEfiMtftp4ProtocolGuid
,
199 This
->DriverBindingHandle
,
203 NetLibDestroyServiceChild (
205 This
->DriverBindingHandle
,
206 &gEfiMtftp4ServiceBindingProtocolGuid
,
211 if (Private
->Dhcp4Child
!= NULL
) {
213 // Close Dhcp4 for PxeBc->Dhcp4 and destroy the instance.
217 &gEfiDhcp4ProtocolGuid
,
218 This
->DriverBindingHandle
,
222 NetLibDestroyServiceChild (
224 This
->DriverBindingHandle
,
225 &gEfiDhcp4ServiceBindingProtocolGuid
,
230 if (Private
->Ip4Nic
!= NULL
) {
232 // Close PxeBcPrivate from the parent Nic handle and destroy the virtual handle.
237 This
->DriverBindingHandle
,
238 Private
->Ip4Nic
->Controller
241 gBS
->UninstallMultipleProtocolInterfaces (
242 Private
->Ip4Nic
->Controller
,
243 &gEfiDevicePathProtocolGuid
,
244 Private
->Ip4Nic
->DevicePath
,
245 &gEfiLoadFileProtocolGuid
,
246 &Private
->Ip4Nic
->LoadFile
,
247 &gEfiPxeBaseCodeProtocolGuid
,
251 FreePool (Private
->Ip4Nic
->DevicePath
);
253 if (Private
->Snp
!= NULL
) {
255 // Close SNP from the child virtual handle
258 Private
->Ip4Nic
->Controller
,
259 &gEfiSimpleNetworkProtocolGuid
,
260 This
->DriverBindingHandle
,
261 Private
->Ip4Nic
->Controller
264 gBS
->UninstallProtocolInterface (
265 Private
->Ip4Nic
->Controller
,
266 &gEfiSimpleNetworkProtocolGuid
,
270 FreePool (Private
->Ip4Nic
);
273 Private
->ArpChild
= NULL
;
274 Private
->Ip4Child
= NULL
;
275 Private
->Udp4WriteChild
= NULL
;
276 Private
->Udp4ReadChild
= NULL
;
277 Private
->Mtftp4Child
= NULL
;
278 Private
->Dhcp4Child
= NULL
;
279 Private
->Ip4Nic
= NULL
;
284 Destroy the opened instances based on IPv6.
286 @param[in] This Pointer to the EFI_DRIVER_BINDING_PROTOCOL.
287 @param[in] Private Pointer to PXEBC_PRIVATE_DATA.
291 PxeBcDestroyIp6Children (
292 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
293 IN PXEBC_PRIVATE_DATA
*Private
296 ASSERT(Private
!= NULL
);
298 if (Private
->Ip6Child
!= NULL
) {
300 // Close Ip6 for Ip6->Ip6Config and destroy the instance.
304 &gEfiIp6ProtocolGuid
,
305 This
->DriverBindingHandle
,
309 NetLibDestroyServiceChild (
311 This
->DriverBindingHandle
,
312 &gEfiIp6ServiceBindingProtocolGuid
,
317 if (Private
->Udp6WriteChild
!= NULL
) {
319 // Close Udp6 for PxeBc->UdpWrite and destroy the instance.
322 Private
->Udp6WriteChild
,
323 &gEfiUdp6ProtocolGuid
,
324 This
->DriverBindingHandle
,
327 NetLibDestroyServiceChild (
329 This
->DriverBindingHandle
,
330 &gEfiUdp6ServiceBindingProtocolGuid
,
331 Private
->Udp6WriteChild
335 if (Private
->Udp6ReadChild
!= NULL
) {
337 // Close Udp6 for PxeBc->UdpRead and destroy the instance.
340 Private
->Udp6ReadChild
,
341 &gEfiUdp6ProtocolGuid
,
342 This
->DriverBindingHandle
,
345 NetLibDestroyServiceChild (
347 This
->DriverBindingHandle
,
348 &gEfiUdp6ServiceBindingProtocolGuid
,
349 Private
->Udp6ReadChild
353 if (Private
->Mtftp6Child
!= NULL
) {
355 // Close Mtftp6 for PxeBc->Mtftp and destroy the instance.
358 Private
->Mtftp6Child
,
359 &gEfiMtftp6ProtocolGuid
,
360 This
->DriverBindingHandle
,
364 NetLibDestroyServiceChild (
366 This
->DriverBindingHandle
,
367 &gEfiMtftp6ServiceBindingProtocolGuid
,
372 if (Private
->Dhcp6Child
!= NULL
) {
374 // Close Dhcp6 for PxeBc->Dhcp and destroy the instance.
378 &gEfiDhcp6ProtocolGuid
,
379 This
->DriverBindingHandle
,
383 NetLibDestroyServiceChild (
385 This
->DriverBindingHandle
,
386 &gEfiDhcp6ServiceBindingProtocolGuid
,
391 if (Private
->Ip6Nic
!= NULL
) {
393 // Close PxeBcPrivate from the parent Nic handle and destroy the virtual handle.
398 This
->DriverBindingHandle
,
399 Private
->Ip6Nic
->Controller
402 gBS
->UninstallMultipleProtocolInterfaces (
403 Private
->Ip6Nic
->Controller
,
404 &gEfiDevicePathProtocolGuid
,
405 Private
->Ip6Nic
->DevicePath
,
406 &gEfiLoadFileProtocolGuid
,
407 &Private
->Ip6Nic
->LoadFile
,
408 &gEfiPxeBaseCodeProtocolGuid
,
412 FreePool (Private
->Ip6Nic
->DevicePath
);
414 if (Private
->Snp
!= NULL
) {
416 // Close SNP from the child virtual handle
419 Private
->Ip6Nic
->Controller
,
420 &gEfiSimpleNetworkProtocolGuid
,
421 This
->DriverBindingHandle
,
422 Private
->Ip6Nic
->Controller
424 gBS
->UninstallProtocolInterface (
425 Private
->Ip6Nic
->Controller
,
426 &gEfiSimpleNetworkProtocolGuid
,
430 FreePool (Private
->Ip6Nic
);
433 Private
->Ip6Child
= NULL
;
434 Private
->Udp6WriteChild
= NULL
;
435 Private
->Udp6ReadChild
= NULL
;
436 Private
->Mtftp6Child
= NULL
;
437 Private
->Dhcp6Child
= NULL
;
438 Private
->Ip6Nic
= NULL
;
439 Private
->Mode
.Ipv6Available
= FALSE
;
443 Check whether UNDI protocol supports IPv6.
445 @param[in] ControllerHandle Controller handle.
446 @param[in] Private Pointer to PXEBC_PRIVATE_DATA.
447 @param[out] Ipv6Support TRUE if UNDI supports IPv6.
449 @retval EFI_SUCCESS Get the result whether UNDI supports IPv6 by NII or AIP protocol successfully.
450 @retval EFI_NOT_FOUND Don't know whether UNDI supports IPv6 since NII or AIP is not available.
454 PxeBcCheckIpv6Support (
455 IN EFI_HANDLE ControllerHandle
,
456 IN PXEBC_PRIVATE_DATA
*Private
,
457 OUT BOOLEAN
*Ipv6Support
461 EFI_ADAPTER_INFORMATION_PROTOCOL
*Aip
;
463 EFI_GUID
*InfoTypesBuffer
;
464 UINTN InfoTypeBufferCount
;
470 ASSERT (Private
!= NULL
&& Ipv6Support
!= NULL
);
473 // Check whether the UNDI supports IPv6 by NII protocol.
475 if (Private
->Nii
!= NULL
) {
476 *Ipv6Support
= Private
->Nii
->Ipv6Supported
;
481 // Check whether the UNDI supports IPv6 by AIP protocol.
485 // Get the NIC handle by SNP protocol.
487 Handle
= NetLibGetSnpHandle (ControllerHandle
, NULL
);
488 if (Handle
== NULL
) {
489 return EFI_NOT_FOUND
;
493 Status
= gBS
->HandleProtocol (
495 &gEfiAdapterInformationProtocolGuid
,
498 if (EFI_ERROR (Status
) || Aip
== NULL
) {
499 return EFI_NOT_FOUND
;
502 InfoTypesBuffer
= NULL
;
503 InfoTypeBufferCount
= 0;
504 Status
= Aip
->GetSupportedTypes (Aip
, &InfoTypesBuffer
, &InfoTypeBufferCount
);
505 if (EFI_ERROR (Status
) || InfoTypesBuffer
== NULL
) {
506 FreePool (InfoTypesBuffer
);
507 return EFI_NOT_FOUND
;
511 for (TypeIndex
= 0; TypeIndex
< InfoTypeBufferCount
; TypeIndex
++) {
512 if (CompareGuid (&InfoTypesBuffer
[TypeIndex
], &gEfiAdapterInfoUndiIpv6SupportGuid
)) {
518 FreePool (InfoTypesBuffer
);
520 return EFI_NOT_FOUND
;
524 // We now have adapter information block.
528 Status
= Aip
->GetInformation (Aip
, &gEfiAdapterInfoUndiIpv6SupportGuid
, &InfoBlock
, &InfoBlockSize
);
529 if (EFI_ERROR (Status
) || InfoBlock
== NULL
) {
530 FreePool (InfoBlock
);
531 return EFI_NOT_FOUND
;
534 *Ipv6Support
= ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT
*) InfoBlock
)->Ipv6Support
;
535 FreePool (InfoBlock
);
541 Create the opened instances based on IPv4.
543 @param[in] This Pointer to EFI_DRIVER_BINDING_PROTOCOL.
544 @param[in] ControllerHandle Handle of the child to destroy.
545 @param[in] Private Handle Pointer to PXEBC_PRIVATE_DATA.
547 @retval EFI_SUCCESS The instances based on IPv4 were all created successfully.
548 @retval Others An unexpected error occurred.
552 PxeBcCreateIp4Children (
553 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
554 IN EFI_HANDLE ControllerHandle
,
555 IN PXEBC_PRIVATE_DATA
*Private
559 IPv4_DEVICE_PATH Ip4Node
;
560 EFI_PXE_BASE_CODE_MODE
*Mode
;
561 EFI_UDP4_CONFIG_DATA
*Udp4CfgData
;
562 EFI_IP4_CONFIG_DATA
*Ip4CfgData
;
563 EFI_IP4_MODE_DATA Ip4ModeData
;
564 PXEBC_PRIVATE_PROTOCOL
*Id
;
565 EFI_SIMPLE_NETWORK_PROTOCOL
*Snp
;
567 if (Private
->Ip4Nic
!= NULL
) {
569 // Already created before.
575 // Create Dhcp4 child and open Dhcp4 protocol for PxeBc->Dhcp.
577 Status
= NetLibCreateServiceChild (
579 This
->DriverBindingHandle
,
580 &gEfiDhcp4ServiceBindingProtocolGuid
,
583 if (EFI_ERROR (Status
)) {
587 Status
= gBS
->OpenProtocol (
589 &gEfiDhcp4ProtocolGuid
,
590 (VOID
**) &Private
->Dhcp4
,
591 This
->DriverBindingHandle
,
593 EFI_OPEN_PROTOCOL_BY_DRIVER
595 if (EFI_ERROR (Status
)) {
600 // Create Mtftp4 child and open Mtftp4 protocol for PxeBc->Mtftp.
602 Status
= NetLibCreateServiceChild (
604 This
->DriverBindingHandle
,
605 &gEfiMtftp4ServiceBindingProtocolGuid
,
606 &Private
->Mtftp4Child
608 if (EFI_ERROR (Status
)) {
612 Status
= gBS
->OpenProtocol (
613 Private
->Mtftp4Child
,
614 &gEfiMtftp4ProtocolGuid
,
615 (VOID
**) &Private
->Mtftp4
,
616 This
->DriverBindingHandle
,
618 EFI_OPEN_PROTOCOL_BY_DRIVER
620 if (EFI_ERROR (Status
)) {
625 // Create Udp4 child and open Udp4 protocol for PxeBc->UdpRead.
627 Status
= NetLibCreateServiceChild (
629 This
->DriverBindingHandle
,
630 &gEfiUdp4ServiceBindingProtocolGuid
,
631 &Private
->Udp4ReadChild
633 if (EFI_ERROR (Status
)) {
637 Status
= gBS
->OpenProtocol (
638 Private
->Udp4ReadChild
,
639 &gEfiUdp4ProtocolGuid
,
640 (VOID
**) &Private
->Udp4Read
,
641 This
->DriverBindingHandle
,
643 EFI_OPEN_PROTOCOL_BY_DRIVER
645 if (EFI_ERROR (Status
)) {
650 // Create Udp4 child and open Udp4 protocol for PxeBc->UdpWrite.
652 Status
= NetLibCreateServiceChild (
654 This
->DriverBindingHandle
,
655 &gEfiUdp4ServiceBindingProtocolGuid
,
656 &Private
->Udp4WriteChild
658 if (EFI_ERROR (Status
)) {
662 Status
= gBS
->OpenProtocol (
663 Private
->Udp4WriteChild
,
664 &gEfiUdp4ProtocolGuid
,
665 (VOID
**) &Private
->Udp4Write
,
666 This
->DriverBindingHandle
,
668 EFI_OPEN_PROTOCOL_BY_DRIVER
670 if (EFI_ERROR (Status
)) {
675 // Create Arp child and open Arp protocol for PxeBc->Arp.
677 Status
= NetLibCreateServiceChild (
679 This
->DriverBindingHandle
,
680 &gEfiArpServiceBindingProtocolGuid
,
683 if (EFI_ERROR (Status
)) {
687 Status
= gBS
->OpenProtocol (
689 &gEfiArpProtocolGuid
,
690 (VOID
**) &Private
->Arp
,
691 This
->DriverBindingHandle
,
693 EFI_OPEN_PROTOCOL_BY_DRIVER
695 if (EFI_ERROR (Status
)) {
700 // Create Ip4 child and open Ip4 protocol for background ICMP packets.
702 Status
= NetLibCreateServiceChild (
704 This
->DriverBindingHandle
,
705 &gEfiIp4ServiceBindingProtocolGuid
,
708 if (EFI_ERROR (Status
)) {
712 Status
= gBS
->OpenProtocol (
714 &gEfiIp4ProtocolGuid
,
715 (VOID
**) &Private
->Ip4
,
716 This
->DriverBindingHandle
,
718 EFI_OPEN_PROTOCOL_BY_DRIVER
720 if (EFI_ERROR (Status
)) {
725 // Get max packet size from Ip4 to calculate block size for Tftp later.
727 Status
= Private
->Ip4
->GetModeData (Private
->Ip4
, &Ip4ModeData
, NULL
, NULL
);
728 if (EFI_ERROR (Status
)) {
732 Private
->Ip4MaxPacketSize
= Ip4ModeData
.MaxPacketSize
;
734 Private
->Ip4Nic
= AllocateZeroPool (sizeof (PXEBC_VIRTUAL_NIC
));
735 if (Private
->Ip4Nic
== NULL
) {
736 return EFI_OUT_OF_RESOURCES
;
739 Private
->Ip4Nic
->Private
= Private
;
740 Private
->Ip4Nic
->Signature
= PXEBC_VIRTUAL_NIC_SIGNATURE
;
743 // Locate Ip4->Ip4Config2 and store it for set IPv4 Policy.
745 Status
= gBS
->HandleProtocol (
747 &gEfiIp4Config2ProtocolGuid
,
748 (VOID
**) &Private
->Ip4Config2
750 if (EFI_ERROR (Status
)) {
755 // Create a device path node for Ipv4 virtual nic, and append it.
757 ZeroMem (&Ip4Node
, sizeof (IPv4_DEVICE_PATH
));
758 Ip4Node
.Header
.Type
= MESSAGING_DEVICE_PATH
;
759 Ip4Node
.Header
.SubType
= MSG_IPv4_DP
;
760 Ip4Node
.StaticIpAddress
= FALSE
;
762 SetDevicePathNodeLength (&Ip4Node
.Header
, sizeof (Ip4Node
));
764 Private
->Ip4Nic
->DevicePath
= AppendDevicePathNode (Private
->DevicePath
, &Ip4Node
.Header
);
766 if (Private
->Ip4Nic
->DevicePath
== NULL
) {
767 Status
= EFI_OUT_OF_RESOURCES
;
772 &Private
->Ip4Nic
->LoadFile
,
773 &gLoadFileProtocolTemplate
,
774 sizeof (EFI_LOAD_FILE_PROTOCOL
)
778 // Create a new handle for IPv4 virtual nic,
779 // and install PxeBaseCode, LoadFile and DevicePath protocols.
781 Status
= gBS
->InstallMultipleProtocolInterfaces (
782 &Private
->Ip4Nic
->Controller
,
783 &gEfiDevicePathProtocolGuid
,
784 Private
->Ip4Nic
->DevicePath
,
785 &gEfiLoadFileProtocolGuid
,
786 &Private
->Ip4Nic
->LoadFile
,
787 &gEfiPxeBaseCodeProtocolGuid
,
791 if (EFI_ERROR (Status
)) {
795 if (Private
->Snp
!= NULL
) {
797 // Install SNP protocol on purpose is for some OS loader backward
798 // compatibility consideration.
800 Status
= gBS
->InstallProtocolInterface (
801 &Private
->Ip4Nic
->Controller
,
802 &gEfiSimpleNetworkProtocolGuid
,
803 EFI_NATIVE_INTERFACE
,
806 if (EFI_ERROR (Status
)) {
811 // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
812 // layering to perform the experiment.
814 Status
= gBS
->OpenProtocol (
815 Private
->Ip4Nic
->Controller
,
816 &gEfiSimpleNetworkProtocolGuid
,
818 This
->DriverBindingHandle
,
819 Private
->Ip4Nic
->Controller
,
820 EFI_OPEN_PROTOCOL_BY_DRIVER
|EFI_OPEN_PROTOCOL_EXCLUSIVE
822 if (EFI_ERROR (Status
)) {
828 // Open PxeBaseCodePrivate protocol by child to setup a parent-child relationship between
829 // real NIC handle and the virtual IPv4 NIC handle.
831 Status
= gBS
->OpenProtocol (
835 This
->DriverBindingHandle
,
836 Private
->Ip4Nic
->Controller
,
837 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
839 if (EFI_ERROR (Status
)) {
844 // Set default configure data for Udp4Read and Ip4 instance.
846 Mode
= Private
->PxeBc
.Mode
;
847 Udp4CfgData
= &Private
->Udp4CfgData
;
848 Ip4CfgData
= &Private
->Ip4CfgData
;
850 Udp4CfgData
->AcceptBroadcast
= FALSE
;
851 Udp4CfgData
->AcceptAnyPort
= TRUE
;
852 Udp4CfgData
->AllowDuplicatePort
= TRUE
;
853 Udp4CfgData
->TypeOfService
= Mode
->ToS
;
854 Udp4CfgData
->TimeToLive
= Mode
->TTL
;
855 Udp4CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
856 Udp4CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
858 Ip4CfgData
->AcceptIcmpErrors
= TRUE
;
859 Ip4CfgData
->DefaultProtocol
= EFI_IP_PROTO_ICMP
;
860 Ip4CfgData
->TypeOfService
= Mode
->ToS
;
861 Ip4CfgData
->TimeToLive
= Mode
->TTL
;
862 Ip4CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
863 Ip4CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
868 PxeBcDestroyIp4Children (This
, Private
);
874 Create the opened instances based on IPv6.
876 @param[in] This Pointer to EFI_DRIVER_BINDING_PROTOCOL.
877 @param[in] ControllerHandle Handle of the child to destroy.
878 @param[in] Private Handle Pointer to PXEBC_PRIVATE_DATA.
880 @retval EFI_SUCCESS The instances based on IPv6 were all created successfully.
881 @retval Others An unexpected error occurred.
885 PxeBcCreateIp6Children (
886 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
887 IN EFI_HANDLE ControllerHandle
,
888 IN PXEBC_PRIVATE_DATA
*Private
892 IPv6_DEVICE_PATH Ip6Node
;
893 EFI_UDP6_CONFIG_DATA
*Udp6CfgData
;
894 EFI_IP6_CONFIG_DATA
*Ip6CfgData
;
895 EFI_IP6_MODE_DATA Ip6ModeData
;
896 PXEBC_PRIVATE_PROTOCOL
*Id
;
897 EFI_SIMPLE_NETWORK_PROTOCOL
*Snp
;
900 if (Private
->Ip6Nic
!= NULL
) {
902 // Already created before.
907 Private
->Ip6Nic
= AllocateZeroPool (sizeof (PXEBC_VIRTUAL_NIC
));
909 if (Private
->Ip6Nic
== NULL
) {
910 return EFI_OUT_OF_RESOURCES
;
913 Private
->Ip6Nic
->Private
= Private
;
914 Private
->Ip6Nic
->Signature
= PXEBC_VIRTUAL_NIC_SIGNATURE
;
917 // Create Dhcp6 child and open Dhcp6 protocol for PxeBc->Dhcp.
919 Status
= NetLibCreateServiceChild (
921 This
->DriverBindingHandle
,
922 &gEfiDhcp6ServiceBindingProtocolGuid
,
925 if (EFI_ERROR (Status
)) {
929 Status
= gBS
->OpenProtocol (
931 &gEfiDhcp6ProtocolGuid
,
932 (VOID
**) &Private
->Dhcp6
,
933 This
->DriverBindingHandle
,
935 EFI_OPEN_PROTOCOL_BY_DRIVER
937 if (EFI_ERROR (Status
)) {
942 // Generate a random IAID for the Dhcp6 assigned address.
944 Private
->IaId
= NET_RANDOM (NetRandomInitSeed ());
945 if (Private
->Snp
!= NULL
) {
946 for (Index
= 0; Index
< Private
->Snp
->Mode
->HwAddressSize
; Index
++) {
947 Private
->IaId
|= (Private
->Snp
->Mode
->CurrentAddress
.Addr
[Index
] << ((Index
<< 3) & 31));
952 // Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp.
954 Status
= NetLibCreateServiceChild (
956 This
->DriverBindingHandle
,
957 &gEfiMtftp6ServiceBindingProtocolGuid
,
958 &Private
->Mtftp6Child
960 if (EFI_ERROR (Status
)) {
964 Status
= gBS
->OpenProtocol (
965 Private
->Mtftp6Child
,
966 &gEfiMtftp6ProtocolGuid
,
967 (VOID
**) &Private
->Mtftp6
,
968 This
->DriverBindingHandle
,
970 EFI_OPEN_PROTOCOL_BY_DRIVER
972 if (EFI_ERROR (Status
)) {
977 // Create Udp6 child and open Udp6 protocol for PxeBc->UdpRead.
979 Status
= NetLibCreateServiceChild (
981 This
->DriverBindingHandle
,
982 &gEfiUdp6ServiceBindingProtocolGuid
,
983 &Private
->Udp6ReadChild
985 if (EFI_ERROR (Status
)) {
989 Status
= gBS
->OpenProtocol (
990 Private
->Udp6ReadChild
,
991 &gEfiUdp6ProtocolGuid
,
992 (VOID
**) &Private
->Udp6Read
,
993 This
->DriverBindingHandle
,
995 EFI_OPEN_PROTOCOL_BY_DRIVER
997 if (EFI_ERROR (Status
)) {
1002 // Create Udp6 child and open Udp6 protocol for PxeBc->UdpWrite.
1004 Status
= NetLibCreateServiceChild (
1006 This
->DriverBindingHandle
,
1007 &gEfiUdp6ServiceBindingProtocolGuid
,
1008 &Private
->Udp6WriteChild
1010 if (EFI_ERROR (Status
)) {
1014 Status
= gBS
->OpenProtocol (
1015 Private
->Udp6WriteChild
,
1016 &gEfiUdp6ProtocolGuid
,
1017 (VOID
**) &Private
->Udp6Write
,
1018 This
->DriverBindingHandle
,
1020 EFI_OPEN_PROTOCOL_BY_DRIVER
1022 if (EFI_ERROR (Status
)) {
1027 // Create Ip6 child and open Ip6 protocol for background ICMP6 packets.
1029 Status
= NetLibCreateServiceChild (
1031 This
->DriverBindingHandle
,
1032 &gEfiIp6ServiceBindingProtocolGuid
,
1035 if (EFI_ERROR (Status
)) {
1039 Status
= gBS
->OpenProtocol (
1041 &gEfiIp6ProtocolGuid
,
1042 (VOID
**) &Private
->Ip6
,
1043 This
->DriverBindingHandle
,
1045 EFI_OPEN_PROTOCOL_BY_DRIVER
1047 if (EFI_ERROR (Status
)) {
1052 // Get max packet size from Ip6 to calculate block size for Tftp later.
1054 Status
= Private
->Ip6
->GetModeData (Private
->Ip6
, &Ip6ModeData
, NULL
, NULL
);
1055 if (EFI_ERROR (Status
)) {
1059 Private
->Ip6MaxPacketSize
= Ip6ModeData
.MaxPacketSize
;
1061 if (Ip6ModeData
.AddressList
!= NULL
) {
1062 FreePool (Ip6ModeData
.AddressList
);
1065 if (Ip6ModeData
.GroupTable
!= NULL
) {
1066 FreePool (Ip6ModeData
.GroupTable
);
1069 if (Ip6ModeData
.RouteTable
!= NULL
) {
1070 FreePool (Ip6ModeData
.RouteTable
);
1073 if (Ip6ModeData
.NeighborCache
!= NULL
) {
1074 FreePool (Ip6ModeData
.NeighborCache
);
1077 if (Ip6ModeData
.PrefixTable
!= NULL
) {
1078 FreePool (Ip6ModeData
.PrefixTable
);
1081 if (Ip6ModeData
.IcmpTypeList
!= NULL
) {
1082 FreePool (Ip6ModeData
.IcmpTypeList
);
1086 // Locate Ip6->Ip6Config and store it for set IPv6 address.
1088 Status
= gBS
->HandleProtocol (
1090 &gEfiIp6ConfigProtocolGuid
,
1091 (VOID
**) &Private
->Ip6Cfg
1093 if (EFI_ERROR (Status
)) {
1098 // Create a device path node for Ipv6 virtual nic, and append it.
1100 ZeroMem (&Ip6Node
, sizeof (IPv6_DEVICE_PATH
));
1101 Ip6Node
.Header
.Type
= MESSAGING_DEVICE_PATH
;
1102 Ip6Node
.Header
.SubType
= MSG_IPv6_DP
;
1103 Ip6Node
.PrefixLength
= IP6_PREFIX_LENGTH
;
1105 SetDevicePathNodeLength (&Ip6Node
.Header
, sizeof (Ip6Node
));
1107 Private
->Ip6Nic
->DevicePath
= AppendDevicePathNode (Private
->DevicePath
, &Ip6Node
.Header
);
1109 if (Private
->Ip6Nic
->DevicePath
== NULL
) {
1110 Status
= EFI_OUT_OF_RESOURCES
;
1115 &Private
->Ip6Nic
->LoadFile
,
1116 &gLoadFileProtocolTemplate
,
1117 sizeof (EFI_LOAD_FILE_PROTOCOL
)
1121 // Create a new handle for IPv6 virtual nic,
1122 // and install PxeBaseCode, LoadFile and DevicePath protocols.
1124 Status
= gBS
->InstallMultipleProtocolInterfaces (
1125 &Private
->Ip6Nic
->Controller
,
1126 &gEfiDevicePathProtocolGuid
,
1127 Private
->Ip6Nic
->DevicePath
,
1128 &gEfiLoadFileProtocolGuid
,
1129 &Private
->Ip6Nic
->LoadFile
,
1130 &gEfiPxeBaseCodeProtocolGuid
,
1134 if (EFI_ERROR (Status
)) {
1138 if (Private
->Snp
!= NULL
) {
1140 // Install SNP protocol on purpose is for some OS loader backward
1141 // compatibility consideration.
1143 Status
= gBS
->InstallProtocolInterface (
1144 &Private
->Ip6Nic
->Controller
,
1145 &gEfiSimpleNetworkProtocolGuid
,
1146 EFI_NATIVE_INTERFACE
,
1149 if (EFI_ERROR (Status
)) {
1154 // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
1155 // layering to perform the experiment.
1157 Status
= gBS
->OpenProtocol (
1158 Private
->Ip6Nic
->Controller
,
1159 &gEfiSimpleNetworkProtocolGuid
,
1161 This
->DriverBindingHandle
,
1162 Private
->Ip6Nic
->Controller
,
1163 EFI_OPEN_PROTOCOL_BY_DRIVER
|EFI_OPEN_PROTOCOL_EXCLUSIVE
1165 if (EFI_ERROR (Status
)) {
1171 // Open PxeBaseCodePrivate protocol by child to setup a parent-child relationship between
1172 // real NIC handle and the virtual IPv6 NIC handle.
1174 Status
= gBS
->OpenProtocol (
1178 This
->DriverBindingHandle
,
1179 Private
->Ip6Nic
->Controller
,
1180 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
1182 if (EFI_ERROR (Status
)) {
1187 // Set IPv6 avaiable flag and set default configure data for
1188 // Udp6Read and Ip6 instance.
1190 Status
= PxeBcCheckIpv6Support (ControllerHandle
, Private
, &Private
->Mode
.Ipv6Available
);
1191 if (EFI_ERROR (Status
)) {
1193 // Fail to get the data whether UNDI supports IPv6. Set default value.
1195 Private
->Mode
.Ipv6Available
= TRUE
;
1198 if (!Private
->Mode
.Ipv6Available
) {
1202 Udp6CfgData
= &Private
->Udp6CfgData
;
1203 Ip6CfgData
= &Private
->Ip6CfgData
;
1205 Udp6CfgData
->AcceptAnyPort
= TRUE
;
1206 Udp6CfgData
->AllowDuplicatePort
= TRUE
;
1207 Udp6CfgData
->HopLimit
= PXEBC_DEFAULT_HOPLIMIT
;
1208 Udp6CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
1209 Udp6CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
1211 Ip6CfgData
->AcceptIcmpErrors
= TRUE
;
1212 Ip6CfgData
->DefaultProtocol
= IP6_ICMP
;
1213 Ip6CfgData
->HopLimit
= PXEBC_DEFAULT_HOPLIMIT
;
1214 Ip6CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
1215 Ip6CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
1220 PxeBcDestroyIp6Children (This
, Private
);
1226 The entry point for UefiPxeBc driver that installs the driver
1227 binding and component name protocol on its image.
1229 @param[in] ImageHandle The Image handle of the driver.
1230 @param[in] SystemTable The system table.
1238 PxeBcDriverEntryPoint (
1239 IN EFI_HANDLE ImageHandle
,
1240 IN EFI_SYSTEM_TABLE
*SystemTable
1245 Status
= EfiLibInstallDriverBindingComponentName2 (
1248 &gPxeBcIp4DriverBinding
,
1250 &gPxeBcComponentName
,
1251 &gPxeBcComponentName2
1253 if (EFI_ERROR (Status
)) {
1257 Status
= EfiLibInstallDriverBindingComponentName2 (
1260 &gPxeBcIp6DriverBinding
,
1262 &gPxeBcComponentName
,
1263 &gPxeBcComponentName2
1265 if (EFI_ERROR (Status
)) {
1266 EfiLibUninstallDriverBindingComponentName2 (
1267 &gPxeBcIp4DriverBinding
,
1268 &gPxeBcComponentName
,
1269 &gPxeBcComponentName2
1277 Test to see if this driver supports ControllerHandle. This is the worker function for
1278 PxeBcIp4(6)DriverBindingSupported.
1280 @param[in] This The pointer to the driver binding protocol.
1281 @param[in] ControllerHandle The handle of device to be tested.
1282 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1283 device to be started.
1284 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1286 @retval EFI_SUCCESS This driver supports this device.
1287 @retval EFI_UNSUPPORTED This driver does not support this device.
1293 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1294 IN EFI_HANDLE ControllerHandle
,
1295 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
,
1300 EFI_GUID
*DhcpServiceBindingGuid
;
1301 EFI_GUID
*MtftpServiceBindingGuid
;
1303 if (IpVersion
== IP_VERSION_4
) {
1304 DhcpServiceBindingGuid
= &gEfiDhcp4ServiceBindingProtocolGuid
;
1305 MtftpServiceBindingGuid
= &gEfiMtftp4ServiceBindingProtocolGuid
;
1307 DhcpServiceBindingGuid
= &gEfiDhcp6ServiceBindingProtocolGuid
;
1308 MtftpServiceBindingGuid
= &gEfiMtftp6ServiceBindingProtocolGuid
;
1312 // Try to open the Mtftp and Dhcp protocol to test whether IP stack is ready.
1314 Status
= gBS
->OpenProtocol (
1316 DhcpServiceBindingGuid
,
1318 This
->DriverBindingHandle
,
1320 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
1322 if (!EFI_ERROR (Status
)) {
1323 Status
= gBS
->OpenProtocol (
1325 MtftpServiceBindingGuid
,
1327 This
->DriverBindingHandle
,
1329 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
1334 // It's unsupported case if IP stack are not ready.
1336 if (EFI_ERROR (Status
)) {
1337 return EFI_UNSUPPORTED
;
1344 Start this driver on ControllerHandle. This is the worker function for
1345 PxeBcIp4(6)DriverBindingStart.
1347 @param[in] This The pointer to the driver binding protocol.
1348 @param[in] ControllerHandle The handle of device to be started.
1349 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1350 device to be started.
1351 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1354 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1355 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1356 @retval other This driver does not support this device.
1362 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1363 IN EFI_HANDLE ControllerHandle
,
1364 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
,
1368 PXEBC_PRIVATE_DATA
*Private
;
1370 PXEBC_PRIVATE_PROTOCOL
*Id
;
1374 Status
= gBS
->OpenProtocol (
1378 This
->DriverBindingHandle
,
1380 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1382 if (!EFI_ERROR (Status
)) {
1384 // Skip the initialization if the driver has been started already.
1386 Private
= PXEBC_PRIVATE_DATA_FROM_ID (Id
);
1390 // If the driver has not been started yet, it should do initialization.
1392 Private
= AllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA
));
1393 if (Private
== NULL
) {
1394 return EFI_OUT_OF_RESOURCES
;
1399 &gPxeBcProtocolTemplate
,
1400 sizeof (EFI_PXE_BASE_CODE_PROTOCOL
)
1403 Private
->Signature
= PXEBC_PRIVATE_DATA_SIGNATURE
;
1404 Private
->Controller
= ControllerHandle
;
1405 Private
->Image
= This
->ImageHandle
;
1406 Private
->PxeBc
.Mode
= &Private
->Mode
;
1407 Private
->Mode
.Ipv6Supported
= TRUE
;
1408 Private
->Mode
.AutoArp
= TRUE
;
1409 Private
->Mode
.TTL
= DEFAULT_TTL
;
1410 Private
->Mode
.ToS
= DEFAULT_ToS
;
1413 // Open device path to prepare for appending virtual NIC node.
1415 Status
= gBS
->OpenProtocol (
1417 &gEfiDevicePathProtocolGuid
,
1418 (VOID
**) &Private
->DevicePath
,
1419 This
->DriverBindingHandle
,
1421 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1424 if (EFI_ERROR (Status
)) {
1429 // Get the NII interface if it exists, it's not required.
1431 Status
= gBS
->OpenProtocol (
1433 &gEfiNetworkInterfaceIdentifierProtocolGuid_31
,
1434 (VOID
**) &Private
->Nii
,
1435 This
->DriverBindingHandle
,
1437 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1439 if (EFI_ERROR (Status
)) {
1440 Private
->Nii
= NULL
;
1444 // Install PxeBaseCodePrivate protocol onto the real NIC handler.
1445 // PxeBaseCodePrivate protocol is only used to keep the relationship between
1446 // NIC handle and virtual child handles.
1447 // gEfiCallerIdGuid will be used as its protocol guid.
1449 Status
= gBS
->InstallProtocolInterface (
1452 EFI_NATIVE_INTERFACE
,
1455 if (EFI_ERROR (Status
)) {
1460 // Try to locate SNP protocol.
1462 NetLibGetSnpHandle(ControllerHandle
, &Private
->Snp
);
1465 if (IpVersion
== IP_VERSION_4
) {
1467 // Try to create virtual NIC handle for IPv4.
1469 Status
= PxeBcCreateIp4Children (This
, ControllerHandle
, Private
);
1472 // Try to create virtual NIC handle for IPv6.
1474 Status
= PxeBcCreateIp6Children (This
, ControllerHandle
, Private
);
1476 if (EFI_ERROR (Status
)) {
1478 // Failed to start PXE driver if IPv4 and IPv6 stack are both not available.
1480 Status
= EFI_DEVICE_ERROR
;
1488 gBS
->UninstallProtocolInterface (
1495 if (IpVersion
== IP_VERSION_4
) {
1496 PxeBcDestroyIp4Children (This
, Private
);
1498 PxeBcDestroyIp6Children (This
, Private
);
1501 if (FirstStart
&& Private
!= NULL
) {
1510 Stop this driver on ControllerHandle. This is the worker function for
1511 PxeBcIp4(6)DriverBindingStop.
1513 @param[in] This Protocol instance pointer.
1514 @param[in] ControllerHandle Handle of device to stop driver on.
1515 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1516 children is zero stop the entire bus driver.
1517 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1518 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1520 @retval EFI_SUCCESS This driver was removed ControllerHandle.
1521 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1522 @retval Others This driver was not removed from this device
1528 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1529 IN EFI_HANDLE ControllerHandle
,
1530 IN UINTN NumberOfChildren
,
1531 IN EFI_HANDLE
*ChildHandleBuffer
,
1535 PXEBC_PRIVATE_DATA
*Private
;
1536 PXEBC_VIRTUAL_NIC
*VirtualNic
;
1537 EFI_LOAD_FILE_PROTOCOL
*LoadFile
;
1539 EFI_HANDLE NicHandle
;
1540 PXEBC_PRIVATE_PROTOCOL
*Id
;
1548 Status
= gBS
->OpenProtocol (
1550 &gEfiLoadFileProtocolGuid
,
1551 (VOID
**) &LoadFile
,
1552 This
->DriverBindingHandle
,
1554 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1556 if (EFI_ERROR (Status
)) {
1558 // Get the Nic handle by any pass-over service child handle.
1560 if (IpVersion
== IP_VERSION_4
) {
1561 NicHandle
= PxeBcGetNicByIp4Children (ControllerHandle
);
1563 NicHandle
= PxeBcGetNicByIp6Children (ControllerHandle
);
1565 if (NicHandle
== NULL
) {
1570 // Try to retrieve the private data by PxeBcPrivate protocol.
1572 Status
= gBS
->OpenProtocol (
1576 This
->DriverBindingHandle
,
1578 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1580 if (EFI_ERROR (Status
)) {
1583 Private
= PXEBC_PRIVATE_DATA_FROM_ID (Id
);
1587 // It's a virtual handle with LoadFileProtocol.
1589 Status
= gBS
->OpenProtocol (
1591 &gEfiLoadFileProtocolGuid
,
1592 (VOID
**) &LoadFile
,
1593 This
->DriverBindingHandle
,
1595 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1597 if (EFI_ERROR (Status
)) {
1601 VirtualNic
= PXEBC_VIRTUAL_NIC_FROM_LOADFILE (LoadFile
);
1602 Private
= VirtualNic
->Private
;
1603 NicHandle
= Private
->Controller
;
1607 // Stop functionality of PXE Base Code protocol
1609 Status
= Private
->PxeBc
.Stop (&Private
->PxeBc
);
1610 if (Status
!= EFI_SUCCESS
&& Status
!= EFI_NOT_STARTED
) {
1615 if (Private
->Ip4Nic
!= NULL
&& IpVersion
== IP_VERSION_4
) {
1616 PxeBcDestroyIp4Children (This
, Private
);
1619 if (Private
->Ip6Nic
!= NULL
&& IpVersion
== IP_VERSION_6
) {
1620 PxeBcDestroyIp6Children (This
, Private
);
1623 if (Private
->Ip4Nic
== NULL
&& Private
->Ip6Nic
== NULL
) {
1624 gBS
->UninstallProtocolInterface (
1636 Test to see if this driver supports ControllerHandle. This service
1637 is called by the EFI boot service ConnectController(). In
1638 order to make drivers as small as possible, there are a few calling
1639 restrictions for this service. ConnectController() must
1640 follow these calling restrictions. If any other agent wishes to call
1641 Supported() it must also follow these calling restrictions.
1643 @param[in] This The pointer to the driver binding protocol.
1644 @param[in] ControllerHandle The handle of device to be tested.
1645 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1646 device to be started.
1648 @retval EFI_SUCCESS This driver supports this device.
1649 @retval EFI_UNSUPPORTED This driver does not support this device.
1654 PxeBcIp4DriverBindingSupported (
1655 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1656 IN EFI_HANDLE ControllerHandle
,
1657 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1660 return PxeBcSupported (
1663 RemainingDevicePath
,
1669 Start this driver on ControllerHandle. This service is called by the
1670 EFI boot service ConnectController(). In order to make
1671 drivers as small as possible, there are a few calling restrictions for
1672 this service. ConnectController() must follow these
1673 calling restrictions. If any other agent wishes to call Start() it
1674 must also follow these calling restrictions.
1676 @param[in] This The pointer to the driver binding protocol.
1677 @param[in] ControllerHandle The handle of device to be started.
1678 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1679 device to be started.
1681 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1682 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1683 @retval other This driver does not support this device.
1688 PxeBcIp4DriverBindingStart (
1689 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1690 IN EFI_HANDLE ControllerHandle
,
1691 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1697 RemainingDevicePath
,
1703 Stop this driver on ControllerHandle. This service is called by the
1704 EFI boot service DisconnectController(). In order to
1705 make drivers as small as possible, there are a few calling
1706 restrictions for this service. DisconnectController()
1707 must follow these calling restrictions. If any other agent wishes
1708 to call Stop() it must also follow these calling restrictions.
1710 @param[in] This Protocol instance pointer.
1711 @param[in] ControllerHandle Handle of device to stop driver on
1712 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1713 children is zero stop the entire bus driver.
1714 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1716 @retval EFI_SUCCESS This driver is removed ControllerHandle
1717 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1718 @retval Others This driver was not removed from this device.
1723 PxeBcIp4DriverBindingStop (
1724 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1725 IN EFI_HANDLE ControllerHandle
,
1726 IN UINTN NumberOfChildren
,
1727 IN EFI_HANDLE
*ChildHandleBuffer
1740 Test to see if this driver supports ControllerHandle. This service
1741 is called by the EFI boot service ConnectController(). In
1742 order to make drivers as small as possible, there are a few calling
1743 restrictions for this service. ConnectController() must
1744 follow these calling restrictions. If any other agent wishes to call
1745 Supported() it must also follow these calling restrictions.
1747 @param[in] This The pointer to the driver binding protocol.
1748 @param[in] ControllerHandle The handle of device to be tested.
1749 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
1750 device to be started.
1752 @retval EFI_SUCCESS This driver supports this device.
1753 @retval EFI_UNSUPPORTED This driver does not support this device.
1758 PxeBcIp6DriverBindingSupported (
1759 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1760 IN EFI_HANDLE ControllerHandle
,
1761 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1764 return PxeBcSupported (
1767 RemainingDevicePath
,
1773 Start this driver on ControllerHandle. This service is called by the
1774 EFI boot service ConnectController(). In order to make
1775 drivers as small as possible, there are a few calling restrictions for
1776 this service. ConnectController() must follow these
1777 calling restrictions. If any other agent wishes to call Start() it
1778 must also follow these calling restrictions.
1780 @param[in] This The pointer to the driver binding protocol.
1781 @param[in] ControllerHandle The handle of device to be started.
1782 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1783 device to be started.
1785 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1786 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1787 @retval other This driver does not support this device.
1792 PxeBcIp6DriverBindingStart (
1793 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1794 IN EFI_HANDLE ControllerHandle
,
1795 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1801 RemainingDevicePath
,
1807 Stop this driver on ControllerHandle. This service is called by the
1808 EFI boot service DisconnectController(). In order to
1809 make drivers as small as possible, there are a few calling
1810 restrictions for this service. DisconnectController()
1811 must follow these calling restrictions. If any other agent wishes
1812 to call Stop() it must also follow these calling restrictions.
1814 @param[in] This Protocol instance pointer.
1815 @param[in] ControllerHandle Handle of device to stop driver on
1816 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1817 children is zero stop the entire bus driver.
1818 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1820 @retval EFI_SUCCESS This driver is removed ControllerHandle
1821 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1822 @retval Others This driver was not removed from this device.
1827 PxeBcIp6DriverBindingStop (
1828 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1829 IN EFI_HANDLE ControllerHandle
,
1830 IN UINTN NumberOfChildren
,
1831 IN EFI_HANDLE
*ChildHandleBuffer