WifiConnectionMgrDriverBinding.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /** @file
  2. The driver binding protocol for the WiFi Connection Manager.
  3. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_WIFI_DRIVER_BINDING__
  7. #define __EFI_WIFI_DRIVER_BINDING__
  8. /**
  9. Tests to see if this driver supports a given controller. If a child device is provided,
  10. it further tests to see if this driver supports creating a handle for the specified child device.
  11. This function checks to see if the driver specified by This supports the device specified by
  12. ControllerHandle. Drivers will typically use the device path attached to
  13. ControllerHandle and/or the services from the bus I/O abstraction attached to
  14. ControllerHandle to determine if the driver supports ControllerHandle. This function
  15. may be called many times during platform initialization. In order to reduce boot times, the tests
  16. performed by this function must be very small, and take as little time as possible to execute. This
  17. function must not change the state of any hardware devices, and this function must be aware that the
  18. device specified by ControllerHandle may already be managed by the same driver or a
  19. different driver. This function must match its calls to AllocatePages() with FreePages(),
  20. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  21. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  22. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  23. to guarantee the state of ControllerHandle is not modified by this function.
  24. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  25. @param[in] ControllerHandle The handle of the controller to test. This handle
  26. must support a protocol interface that supplies
  27. an I/O abstraction to the driver.
  28. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  29. parameter is ignored by device drivers, and is optional for bus
  30. drivers. For bus drivers, if this parameter is not NULL, then
  31. the bus driver must determine if the bus controller specified
  32. by ControllerHandle and the child controller specified
  33. by RemainingDevicePath are both supported by this
  34. bus driver.
  35. @retval EFI_SUCCESS The device specified by ControllerHandle and
  36. RemainingDevicePath is supported by the driver specified by This.
  37. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  38. RemainingDevicePath is already being managed by the driver
  39. specified by This.
  40. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  41. RemainingDevicePath is already being managed by a different
  42. driver or an application that requires exclusive access.
  43. Currently not implemented.
  44. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  45. RemainingDevicePath is not supported by the driver specified by This.
  46. **/
  47. EFI_STATUS
  48. EFIAPI
  49. WifiMgrDxeDriverBindingSupported (
  50. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  51. IN EFI_HANDLE ControllerHandle,
  52. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  53. );
  54. /**
  55. Starts a device controller or a bus controller.
  56. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  57. As a result, much of the error checking on the parameters to Start() has been moved into this
  58. common boot service. It is legal to call Start() from other locations,
  59. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  60. 1. ControllerHandle must be a valid EFI_HANDLE.
  61. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  62. EFI_DEVICE_PATH_PROTOCOL.
  63. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  64. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  65. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  66. @param[in] ControllerHandle The handle of the controller to start. This handle
  67. must support a protocol interface that supplies
  68. an I/O abstraction to the driver.
  69. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  70. parameter is ignored by device drivers, and is optional for bus
  71. drivers. For a bus driver, if this parameter is NULL, then handles
  72. for all the children of Controller are created by this driver.
  73. If this parameter is not NULL and the first Device Path Node is
  74. not the End of Device Path Node, then only the handle for the
  75. child device specified by the first Device Path Node of
  76. RemainingDevicePath is created by this driver.
  77. If the first Device Path Node of RemainingDevicePath is
  78. the End of Device Path Node, no child handle is created by this
  79. driver.
  80. @retval EFI_SUCCESS The device was started.
  81. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  82. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  83. @retval Others The driver failded to start the device.
  84. **/
  85. EFI_STATUS
  86. EFIAPI
  87. WifiMgrDxeDriverBindingStart (
  88. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  89. IN EFI_HANDLE ControllerHandle,
  90. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  91. );
  92. /**
  93. Stops a device controller or a bus controller.
  94. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  95. As a result, much of the error checking on the parameters to Stop() has been moved
  96. into this common boot service. It is legal to call Stop() from other locations,
  97. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  98. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  99. same driver's Start() function.
  100. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  101. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  102. Start() function, and the Start() function must have called OpenProtocol() on
  103. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  104. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  105. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  106. support a bus specific I/O protocol for the driver
  107. to use to stop the device.
  108. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  109. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  110. if NumberOfChildren is 0.
  111. @retval EFI_SUCCESS The device was stopped.
  112. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  113. **/
  114. EFI_STATUS
  115. EFIAPI
  116. WifiMgrDxeDriverBindingStop (
  117. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  118. IN EFI_HANDLE ControllerHandle,
  119. IN UINTN NumberOfChildren,
  120. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  121. );
  122. #endif