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