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