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