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