Ip6Driver.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /** @file
  2. The driver binding and service binding protocol for IP6 driver.
  3. Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_IP6_DRIVER_H__
  7. #define __EFI_IP6_DRIVER_H__
  8. extern EFI_DRIVER_BINDING_PROTOCOL gIp6DriverBinding;
  9. extern EFI_COMPONENT_NAME_PROTOCOL gIp6ComponentName;
  10. extern EFI_COMPONENT_NAME2_PROTOCOL gIp6ComponentName2;
  11. extern EFI_UNICODE_STRING_TABLE *gIp6ControllerNameTable;
  12. typedef struct {
  13. EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
  14. UINTN NumberOfChildren;
  15. EFI_HANDLE *ChildHandleBuffer;
  16. } IP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
  17. /**
  18. Clean up an IP6 service binding instance. It releases all
  19. the resource allocated by the instance. The instance may be
  20. partly initialized, or partly destroyed. If a resource is
  21. destroyed, it is marked as that in case the destroy failed and
  22. being called again later.
  23. @param[in] IpSb The IP6 service binding instance to clean up.
  24. @retval EFI_SUCCESS The resource used by the instance are cleaned up.
  25. @retval Others Failed to clean up some of the resources.
  26. **/
  27. EFI_STATUS
  28. Ip6CleanService (
  29. IN IP6_SERVICE *IpSb
  30. );
  31. //
  32. // Function prototype for the driver's entry point
  33. //
  34. /**
  35. This is the declaration of an EFI image entry point. This entry point is
  36. the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
  37. both device drivers and bus drivers.
  38. The entry point for IP6 driver which installs the driver
  39. binding and component name protocol on its image.
  40. @param[in] ImageHandle The firmware allocated handle for the UEFI image.
  41. @param[in] SystemTable A pointer to the EFI System Table.
  42. @retval EFI_SUCCESS The operation completed successfully.
  43. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  44. **/
  45. EFI_STATUS
  46. EFIAPI
  47. Ip6DriverEntryPoint (
  48. IN EFI_HANDLE ImageHandle,
  49. IN EFI_SYSTEM_TABLE *SystemTable
  50. );
  51. //
  52. // Function prototypes for the Driver Binding Protocol
  53. //
  54. /**
  55. Test to see if this driver supports ControllerHandle.
  56. @param[in] This Protocol instance pointer.
  57. @param[in] ControllerHandle Handle of device to test.
  58. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  59. device to start.
  60. @retval EFI_SUCCESS This driver supports this device.
  61. @retval EFI_ALREADY_STARTED This driver is already running on this device.
  62. @retval other This driver does not support this device.
  63. **/
  64. EFI_STATUS
  65. EFIAPI
  66. Ip6DriverBindingSupported (
  67. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  68. IN EFI_HANDLE ControllerHandle,
  69. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  70. );
  71. /**
  72. Start this driver on ControllerHandle.
  73. @param[in] This Protocol instance pointer.
  74. @param[in] ControllerHandle Handle of device to bind driver to.
  75. @param[in] RemainingDevicePath Optional parameter used to pick a specific child
  76. device to start.
  77. @retval EFI_SUCCESS This driver is added to ControllerHandle.
  78. @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
  79. @retval other This driver does not support this device.
  80. **/
  81. EFI_STATUS
  82. EFIAPI
  83. Ip6DriverBindingStart (
  84. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  85. IN EFI_HANDLE ControllerHandle,
  86. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  87. );
  88. /**
  89. Stop this driver on ControllerHandle.
  90. @param[in] This Protocol instance pointer.
  91. @param[in] ControllerHandle Handle of device to stop driver on.
  92. @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
  93. of children is zero, stop the entire bus driver.
  94. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  95. if NumberOfChildren is 0.
  96. @retval EFI_SUCCESS The device was stopped.
  97. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  98. **/
  99. EFI_STATUS
  100. EFIAPI
  101. Ip6DriverBindingStop (
  102. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  103. IN EFI_HANDLE ControllerHandle,
  104. IN UINTN NumberOfChildren,
  105. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  106. );
  107. //
  108. // Function prototypes for the ServiceBinding Protocol
  109. //
  110. /**
  111. Creates a child handle with a set of I/O services.
  112. @param[in] This Protocol instance pointer.
  113. @param[in] ChildHandle Pointer to the handle of the child to create. If
  114. it is NULL, then a new handle is created. If it
  115. is not NULL, then the I/O services are added to
  116. the existing child handle.
  117. @retval EFI_SUCCESS The child handle was created with the I/O services.
  118. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
  119. the child.
  120. @retval other The child handle was not created.
  121. **/
  122. EFI_STATUS
  123. EFIAPI
  124. Ip6ServiceBindingCreateChild (
  125. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  126. IN EFI_HANDLE *ChildHandle
  127. );
  128. /**
  129. Destroys a child handle with a set of I/O services.
  130. @param[in] This Protocol instance pointer.
  131. @param[in] ChildHandle Handle of the child to destroy.
  132. @retval EFI_SUCCESS The I/O services were removed from the child
  133. handle.
  134. @retval EFI_UNSUPPORTED The child handle does not support the I/O services
  135. that are being removed.
  136. @retval EFI_INVALID_PARAMETER Child handle is NULL.
  137. @retval EFI_ACCESS_DENIED The child handle could not be destroyed because
  138. its I/O services are being used.
  139. @retval other The child handle was not destroyed.
  140. **/
  141. EFI_STATUS
  142. EFIAPI
  143. Ip6ServiceBindingDestroyChild (
  144. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  145. IN EFI_HANDLE ChildHandle
  146. );
  147. #endif