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