Udp6Driver.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /** @file
  2. Driver Binding functions and Service Binding functions for the Network driver module.
  3. Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _UDP6_DRIVER_H_
  7. #define _UDP6_DRIVER_H_
  8. #include <Protocol/DriverBinding.h>
  9. #include <Protocol/ServiceBinding.h>
  10. #include <Protocol/DevicePath.h>
  11. /**
  12. Tests to see if this driver supports a given controller. If a child device is provided,
  13. it further tests to see if this driver supports creating a handle for the specified child device.
  14. This function checks to see if the driver specified by This supports the device specified by
  15. ControllerHandle. Drivers typically use the device path attached to
  16. ControllerHandle and/or the services from the bus I/O abstraction attached to
  17. ControllerHandle to determine if the driver supports ControllerHandle. This function
  18. may be called many times during platform initialization. In order to reduce boot times, the tests
  19. performed by this function must be very small, and take as little time as possible to execute. This
  20. function must not change the state of any hardware devices, and this function must be aware that the
  21. device specified by ControllerHandle may already be managed by the same driver or a
  22. different driver. This function must match its calls to AllocatePages() with FreePages(),
  23. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  24. Since ControllerHandle may have been previously started by the same driver, if a protocol is
  25. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  26. to guarantee the state of ControllerHandle is not modified by this function.
  27. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  28. @param[in] ControllerHandle The handle of the controller to test. This handle
  29. must support a protocol interface that supplies
  30. an I/O abstraction to the driver.
  31. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  32. parameter is ignored by device drivers, and is optional for bus
  33. drivers. For bus drivers, if this parameter is not NULL, then
  34. the bus driver must determine if the bus controller specified
  35. by ControllerHandle and the child controller specified
  36. by RemainingDevicePath are both supported by this
  37. bus driver.
  38. @retval EFI_SUCCESS The device specified by ControllerHandle and
  39. RemainingDevicePath is supported by the driver specified by This.
  40. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  41. RemainingDevicePath is already being managed by the driver
  42. specified by This.
  43. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  44. RemainingDevicePath is already being managed by a different
  45. driver or an application that requires exclusive access.
  46. Currently not implemented.
  47. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  48. RemainingDevicePath is not supported by the driver specified by This.
  49. **/
  50. EFI_STATUS
  51. EFIAPI
  52. Udp6DriverBindingSupported (
  53. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  54. IN EFI_HANDLE ControllerHandle,
  55. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  56. );
  57. /**
  58. Start this driver on ControllerHandle.
  59. This service is called by the EFI boot service ConnectController(). In order to make
  60. drivers as small as possible, there are a few calling restrictions for
  61. this service. ConnectController() must follow these
  62. calling restrictions. If any other agent wishes to call Start() it
  63. must also follow these calling restrictions.
  64. @param[in] This Protocol instance pointer.
  65. @param[in] ControllerHandle Handle of device to bind a driver to.
  66. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  67. device to start.
  68. @retval EFI_SUCCESS This driver is added to ControllerHandle.
  69. @retval EFI_OUT_OF_RESOURCES The required system resource can't be allocated.
  70. @retval other This driver does not support this device.
  71. **/
  72. EFI_STATUS
  73. EFIAPI
  74. Udp6DriverBindingStart (
  75. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  76. IN EFI_HANDLE ControllerHandle,
  77. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  78. );
  79. /**
  80. Stop this driver on ControllerHandle.
  81. This service is called by the EFI boot service DisconnectController(). In order to
  82. make drivers as small as possible, there are a few calling
  83. restrictions for this service. DisconnectController()
  84. must follow these calling restrictions. If any other agent wishes
  85. to call Stop(), it must also follow these calling restrictions.
  86. @param[in] This Protocol instance pointer.
  87. @param[in] ControllerHandle Handle of device to stop the driver on.
  88. @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
  89. of children is zero, stop the entire bus driver.
  90. @param[in] ChildHandleBuffer List of Child Handles to Stop. It is optional.
  91. @retval EFI_SUCCESS This driver removed ControllerHandle.
  92. @retval EFI_DEVICE_ERROR Can't find the NicHandle from the ControllerHandle and specified GUID.
  93. @retval other This driver was not removed from this device.
  94. **/
  95. EFI_STATUS
  96. EFIAPI
  97. Udp6DriverBindingStop (
  98. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  99. IN EFI_HANDLE ControllerHandle,
  100. IN UINTN NumberOfChildren,
  101. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  102. );
  103. /**
  104. Creates a child handle and installs a protocol.
  105. The CreateChild() function installs a protocol on ChildHandle.
  106. If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
  107. If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
  108. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  109. @param[in, out] ChildHandle Pointer to the handle of the child to create. If it is NULL,
  110. then a new handle is created. If it is a pointer to an existing UEFI handle,
  111. then the protocol is added to the existing UEFI handle.
  112. @retval EFI_SUCCESS The protocol was added to ChildHandle.
  113. @retval EFI_INVALID_PARAMETER This is NULL or ChildHandle is NULL.
  114. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
  115. the child.
  116. @retval other The child handle was not created.
  117. **/
  118. EFI_STATUS
  119. EFIAPI
  120. Udp6ServiceBindingCreateChild (
  121. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  122. IN OUT EFI_HANDLE *ChildHandle
  123. );
  124. /**
  125. Destroys a child handle with a set of I/O services.
  126. The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
  127. that was installed by CreateChild() from ChildHandle. If the removed protocol is the
  128. last protocol on ChildHandle, then ChildHandle is destroyed.
  129. @param[in] This Protocol instance pointer.
  130. @param[in] ChildHandle Handle of the child to destroy.
  131. @retval EFI_SUCCESS The I/O services were removed from the child
  132. handle.
  133. @retval EFI_UNSUPPORTED The child handle does not support the I/O services
  134. that are being removed.
  135. @retval EFI_INVALID_PARAMETER Child handle is NULL.
  136. @retval EFI_ACCESS_DENIED The child handle could not be destroyed because
  137. its I/O services are being used.
  138. @retval other The child handle was not destroyed.
  139. **/
  140. EFI_STATUS
  141. EFIAPI
  142. Udp6ServiceBindingDestroyChild (
  143. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  144. IN EFI_HANDLE ChildHandle
  145. );
  146. #endif