2 Driver Binding functions implementationfor for UefiPxeBc Driver.
4 Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "PxeBcImpl.h"
19 EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp4DriverBinding
= {
20 PxeBcIp4DriverBindingSupported
,
21 PxeBcIp4DriverBindingStart
,
22 PxeBcIp4DriverBindingStop
,
28 EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp6DriverBinding
= {
29 PxeBcIp6DriverBindingSupported
,
30 PxeBcIp6DriverBindingStart
,
31 PxeBcIp6DriverBindingStop
,
38 Get the Nic handle using any child handle in the IPv4 stack.
40 @param[in] ControllerHandle Pointer to child handle over IPv4.
42 @return NicHandle The pointer to the Nic handle.
46 PxeBcGetNicByIp4Children (
47 IN EFI_HANDLE ControllerHandle
52 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiArpProtocolGuid
);
53 if (NicHandle
== NULL
) {
54 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiIp4ProtocolGuid
);
55 if (NicHandle
== NULL
) {
56 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiUdp4ProtocolGuid
);
57 if (NicHandle
== NULL
) {
58 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiDhcp4ProtocolGuid
);
59 if (NicHandle
== NULL
) {
60 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiMtftp4ProtocolGuid
);
61 if (NicHandle
== NULL
) {
74 Get the Nic handle using any child handle in the IPv6 stack.
76 @param[in] ControllerHandle Pointer to child handle over IPv6.
78 @return NicHandle The pointer to the Nic handle.
82 PxeBcGetNicByIp6Children (
83 IN EFI_HANDLE ControllerHandle
88 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiIp6ProtocolGuid
);
89 if (NicHandle
== NULL
) {
90 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiUdp6ProtocolGuid
);
91 if (NicHandle
== NULL
) {
92 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiDhcp6ProtocolGuid
);
93 if (NicHandle
== NULL
) {
94 NicHandle
= NetLibGetNicHandle (ControllerHandle
, &gEfiMtftp6ProtocolGuid
);
95 if (NicHandle
== NULL
) {
107 Destroy the opened instances based on IPv4.
109 @param[in] This Pointer to the EFI_DRIVER_BINDING_PROTOCOL.
110 @param[in] Private Pointer to PXEBC_PRIVATE_DATA.
114 PxeBcDestroyIp4Children (
115 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
116 IN PXEBC_PRIVATE_DATA
*Private
119 ASSERT(Private
!= NULL
);
121 if (Private
->ArpChild
!= NULL
) {
123 // Close Arp for PxeBc->Arp and destroy the instance.
127 &gEfiArpProtocolGuid
,
128 This
->DriverBindingHandle
,
132 NetLibDestroyServiceChild (
134 This
->DriverBindingHandle
,
135 &gEfiArpServiceBindingProtocolGuid
,
140 if (Private
->Ip4Child
!= NULL
) {
142 // Close Ip4 for background ICMP error message and destroy the instance.
146 &gEfiIp4ProtocolGuid
,
147 This
->DriverBindingHandle
,
151 NetLibDestroyServiceChild (
153 This
->DriverBindingHandle
,
154 &gEfiIp4ServiceBindingProtocolGuid
,
159 if (Private
->Udp4WriteChild
!= NULL
) {
161 // Close Udp4 for PxeBc->UdpWrite and destroy the instance.
164 Private
->Udp4WriteChild
,
165 &gEfiUdp4ProtocolGuid
,
166 This
->DriverBindingHandle
,
170 NetLibDestroyServiceChild (
172 This
->DriverBindingHandle
,
173 &gEfiUdp4ServiceBindingProtocolGuid
,
174 Private
->Udp4WriteChild
178 if (Private
->Udp4ReadChild
!= NULL
) {
180 // Close Udp4 for PxeBc->UdpRead and destroy the instance.
183 Private
->Udp4ReadChild
,
184 &gEfiUdp4ProtocolGuid
,
185 This
->DriverBindingHandle
,
189 NetLibDestroyServiceChild (
191 This
->DriverBindingHandle
,
192 &gEfiUdp4ServiceBindingProtocolGuid
,
193 Private
->Udp4ReadChild
197 if (Private
->Mtftp4Child
!= NULL
) {
199 // Close Mtftp4 for PxeBc->Mtftp4 and destroy the instance.
202 Private
->Mtftp4Child
,
203 &gEfiMtftp4ProtocolGuid
,
204 This
->DriverBindingHandle
,
208 NetLibDestroyServiceChild (
210 This
->DriverBindingHandle
,
211 &gEfiMtftp4ServiceBindingProtocolGuid
,
216 if (Private
->Dhcp4Child
!= NULL
) {
218 // Close Dhcp4 for PxeBc->Dhcp4 and destroy the instance.
222 &gEfiDhcp4ProtocolGuid
,
223 This
->DriverBindingHandle
,
227 NetLibDestroyServiceChild (
229 This
->DriverBindingHandle
,
230 &gEfiDhcp4ServiceBindingProtocolGuid
,
235 if (Private
->Ip4Nic
!= NULL
) {
237 // Close PxeBcPrivate from the parent Nic handle and destroy the virtual handle.
242 This
->DriverBindingHandle
,
243 Private
->Ip4Nic
->Controller
246 gBS
->UninstallMultipleProtocolInterfaces (
247 Private
->Ip4Nic
->Controller
,
248 &gEfiDevicePathProtocolGuid
,
249 Private
->Ip4Nic
->DevicePath
,
250 &gEfiLoadFileProtocolGuid
,
251 &Private
->Ip4Nic
->LoadFile
,
252 &gEfiPxeBaseCodeProtocolGuid
,
257 if (Private
->Snp
!= NULL
) {
259 // Close SNP from the child virtual handle
262 Private
->Ip4Nic
->Controller
,
263 &gEfiSimpleNetworkProtocolGuid
,
264 This
->DriverBindingHandle
,
265 Private
->Ip4Nic
->Controller
268 gBS
->UninstallProtocolInterface (
269 Private
->Ip4Nic
->Controller
,
270 &gEfiSimpleNetworkProtocolGuid
,
274 FreePool (Private
->Ip4Nic
);
277 Private
->ArpChild
= NULL
;
278 Private
->Ip4Child
= NULL
;
279 Private
->Udp4WriteChild
= NULL
;
280 Private
->Udp4ReadChild
= NULL
;
281 Private
->Mtftp4Child
= NULL
;
282 Private
->Dhcp4Child
= NULL
;
283 Private
->Ip4Nic
= NULL
;
288 Destroy the opened instances based on IPv6.
290 @param[in] This Pointer to the EFI_DRIVER_BINDING_PROTOCOL.
291 @param[in] Private Pointer to PXEBC_PRIVATE_DATA.
295 PxeBcDestroyIp6Children (
296 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
297 IN PXEBC_PRIVATE_DATA
*Private
300 ASSERT(Private
!= NULL
);
302 if (Private
->Ip6Child
!= NULL
) {
304 // Close Ip6 for Ip6->Ip6Config and destroy the instance.
308 &gEfiIp6ProtocolGuid
,
309 This
->DriverBindingHandle
,
313 NetLibDestroyServiceChild (
315 This
->DriverBindingHandle
,
316 &gEfiIp6ServiceBindingProtocolGuid
,
321 if (Private
->Udp6WriteChild
!= NULL
) {
323 // Close Udp6 for PxeBc->UdpWrite and destroy the instance.
326 Private
->Udp6WriteChild
,
327 &gEfiUdp6ProtocolGuid
,
328 This
->DriverBindingHandle
,
331 NetLibDestroyServiceChild (
333 This
->DriverBindingHandle
,
334 &gEfiUdp6ServiceBindingProtocolGuid
,
335 Private
->Udp6WriteChild
339 if (Private
->Udp6ReadChild
!= NULL
) {
341 // Close Udp6 for PxeBc->UdpRead and destroy the instance.
344 Private
->Udp6ReadChild
,
345 &gEfiUdp6ProtocolGuid
,
346 This
->DriverBindingHandle
,
349 NetLibDestroyServiceChild (
351 This
->DriverBindingHandle
,
352 &gEfiUdp6ServiceBindingProtocolGuid
,
353 Private
->Udp6ReadChild
357 if (Private
->Mtftp6Child
!= NULL
) {
359 // Close Mtftp6 for PxeBc->Mtftp and destroy the instance.
362 Private
->Mtftp6Child
,
363 &gEfiMtftp6ProtocolGuid
,
364 This
->DriverBindingHandle
,
368 NetLibDestroyServiceChild (
370 This
->DriverBindingHandle
,
371 &gEfiMtftp6ServiceBindingProtocolGuid
,
376 if (Private
->Dhcp6Child
!= NULL
) {
378 // Close Dhcp6 for PxeBc->Dhcp and destroy the instance.
382 &gEfiDhcp6ProtocolGuid
,
383 This
->DriverBindingHandle
,
387 NetLibDestroyServiceChild (
389 This
->DriverBindingHandle
,
390 &gEfiDhcp6ServiceBindingProtocolGuid
,
395 if (Private
->Ip6Nic
!= NULL
) {
397 // Close PxeBcPrivate from the parent Nic handle and destroy the virtual handle.
402 This
->DriverBindingHandle
,
403 Private
->Ip6Nic
->Controller
406 gBS
->UninstallMultipleProtocolInterfaces (
407 Private
->Ip6Nic
->Controller
,
408 &gEfiDevicePathProtocolGuid
,
409 Private
->Ip6Nic
->DevicePath
,
410 &gEfiLoadFileProtocolGuid
,
411 &Private
->Ip6Nic
->LoadFile
,
412 &gEfiPxeBaseCodeProtocolGuid
,
416 if (Private
->Snp
!= NULL
) {
418 // Close SNP from the child virtual handle
421 Private
->Ip6Nic
->Controller
,
422 &gEfiSimpleNetworkProtocolGuid
,
423 This
->DriverBindingHandle
,
424 Private
->Ip6Nic
->Controller
426 gBS
->UninstallProtocolInterface (
427 Private
->Ip6Nic
->Controller
,
428 &gEfiSimpleNetworkProtocolGuid
,
432 FreePool (Private
->Ip6Nic
);
435 Private
->Ip6Child
= NULL
;
436 Private
->Udp6WriteChild
= NULL
;
437 Private
->Udp6ReadChild
= NULL
;
438 Private
->Mtftp6Child
= NULL
;
439 Private
->Dhcp6Child
= NULL
;
440 Private
->Ip6Nic
= NULL
;
441 Private
->Mode
.Ipv6Available
= FALSE
;
446 Create the opened instances based on IPv4.
448 @param[in] This Pointer to EFI_DRIVER_BINDING_PROTOCOL.
449 @param[in] ControllerHandle Handle of the child to destroy.
450 @param[in] Private Handle Pointer to PXEBC_PRIVATE_DATA.
452 @retval EFI_SUCCESS The instances based on IPv4 were all created successfully.
453 @retval Others An unexpected error occurred.
457 PxeBcCreateIp4Children (
458 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
459 IN EFI_HANDLE ControllerHandle
,
460 IN PXEBC_PRIVATE_DATA
*Private
464 IPv4_DEVICE_PATH Ip4Node
;
465 EFI_PXE_BASE_CODE_MODE
*Mode
;
466 EFI_UDP4_CONFIG_DATA
*Udp4CfgData
;
467 EFI_IP4_CONFIG_DATA
*Ip4CfgData
;
468 EFI_IP4_MODE_DATA Ip4ModeData
;
469 PXEBC_PRIVATE_PROTOCOL
*Id
;
470 EFI_SIMPLE_NETWORK_PROTOCOL
*Snp
;
472 if (Private
->Ip4Nic
!= NULL
) {
474 // Already created before.
480 // Create Dhcp4 child and open Dhcp4 protocol for PxeBc->Dhcp.
482 Status
= NetLibCreateServiceChild (
484 This
->DriverBindingHandle
,
485 &gEfiDhcp4ServiceBindingProtocolGuid
,
488 if (EFI_ERROR (Status
)) {
492 Status
= gBS
->OpenProtocol (
494 &gEfiDhcp4ProtocolGuid
,
495 (VOID
**) &Private
->Dhcp4
,
496 This
->DriverBindingHandle
,
498 EFI_OPEN_PROTOCOL_BY_DRIVER
500 if (EFI_ERROR (Status
)) {
505 // Create Mtftp4 child and open Mtftp4 protocol for PxeBc->Mtftp.
507 Status
= NetLibCreateServiceChild (
509 This
->DriverBindingHandle
,
510 &gEfiMtftp4ServiceBindingProtocolGuid
,
511 &Private
->Mtftp4Child
513 if (EFI_ERROR (Status
)) {
517 Status
= gBS
->OpenProtocol (
518 Private
->Mtftp4Child
,
519 &gEfiMtftp4ProtocolGuid
,
520 (VOID
**) &Private
->Mtftp4
,
521 This
->DriverBindingHandle
,
523 EFI_OPEN_PROTOCOL_BY_DRIVER
525 if (EFI_ERROR (Status
)) {
530 // Create Udp4 child and open Udp4 protocol for PxeBc->UdpRead.
532 Status
= NetLibCreateServiceChild (
534 This
->DriverBindingHandle
,
535 &gEfiUdp4ServiceBindingProtocolGuid
,
536 &Private
->Udp4ReadChild
538 if (EFI_ERROR (Status
)) {
542 Status
= gBS
->OpenProtocol (
543 Private
->Udp4ReadChild
,
544 &gEfiUdp4ProtocolGuid
,
545 (VOID
**) &Private
->Udp4Read
,
546 This
->DriverBindingHandle
,
548 EFI_OPEN_PROTOCOL_BY_DRIVER
550 if (EFI_ERROR (Status
)) {
555 // Create Udp4 child and open Udp4 protocol for PxeBc->UdpWrite.
557 Status
= NetLibCreateServiceChild (
559 This
->DriverBindingHandle
,
560 &gEfiUdp4ServiceBindingProtocolGuid
,
561 &Private
->Udp4WriteChild
563 if (EFI_ERROR (Status
)) {
567 Status
= gBS
->OpenProtocol (
568 Private
->Udp4WriteChild
,
569 &gEfiUdp4ProtocolGuid
,
570 (VOID
**) &Private
->Udp4Write
,
571 This
->DriverBindingHandle
,
573 EFI_OPEN_PROTOCOL_BY_DRIVER
575 if (EFI_ERROR (Status
)) {
580 // Create Arp child and open Arp protocol for PxeBc->Arp.
582 Status
= NetLibCreateServiceChild (
584 This
->DriverBindingHandle
,
585 &gEfiArpServiceBindingProtocolGuid
,
588 if (EFI_ERROR (Status
)) {
592 Status
= gBS
->OpenProtocol (
594 &gEfiArpProtocolGuid
,
595 (VOID
**) &Private
->Arp
,
596 This
->DriverBindingHandle
,
598 EFI_OPEN_PROTOCOL_BY_DRIVER
600 if (EFI_ERROR (Status
)) {
605 // Create Ip4 child and open Ip4 protocol for background ICMP packets.
607 Status
= NetLibCreateServiceChild (
609 This
->DriverBindingHandle
,
610 &gEfiIp4ServiceBindingProtocolGuid
,
613 if (EFI_ERROR (Status
)) {
617 Status
= gBS
->OpenProtocol (
619 &gEfiIp4ProtocolGuid
,
620 (VOID
**) &Private
->Ip4
,
621 This
->DriverBindingHandle
,
623 EFI_OPEN_PROTOCOL_BY_DRIVER
625 if (EFI_ERROR (Status
)) {
630 // Get max packet size from Ip4 to calculate block size for Tftp later.
632 Status
= Private
->Ip4
->GetModeData (Private
->Ip4
, &Ip4ModeData
, NULL
, NULL
);
633 if (EFI_ERROR (Status
)) {
637 Private
->Ip4MaxPacketSize
= Ip4ModeData
.MaxPacketSize
;
639 Private
->Ip4Nic
= AllocateZeroPool (sizeof (PXEBC_VIRTUAL_NIC
));
640 if (Private
->Ip4Nic
== NULL
) {
641 return EFI_OUT_OF_RESOURCES
;
644 Private
->Ip4Nic
->Private
= Private
;
645 Private
->Ip4Nic
->Signature
= PXEBC_VIRTUAL_NIC_SIGNATURE
;
648 // Create a device path node for Ipv4 virtual nic, and append it.
650 ZeroMem (&Ip4Node
, sizeof (IPv4_DEVICE_PATH
));
651 Ip4Node
.Header
.Type
= MESSAGING_DEVICE_PATH
;
652 Ip4Node
.Header
.SubType
= MSG_IPv4_DP
;
653 Ip4Node
.StaticIpAddress
= FALSE
;
655 SetDevicePathNodeLength (&Ip4Node
.Header
, sizeof (Ip4Node
));
657 Private
->Ip4Nic
->DevicePath
= AppendDevicePathNode (Private
->DevicePath
, &Ip4Node
.Header
);
659 if (Private
->Ip4Nic
->DevicePath
== NULL
) {
660 Status
= EFI_OUT_OF_RESOURCES
;
665 &Private
->Ip4Nic
->LoadFile
,
666 &gLoadFileProtocolTemplate
,
667 sizeof (EFI_LOAD_FILE_PROTOCOL
)
671 // Create a new handle for IPv4 virtual nic,
672 // and install PxeBaseCode, LoadFile and DevicePath protocols.
674 Status
= gBS
->InstallMultipleProtocolInterfaces (
675 &Private
->Ip4Nic
->Controller
,
676 &gEfiDevicePathProtocolGuid
,
677 Private
->Ip4Nic
->DevicePath
,
678 &gEfiLoadFileProtocolGuid
,
679 &Private
->Ip4Nic
->LoadFile
,
680 &gEfiPxeBaseCodeProtocolGuid
,
684 if (EFI_ERROR (Status
)) {
688 if (Private
->Snp
!= NULL
) {
690 // Install SNP protocol on purpose is for some OS loader backward
691 // compatibility consideration.
693 Status
= gBS
->InstallProtocolInterface (
694 &Private
->Ip4Nic
->Controller
,
695 &gEfiSimpleNetworkProtocolGuid
,
696 EFI_NATIVE_INTERFACE
,
699 if (EFI_ERROR (Status
)) {
704 // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
705 // layering to perform the experiment.
707 Status
= gBS
->OpenProtocol (
708 Private
->Ip4Nic
->Controller
,
709 &gEfiSimpleNetworkProtocolGuid
,
711 This
->DriverBindingHandle
,
712 Private
->Ip4Nic
->Controller
,
713 EFI_OPEN_PROTOCOL_BY_DRIVER
715 if (EFI_ERROR (Status
)) {
721 // Open PxeBaseCodePrivate protocol by child to setup a parent-child relationship between
722 // real NIC handle and the virtual IPv4 NIC handle.
724 Status
= gBS
->OpenProtocol (
728 This
->DriverBindingHandle
,
729 Private
->Ip4Nic
->Controller
,
730 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
732 if (EFI_ERROR (Status
)) {
737 // Set default configure data for Udp4Read and Ip4 instance.
739 Mode
= Private
->PxeBc
.Mode
;
740 Udp4CfgData
= &Private
->Udp4CfgData
;
741 Ip4CfgData
= &Private
->Ip4CfgData
;
743 Udp4CfgData
->AcceptBroadcast
= FALSE
;
744 Udp4CfgData
->AcceptAnyPort
= TRUE
;
745 Udp4CfgData
->AllowDuplicatePort
= TRUE
;
746 Udp4CfgData
->TypeOfService
= Mode
->ToS
;
747 Udp4CfgData
->TimeToLive
= Mode
->TTL
;
748 Udp4CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
749 Udp4CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
751 Ip4CfgData
->AcceptIcmpErrors
= TRUE
;
752 Ip4CfgData
->DefaultProtocol
= EFI_IP_PROTO_ICMP
;
753 Ip4CfgData
->TypeOfService
= Mode
->ToS
;
754 Ip4CfgData
->TimeToLive
= Mode
->TTL
;
755 Ip4CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
756 Ip4CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
761 PxeBcDestroyIp4Children (This
, Private
);
767 Create the opened instances based on IPv6.
769 @param[in] This Pointer to EFI_DRIVER_BINDING_PROTOCOL.
770 @param[in] ControllerHandle Handle of the child to destroy.
771 @param[in] Private Handle Pointer to PXEBC_PRIVATE_DATA.
773 @retval EFI_SUCCESS The instances based on IPv6 were all created successfully.
774 @retval Others An unexpected error occurred.
778 PxeBcCreateIp6Children (
779 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
780 IN EFI_HANDLE ControllerHandle
,
781 IN PXEBC_PRIVATE_DATA
*Private
785 IPv6_DEVICE_PATH Ip6Node
;
786 EFI_UDP6_CONFIG_DATA
*Udp6CfgData
;
787 EFI_IP6_CONFIG_DATA
*Ip6CfgData
;
788 EFI_IP6_MODE_DATA Ip6ModeData
;
789 PXEBC_PRIVATE_PROTOCOL
*Id
;
790 EFI_SIMPLE_NETWORK_PROTOCOL
*Snp
;
793 if (Private
->Ip6Nic
!= NULL
) {
795 // Already created before.
800 Private
->Ip6Nic
= AllocateZeroPool (sizeof (PXEBC_VIRTUAL_NIC
));
802 if (Private
->Ip6Nic
== NULL
) {
803 return EFI_OUT_OF_RESOURCES
;
806 Private
->Ip6Nic
->Private
= Private
;
807 Private
->Ip6Nic
->Signature
= PXEBC_VIRTUAL_NIC_SIGNATURE
;
810 // Create Dhcp6 child and open Dhcp6 protocol for PxeBc->Dhcp.
812 Status
= NetLibCreateServiceChild (
814 This
->DriverBindingHandle
,
815 &gEfiDhcp6ServiceBindingProtocolGuid
,
818 if (EFI_ERROR (Status
)) {
822 Status
= gBS
->OpenProtocol (
824 &gEfiDhcp6ProtocolGuid
,
825 (VOID
**) &Private
->Dhcp6
,
826 This
->DriverBindingHandle
,
828 EFI_OPEN_PROTOCOL_BY_DRIVER
830 if (EFI_ERROR (Status
)) {
835 // Generate a random IAID for the Dhcp6 assigned address.
837 Private
->IaId
= NET_RANDOM (NetRandomInitSeed ());
838 if (Private
->Snp
!= NULL
) {
839 for (Index
= 0; Index
< Private
->Snp
->Mode
->HwAddressSize
; Index
++) {
840 Private
->IaId
|= (Private
->Snp
->Mode
->CurrentAddress
.Addr
[Index
] << ((Index
<< 3) & 31));
845 // Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp.
847 Status
= NetLibCreateServiceChild (
849 This
->DriverBindingHandle
,
850 &gEfiMtftp6ServiceBindingProtocolGuid
,
851 &Private
->Mtftp6Child
853 if (EFI_ERROR (Status
)) {
857 Status
= gBS
->OpenProtocol (
858 Private
->Mtftp6Child
,
859 &gEfiMtftp6ProtocolGuid
,
860 (VOID
**) &Private
->Mtftp6
,
861 This
->DriverBindingHandle
,
863 EFI_OPEN_PROTOCOL_BY_DRIVER
865 if (EFI_ERROR (Status
)) {
870 // Create Udp6 child and open Udp6 protocol for PxeBc->UdpRead.
872 Status
= NetLibCreateServiceChild (
874 This
->DriverBindingHandle
,
875 &gEfiUdp6ServiceBindingProtocolGuid
,
876 &Private
->Udp6ReadChild
878 if (EFI_ERROR (Status
)) {
882 Status
= gBS
->OpenProtocol (
883 Private
->Udp6ReadChild
,
884 &gEfiUdp6ProtocolGuid
,
885 (VOID
**) &Private
->Udp6Read
,
886 This
->DriverBindingHandle
,
888 EFI_OPEN_PROTOCOL_BY_DRIVER
890 if (EFI_ERROR (Status
)) {
895 // Create Udp6 child and open Udp6 protocol for PxeBc->UdpWrite.
897 Status
= NetLibCreateServiceChild (
899 This
->DriverBindingHandle
,
900 &gEfiUdp6ServiceBindingProtocolGuid
,
901 &Private
->Udp6WriteChild
903 if (EFI_ERROR (Status
)) {
907 Status
= gBS
->OpenProtocol (
908 Private
->Udp6WriteChild
,
909 &gEfiUdp6ProtocolGuid
,
910 (VOID
**) &Private
->Udp6Write
,
911 This
->DriverBindingHandle
,
913 EFI_OPEN_PROTOCOL_BY_DRIVER
915 if (EFI_ERROR (Status
)) {
920 // Create Ip6 child and open Ip6 protocol for background ICMP6 packets.
922 Status
= NetLibCreateServiceChild (
924 This
->DriverBindingHandle
,
925 &gEfiIp6ServiceBindingProtocolGuid
,
928 if (EFI_ERROR (Status
)) {
932 Status
= gBS
->OpenProtocol (
934 &gEfiIp6ProtocolGuid
,
935 (VOID
**) &Private
->Ip6
,
936 This
->DriverBindingHandle
,
938 EFI_OPEN_PROTOCOL_BY_DRIVER
940 if (EFI_ERROR (Status
)) {
945 // Get max packet size from Ip6 to calculate block size for Tftp later.
947 Status
= Private
->Ip6
->GetModeData (Private
->Ip6
, &Ip6ModeData
, NULL
, NULL
);
948 if (EFI_ERROR (Status
)) {
952 Private
->Ip6MaxPacketSize
= Ip6ModeData
.MaxPacketSize
;
955 // Locate Ip6->Ip6Config and store it for set IPv6 address.
957 Status
= gBS
->HandleProtocol (
959 &gEfiIp6ConfigProtocolGuid
,
960 (VOID
**) &Private
->Ip6Cfg
962 if (EFI_ERROR (Status
)) {
967 // Create a device path node for Ipv6 virtual nic, and append it.
969 ZeroMem (&Ip6Node
, sizeof (IPv6_DEVICE_PATH
));
970 Ip6Node
.Header
.Type
= MESSAGING_DEVICE_PATH
;
971 Ip6Node
.Header
.SubType
= MSG_IPv6_DP
;
972 Ip6Node
.PrefixLength
= IP6_PREFIX_LENGTH
;
974 SetDevicePathNodeLength (&Ip6Node
.Header
, sizeof (Ip6Node
));
976 Private
->Ip6Nic
->DevicePath
= AppendDevicePathNode (Private
->DevicePath
, &Ip6Node
.Header
);
978 if (Private
->Ip6Nic
->DevicePath
== NULL
) {
979 Status
= EFI_OUT_OF_RESOURCES
;
984 &Private
->Ip6Nic
->LoadFile
,
985 &gLoadFileProtocolTemplate
,
986 sizeof (EFI_LOAD_FILE_PROTOCOL
)
990 // Create a new handle for IPv6 virtual nic,
991 // and install PxeBaseCode, LoadFile and DevicePath protocols.
993 Status
= gBS
->InstallMultipleProtocolInterfaces (
994 &Private
->Ip6Nic
->Controller
,
995 &gEfiDevicePathProtocolGuid
,
996 Private
->Ip6Nic
->DevicePath
,
997 &gEfiLoadFileProtocolGuid
,
998 &Private
->Ip6Nic
->LoadFile
,
999 &gEfiPxeBaseCodeProtocolGuid
,
1003 if (EFI_ERROR (Status
)) {
1007 if (Private
->Snp
!= NULL
) {
1009 // Install SNP protocol on purpose is for some OS loader backward
1010 // compatibility consideration.
1012 Status
= gBS
->InstallProtocolInterface (
1013 &Private
->Ip6Nic
->Controller
,
1014 &gEfiSimpleNetworkProtocolGuid
,
1015 EFI_NATIVE_INTERFACE
,
1018 if (EFI_ERROR (Status
)) {
1023 // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
1024 // layering to perform the experiment.
1026 Status
= gBS
->OpenProtocol (
1027 Private
->Ip6Nic
->Controller
,
1028 &gEfiSimpleNetworkProtocolGuid
,
1030 This
->DriverBindingHandle
,
1031 Private
->Ip6Nic
->Controller
,
1032 EFI_OPEN_PROTOCOL_BY_DRIVER
1034 if (EFI_ERROR (Status
)) {
1040 // Open PxeBaseCodePrivate protocol by child to setup a parent-child relationship between
1041 // real NIC handle and the virtual IPv6 NIC handle.
1043 Status
= gBS
->OpenProtocol (
1047 This
->DriverBindingHandle
,
1048 Private
->Ip6Nic
->Controller
,
1049 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
1051 if (EFI_ERROR (Status
)) {
1056 // Set IPv6 avaiable flag and set default configure data for
1057 // Udp6Read and Ip6 instance.
1059 Private
->Mode
.Ipv6Available
= TRUE
;
1060 Udp6CfgData
= &Private
->Udp6CfgData
;
1061 Ip6CfgData
= &Private
->Ip6CfgData
;
1063 Udp6CfgData
->AcceptAnyPort
= TRUE
;
1064 Udp6CfgData
->AllowDuplicatePort
= TRUE
;
1065 Udp6CfgData
->HopLimit
= PXEBC_DEFAULT_HOPLIMIT
;
1066 Udp6CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
1067 Udp6CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
1069 Ip6CfgData
->AcceptIcmpErrors
= TRUE
;
1070 Ip6CfgData
->DefaultProtocol
= IP6_ICMP
;
1071 Ip6CfgData
->HopLimit
= PXEBC_DEFAULT_HOPLIMIT
;
1072 Ip6CfgData
->ReceiveTimeout
= PXEBC_DEFAULT_LIFETIME
;
1073 Ip6CfgData
->TransmitTimeout
= PXEBC_DEFAULT_LIFETIME
;
1078 PxeBcDestroyIp6Children (This
, Private
);
1084 The entry point for UefiPxeBc driver that installs the driver
1085 binding and component name protocol on its image.
1087 @param[in] ImageHandle The Image handle of the driver.
1088 @param[in] SystemTable The system table.
1096 PxeBcDriverEntryPoint (
1097 IN EFI_HANDLE ImageHandle
,
1098 IN EFI_SYSTEM_TABLE
*SystemTable
1103 Status
= EfiLibInstallDriverBindingComponentName2 (
1106 &gPxeBcIp4DriverBinding
,
1108 &gPxeBcComponentName
,
1109 &gPxeBcComponentName2
1111 if (EFI_ERROR (Status
)) {
1115 Status
= EfiLibInstallDriverBindingComponentName2 (
1118 &gPxeBcIp6DriverBinding
,
1120 &gPxeBcComponentName
,
1121 &gPxeBcComponentName2
1123 if (EFI_ERROR (Status
)) {
1124 gBS
->UninstallMultipleProtocolInterfaces (
1126 &gEfiDriverBindingProtocolGuid
,
1127 &gPxeBcIp4DriverBinding
,
1128 &gEfiComponentName2ProtocolGuid
,
1129 &gPxeBcComponentName2
,
1130 &gEfiComponentNameProtocolGuid
,
1131 &gPxeBcComponentName
,
1140 Test to see if this driver supports ControllerHandle. This is the worker function for
1141 PxeBcIp4(6)DriverBindingSupported.
1143 @param[in] This The pointer to the driver binding protocol.
1144 @param[in] ControllerHandle The handle of device to be tested.
1145 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1146 device to be started.
1147 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1149 @retval EFI_SUCCESS This driver supports this device.
1150 @retval EFI_UNSUPPORTED This driver does not support this device.
1156 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1157 IN EFI_HANDLE ControllerHandle
,
1158 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
,
1163 EFI_GUID
*DhcpServiceBindingGuid
;
1164 EFI_GUID
*MtftpServiceBindingGuid
;
1166 if (IpVersion
== IP_VERSION_4
) {
1167 DhcpServiceBindingGuid
= &gEfiDhcp4ServiceBindingProtocolGuid
;
1168 MtftpServiceBindingGuid
= &gEfiMtftp4ServiceBindingProtocolGuid
;
1170 DhcpServiceBindingGuid
= &gEfiDhcp6ServiceBindingProtocolGuid
;
1171 MtftpServiceBindingGuid
= &gEfiMtftp6ServiceBindingProtocolGuid
;
1175 // Try to open the Mtftp and Dhcp protocol to test whether IP stack is ready.
1177 Status
= gBS
->OpenProtocol (
1179 DhcpServiceBindingGuid
,
1181 This
->DriverBindingHandle
,
1183 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
1185 if (!EFI_ERROR (Status
)) {
1186 Status
= gBS
->OpenProtocol (
1188 MtftpServiceBindingGuid
,
1190 This
->DriverBindingHandle
,
1192 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
1197 // It's unsupported case if IP stack are not ready.
1199 if (EFI_ERROR (Status
)) {
1200 return EFI_UNSUPPORTED
;
1207 Start this driver on ControllerHandle. This is the worker function for
1208 PxeBcIp4(6)DriverBindingStart.
1210 @param[in] This The pointer to the driver binding protocol.
1211 @param[in] ControllerHandle The handle of device to be started.
1212 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1213 device to be started.
1214 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1217 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1218 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1219 @retval other This driver does not support this device.
1225 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1226 IN EFI_HANDLE ControllerHandle
,
1227 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
,
1231 PXEBC_PRIVATE_DATA
*Private
;
1233 PXEBC_PRIVATE_PROTOCOL
*Id
;
1237 Status
= gBS
->OpenProtocol (
1241 This
->DriverBindingHandle
,
1243 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1245 if (!EFI_ERROR (Status
)) {
1247 // Skip the initialization if the driver has been started already.
1249 Private
= PXEBC_PRIVATE_DATA_FROM_ID (Id
);
1253 // If the driver has not been started yet, it should do initialization.
1255 Private
= AllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA
));
1256 if (Private
== NULL
) {
1257 return EFI_OUT_OF_RESOURCES
;
1262 &gPxeBcProtocolTemplate
,
1263 sizeof (EFI_PXE_BASE_CODE_PROTOCOL
)
1266 Private
->Signature
= PXEBC_PRIVATE_DATA_SIGNATURE
;
1267 Private
->Controller
= ControllerHandle
;
1268 Private
->Image
= This
->ImageHandle
;
1269 Private
->PxeBc
.Mode
= &Private
->Mode
;
1270 Private
->Mode
.Ipv6Supported
= TRUE
;
1271 Private
->Mode
.AutoArp
= TRUE
;
1272 Private
->Mode
.TTL
= DEFAULT_TTL
;
1273 Private
->Mode
.ToS
= DEFAULT_ToS
;
1276 // Open device path to prepare for appending virtual NIC node.
1278 Status
= gBS
->OpenProtocol (
1280 &gEfiDevicePathProtocolGuid
,
1281 (VOID
**) &Private
->DevicePath
,
1282 This
->DriverBindingHandle
,
1284 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1287 if (EFI_ERROR (Status
)) {
1292 // Get the NII interface if it exists, it's not required.
1294 Status
= gBS
->OpenProtocol (
1296 &gEfiNetworkInterfaceIdentifierProtocolGuid_31
,
1297 (VOID
**) &Private
->Nii
,
1298 This
->DriverBindingHandle
,
1300 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1302 if (EFI_ERROR (Status
)) {
1303 Private
->Nii
= NULL
;
1307 // Install PxeBaseCodePrivate protocol onto the real NIC handler.
1308 // PxeBaseCodePrivate protocol is only used to keep the relationship between
1309 // NIC handle and virtual child handles.
1310 // gEfiCallerIdGuid will be used as its protocol guid.
1312 Status
= gBS
->InstallProtocolInterface (
1315 EFI_NATIVE_INTERFACE
,
1318 if (EFI_ERROR (Status
)) {
1323 // Try to locate SNP protocol.
1325 NetLibGetSnpHandle(ControllerHandle
, &Private
->Snp
);
1328 if (IpVersion
== IP_VERSION_4
) {
1330 // Try to create virtual NIC handle for IPv4.
1332 Status
= PxeBcCreateIp4Children (This
, ControllerHandle
, Private
);
1335 // Try to create virtual NIC handle for IPv6.
1337 Status
= PxeBcCreateIp6Children (This
, ControllerHandle
, Private
);
1339 if (EFI_ERROR (Status
)) {
1341 // Failed to start PXE driver if IPv4 and IPv6 stack are both not available.
1343 Status
= EFI_DEVICE_ERROR
;
1351 gBS
->UninstallProtocolInterface (
1356 if (Private
!= NULL
) {
1361 if (IpVersion
== IP_VERSION_4
) {
1362 PxeBcDestroyIp4Children (This
, Private
);
1364 PxeBcDestroyIp6Children (This
, Private
);
1372 Stop this driver on ControllerHandle. This is the worker function for
1373 PxeBcIp4(6)DriverBindingStop.
1375 @param[in] This Protocol instance pointer.
1376 @param[in] ControllerHandle Handle of device to stop driver on.
1377 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1378 children is zero stop the entire bus driver.
1379 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1380 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
1382 @retval EFI_SUCCESS This driver was removed ControllerHandle.
1383 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1384 @retval Others This driver was not removed from this device
1390 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1391 IN EFI_HANDLE ControllerHandle
,
1392 IN UINTN NumberOfChildren
,
1393 IN EFI_HANDLE
*ChildHandleBuffer
,
1397 PXEBC_PRIVATE_DATA
*Private
;
1398 PXEBC_VIRTUAL_NIC
*VirtualNic
;
1399 EFI_LOAD_FILE_PROTOCOL
*LoadFile
;
1401 EFI_HANDLE NicHandle
;
1403 PXEBC_PRIVATE_PROTOCOL
*Id
;
1412 Status
= gBS
->OpenProtocol (
1414 &gEfiLoadFileProtocolGuid
,
1415 (VOID
**) &LoadFile
,
1416 This
->DriverBindingHandle
,
1418 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1420 if (EFI_ERROR (Status
)) {
1422 // Get the Nic handle by any pass-over service child handle.
1424 if (IpVersion
== IP_VERSION_4
) {
1425 NicHandle
= PxeBcGetNicByIp4Children (ControllerHandle
);
1427 NicHandle
= PxeBcGetNicByIp6Children (ControllerHandle
);
1429 if (NicHandle
== NULL
) {
1434 // Try to retrieve the private data by PxeBcPrivate protocol.
1436 Status
= gBS
->OpenProtocol (
1440 This
->DriverBindingHandle
,
1442 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1444 if (EFI_ERROR (Status
)) {
1447 Private
= PXEBC_PRIVATE_DATA_FROM_ID (Id
);
1451 // It's a virtual handle with LoadFileProtocol.
1453 Status
= gBS
->OpenProtocol (
1455 &gEfiLoadFileProtocolGuid
,
1456 (VOID
**) &LoadFile
,
1457 This
->DriverBindingHandle
,
1459 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1461 if (EFI_ERROR (Status
)) {
1465 VirtualNic
= PXEBC_VIRTUAL_NIC_FROM_LOADFILE (LoadFile
);
1466 Private
= VirtualNic
->Private
;
1467 NicHandle
= Private
->Controller
;
1471 // Stop functionality of PXE Base Code protocol
1473 Status
= Private
->PxeBc
.Stop (&Private
->PxeBc
);
1474 if (Status
!= EFI_SUCCESS
&& Status
!= EFI_NOT_STARTED
) {
1479 if (Private
->Ip4Nic
!= NULL
&& IpVersion
== IP_VERSION_4
) {
1480 PxeBcDestroyIp4Children (This
, Private
);
1483 if (Private
->Ip6Nic
!= NULL
&& IpVersion
== IP_VERSION_6
) {
1484 PxeBcDestroyIp6Children (This
, Private
);
1487 if (Private
->Ip4Nic
== NULL
&& Private
->Ip6Nic
== NULL
) {
1488 gBS
->UninstallProtocolInterface (
1500 Test to see if this driver supports ControllerHandle. This service
1501 is called by the EFI boot service ConnectController(). In
1502 order to make drivers as small as possible, there are a few calling
1503 restrictions for this service. ConnectController() must
1504 follow these calling restrictions. If any other agent wishes to call
1505 Supported() it must also follow these calling restrictions.
1507 @param[in] This The pointer to the driver binding protocol.
1508 @param[in] ControllerHandle The handle of device to be tested.
1509 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1510 device to be started.
1512 @retval EFI_SUCCESS This driver supports this device.
1513 @retval EFI_UNSUPPORTED This driver does not support this device.
1518 PxeBcIp4DriverBindingSupported (
1519 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1520 IN EFI_HANDLE ControllerHandle
,
1521 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1524 return PxeBcSupported (
1527 RemainingDevicePath
,
1533 Start this driver on ControllerHandle. This service is called by the
1534 EFI boot service ConnectController(). In order to make
1535 drivers as small as possible, there are a few calling restrictions for
1536 this service. ConnectController() must follow these
1537 calling restrictions. If any other agent wishes to call Start() it
1538 must also follow these calling restrictions.
1540 @param[in] This The pointer to the driver binding protocol.
1541 @param[in] ControllerHandle The handle of device to be started.
1542 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1543 device to be started.
1545 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1546 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1547 @retval other This driver does not support this device.
1552 PxeBcIp4DriverBindingStart (
1553 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1554 IN EFI_HANDLE ControllerHandle
,
1555 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1561 RemainingDevicePath
,
1567 Stop this driver on ControllerHandle. This service is called by the
1568 EFI boot service DisconnectController(). In order to
1569 make drivers as small as possible, there are a few calling
1570 restrictions for this service. DisconnectController()
1571 must follow these calling restrictions. If any other agent wishes
1572 to call Stop() it must also follow these calling restrictions.
1574 @param[in] This Protocol instance pointer.
1575 @param[in] ControllerHandle Handle of device to stop driver on
1576 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1577 children is zero stop the entire bus driver.
1578 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1580 @retval EFI_SUCCESS This driver is removed ControllerHandle
1581 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1582 @retval Others This driver was not removed from this device.
1587 PxeBcIp4DriverBindingStop (
1588 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1589 IN EFI_HANDLE ControllerHandle
,
1590 IN UINTN NumberOfChildren
,
1591 IN EFI_HANDLE
*ChildHandleBuffer
1604 Test to see if this driver supports ControllerHandle. This service
1605 is called by the EFI boot service ConnectController(). In
1606 order to make drivers as small as possible, there are a few calling
1607 restrictions for this service. ConnectController() must
1608 follow these calling restrictions. If any other agent wishes to call
1609 Supported() it must also follow these calling restrictions.
1611 @param[in] This The pointer to the driver binding protocol.
1612 @param[in] ControllerHandle The handle of device to be tested.
1613 @param[in] RemainingDevicePath Optional parameter use to pick a specific child
1614 device to be started.
1616 @retval EFI_SUCCESS This driver supports this device.
1617 @retval EFI_UNSUPPORTED This driver does not support this device.
1622 PxeBcIp6DriverBindingSupported (
1623 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1624 IN EFI_HANDLE ControllerHandle
,
1625 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1628 return PxeBcSupported (
1631 RemainingDevicePath
,
1637 Start this driver on ControllerHandle. This service is called by the
1638 EFI boot service ConnectController(). In order to make
1639 drivers as small as possible, there are a few calling restrictions for
1640 this service. ConnectController() must follow these
1641 calling restrictions. If any other agent wishes to call Start() it
1642 must also follow these calling restrictions.
1644 @param[in] This The pointer to the driver binding protocol.
1645 @param[in] ControllerHandle The handle of device to be started.
1646 @param[in] RemainingDevicePath Optional parameter used to pick a specific child
1647 device to be started.
1649 @retval EFI_SUCCESS This driver is installed to ControllerHandle.
1650 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
1651 @retval other This driver does not support this device.
1656 PxeBcIp6DriverBindingStart (
1657 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1658 IN EFI_HANDLE ControllerHandle
,
1659 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
1665 RemainingDevicePath
,
1671 Stop this driver on ControllerHandle. This service is called by the
1672 EFI boot service DisconnectController(). In order to
1673 make drivers as small as possible, there are a few calling
1674 restrictions for this service. DisconnectController()
1675 must follow these calling restrictions. If any other agent wishes
1676 to call Stop() it must also follow these calling restrictions.
1678 @param[in] This Protocol instance pointer.
1679 @param[in] ControllerHandle Handle of device to stop driver on
1680 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1681 children is zero stop the entire bus driver.
1682 @param[in] ChildHandleBuffer List of Child Handles to Stop.
1684 @retval EFI_SUCCESS This driver is removed ControllerHandle
1685 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1686 @retval Others This driver was not removed from this device.
1691 PxeBcIp6DriverBindingStop (
1692 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
1693 IN EFI_HANDLE ControllerHandle
,
1694 IN UINTN NumberOfChildren
,
1695 IN EFI_HANDLE
*ChildHandleBuffer