DriverBinding.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /** @file
  2. Driver Binding functions declaration for XenBus Bus driver.
  3. Copyright (C) 2014, Citrix Ltd.
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. /**
  7. Tests to see if this driver supports a given controller. If a child device is provided,
  8. it further tests to see if this driver supports creating a handle for the specified child device.
  9. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  10. @param[in] ControllerHandle The handle of the controller to test. This handle
  11. must support a protocol interface that supplies
  12. an I/O abstraction to the driver.
  13. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  14. parameter is ignored by device drivers, and is optional for bus
  15. drivers. For bus drivers, if this parameter is not NULL, then
  16. the bus driver must determine if the bus controller specified
  17. by ControllerHandle and the child controller specified
  18. by RemainingDevicePath are both supported by this
  19. bus driver.
  20. @retval EFI_SUCCESS The device specified by ControllerHandle and
  21. RemainingDevicePath is supported by the driver specified by This.
  22. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  23. RemainingDevicePath is already being managed by the driver
  24. specified by This.
  25. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  26. RemainingDevicePath is already being managed by a different
  27. driver or an application that requires exclusive access.
  28. Currently not implemented.
  29. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  30. RemainingDevicePath is not supported by the driver specified by This.
  31. **/
  32. EFI_STATUS
  33. EFIAPI
  34. XenBusDxeDriverBindingSupported (
  35. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  36. IN EFI_HANDLE ControllerHandle,
  37. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  38. );
  39. /**
  40. Starts a device controller or a bus controller.
  41. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  42. As a result, much of the error checking on the parameters to Start() has been moved into this
  43. common boot service. It is legal to call Start() from other locations,
  44. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  45. 1. ControllerHandle must be a valid EFI_HANDLE.
  46. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  47. EFI_DEVICE_PATH_PROTOCOL.
  48. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  49. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  50. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  51. @param[in] ControllerHandle The handle of the controller to start. This handle
  52. must support a protocol interface that supplies
  53. an I/O abstraction to the driver.
  54. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  55. parameter is ignored by device drivers, and is optional for bus
  56. drivers. For a bus driver, if this parameter is NULL, then handles
  57. for all the children of Controller are created by this driver.
  58. If this parameter is not NULL and the first Device Path Node is
  59. not the End of Device Path Node, then only the handle for the
  60. child device specified by the first Device Path Node of
  61. RemainingDevicePath is created by this driver.
  62. If the first Device Path Node of RemainingDevicePath is
  63. the End of Device Path Node, no child handle is created by this
  64. driver.
  65. @retval EFI_SUCCESS The device was started.
  66. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  67. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  68. @retval Others The driver failed to start the device.
  69. **/
  70. EFI_STATUS
  71. EFIAPI
  72. XenBusDxeDriverBindingStart (
  73. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  74. IN EFI_HANDLE ControllerHandle,
  75. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  76. );
  77. /**
  78. Stops a device controller or a bus controller.
  79. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  80. As a result, much of the error checking on the parameters to Stop() has been moved
  81. into this common boot service. It is legal to call Stop() from other locations,
  82. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  83. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  84. same driver's Start() function.
  85. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  86. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  87. Start() function, and the Start() function must have called OpenProtocol() on
  88. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  89. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  90. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  91. support a bus specific I/O protocol for the driver
  92. to use to stop the device.
  93. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  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. XenBusDxeDriverBindingStop (
  102. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  103. IN EFI_HANDLE ControllerHandle,
  104. IN UINTN NumberOfChildren,
  105. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  106. );