]>
Commit | Line | Data |
---|---|---|
d933e70a JW |
1 | /** @file\r |
2 | UEFI HTTP boot driver's private data structure and interfaces declaration.\r | |
3 | \r | |
f75a7f56 | 4 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r |
97e2b622 | 5 | (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>\r |
ecf98fbc | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d933e70a JW |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __EFI_HTTP_BOOT_DXE_H__\r | |
11 | #define __EFI_HTTP_BOOT_DXE_H__\r | |
12 | \r | |
13 | #include <Uefi.h>\r | |
14 | \r | |
90f658c4 | 15 | #include <IndustryStandard/Http11.h>\r |
142c00c3 | 16 | #include <IndustryStandard/Dhcp.h>\r |
90f658c4 | 17 | \r |
d933e70a JW |
18 | //\r |
19 | // Libraries\r | |
20 | //\r | |
21 | #include <Library/UefiBootServicesTableLib.h>\r | |
fa848a40 FS |
22 | #include <Library/UefiHiiServicesLib.h>\r |
23 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
d933e70a JW |
24 | #include <Library/MemoryAllocationLib.h>\r |
25 | #include <Library/BaseLib.h>\r | |
26 | #include <Library/UefiLib.h>\r | |
27 | #include <Library/DevicePathLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/NetLib.h>\r | |
30 | #include <Library/HttpLib.h>\r | |
97e2b622 | 31 | #include <Library/HttpIoLib.h>\r |
fa848a40 FS |
32 | #include <Library/HiiLib.h>\r |
33 | #include <Library/PrintLib.h>\r | |
5e9e151c | 34 | #include <Library/DpcLib.h>\r |
d933e70a JW |
35 | \r |
36 | //\r | |
37 | // UEFI Driver Model Protocols\r | |
38 | //\r | |
39 | #include <Protocol/DriverBinding.h>\r | |
40 | #include <Protocol/ComponentName2.h>\r | |
41 | #include <Protocol/ComponentName.h>\r | |
42 | \r | |
43 | //\r | |
44 | // Consumed Protocols\r | |
45 | //\r | |
fa848a40 FS |
46 | #include <Protocol/ServiceBinding.h>\r |
47 | #include <Protocol/HiiConfigAccess.h>\r | |
d933e70a JW |
48 | #include <Protocol/NetworkInterfaceIdentifier.h>\r |
49 | #include <Protocol/Dhcp4.h>\r | |
b659408b ZL |
50 | #include <Protocol/Dhcp6.h>\r |
51 | #include <Protocol/Dns6.h>\r | |
d933e70a JW |
52 | #include <Protocol/Http.h>\r |
53 | #include <Protocol/Ip4Config2.h>\r | |
b659408b | 54 | #include <Protocol/Ip6Config.h>\r |
587d204c | 55 | #include <Protocol/RamDisk.h>\r |
ed247d86 JW |
56 | #include <Protocol/AdapterInformation.h>\r |
57 | \r | |
d933e70a JW |
58 | //\r |
59 | // Produced Protocols\r | |
60 | //\r | |
61 | #include <Protocol/LoadFile.h>\r | |
95b5c32f | 62 | #include <Protocol/HttpBootCallback.h>\r |
d933e70a | 63 | \r |
fa848a40 FS |
64 | //\r |
65 | // Consumed Guids\r | |
66 | //\r | |
67 | #include <Guid/HttpBootConfigHii.h>\r | |
68 | \r | |
d933e70a JW |
69 | //\r |
70 | // Driver Version\r | |
71 | //\r | |
72 | #define HTTP_BOOT_DXE_VERSION 0xa\r | |
73 | \r | |
587d204c | 74 | //\r |
f75a7f56 | 75 | // Standard Media Types defined in\r |
b173ad78 | 76 | // http://www.iana.org/assignments/media-types\r |
587d204c FS |
77 | //\r |
78 | #define HTTP_CONTENT_TYPE_APP_EFI "application/efi"\r | |
b173ad78 JW |
79 | #define HTTP_CONTENT_TYPE_APP_IMG "application/vnd.efi-img"\r |
80 | #define HTTP_CONTENT_TYPE_APP_ISO "application/vnd.efi-iso"\r | |
587d204c | 81 | \r |
d933e70a JW |
82 | //\r |
83 | // Protocol instances\r | |
84 | //\r | |
85 | extern EFI_DRIVER_BINDING_PROTOCOL gHttpBootDxeDriverBinding;\r | |
86 | extern EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2;\r | |
87 | extern EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName;\r | |
88 | \r | |
89 | //\r | |
90 | // Private data structure\r | |
91 | //\r | |
92 | typedef struct _HTTP_BOOT_PRIVATE_DATA HTTP_BOOT_PRIVATE_DATA;\r | |
b659408b | 93 | typedef struct _HTTP_BOOT_VIRTUAL_NIC HTTP_BOOT_VIRTUAL_NIC;\r |
d933e70a | 94 | \r |
587d204c FS |
95 | typedef enum {\r |
96 | ImageTypeEfi,\r | |
97 | ImageTypeVirtualCd,\r | |
98 | ImageTypeVirtualDisk,\r | |
99 | ImageTypeMax\r | |
100 | } HTTP_BOOT_IMAGE_TYPE;\r | |
101 | \r | |
d933e70a JW |
102 | //\r |
103 | // Include files with internal function prototypes\r | |
104 | //\r | |
105 | #include "HttpBootComponentName.h"\r | |
106 | #include "HttpBootDhcp4.h"\r | |
b659408b | 107 | #include "HttpBootDhcp6.h"\r |
d933e70a JW |
108 | #include "HttpBootImpl.h"\r |
109 | #include "HttpBootSupport.h"\r | |
110 | #include "HttpBootClient.h"\r | |
fa848a40 | 111 | #include "HttpBootConfig.h"\r |
d933e70a JW |
112 | \r |
113 | typedef union {\r | |
114 | HTTP_BOOT_DHCP4_PACKET_CACHE Dhcp4;\r | |
b659408b | 115 | HTTP_BOOT_DHCP6_PACKET_CACHE Dhcp6;\r |
d933e70a JW |
116 | } HTTP_BOOT_DHCP_PACKET_CACHE;\r |
117 | \r | |
b659408b ZL |
118 | struct _HTTP_BOOT_VIRTUAL_NIC {\r |
119 | UINT32 Signature;\r | |
120 | EFI_HANDLE Controller;\r | |
75372581 | 121 | EFI_HANDLE ImageHandle;\r |
b659408b ZL |
122 | EFI_LOAD_FILE_PROTOCOL LoadFile;\r |
123 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
124 | HTTP_BOOT_PRIVATE_DATA *Private;\r | |
125 | };\r | |
126 | \r | |
fa848a40 FS |
127 | #define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO(Callback) \\r |
128 | CR ( \\r | |
129 | Callback, \\r | |
130 | HTTP_BOOT_PRIVATE_DATA, \\r | |
131 | CallbackInfo, \\r | |
132 | HTTP_BOOT_PRIVATE_DATA_SIGNATURE \\r | |
133 | )\r | |
f75a7f56 | 134 | \r |
95b5c32f FS |
135 | #define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_PROTOCOL(CallbackProtocol) \\r |
136 | CR ( \\r | |
137 | CallbackProtocol, \\r | |
138 | HTTP_BOOT_PRIVATE_DATA, \\r | |
139 | LoadFileCallback, \\r | |
140 | HTTP_BOOT_PRIVATE_DATA_SIGNATURE \\r | |
141 | )\r | |
fa848a40 | 142 | \r |
d933e70a JW |
143 | struct _HTTP_BOOT_PRIVATE_DATA {\r |
144 | UINT32 Signature;\r | |
145 | EFI_HANDLE Controller;\r | |
d933e70a | 146 | \r |
b659408b ZL |
147 | HTTP_BOOT_VIRTUAL_NIC *Ip4Nic;\r |
148 | HTTP_BOOT_VIRTUAL_NIC *Ip6Nic;\r | |
149 | \r | |
d933e70a | 150 | //\r |
c36b7b51 | 151 | // Consumed children\r |
d933e70a | 152 | //\r |
b659408b | 153 | EFI_HANDLE Ip6Child;\r |
d933e70a | 154 | EFI_HANDLE Dhcp4Child;\r |
b659408b | 155 | EFI_HANDLE Dhcp6Child;\r |
d933e70a JW |
156 | HTTP_IO HttpIo;\r |
157 | BOOLEAN HttpCreated;\r | |
158 | \r | |
159 | //\r | |
160 | // Consumed protocol\r | |
161 | //\r | |
162 | EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;\r | |
b659408b | 163 | EFI_IP6_PROTOCOL *Ip6;\r |
d933e70a | 164 | EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;\r |
b659408b | 165 | EFI_IP6_CONFIG_PROTOCOL *Ip6Config;\r |
d933e70a | 166 | EFI_DHCP4_PROTOCOL *Dhcp4;\r |
b659408b | 167 | EFI_DHCP6_PROTOCOL *Dhcp6;\r |
d933e70a JW |
168 | EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r |
169 | \r | |
f75a7f56 | 170 | \r |
d933e70a JW |
171 | //\r |
172 | // Produced protocol\r | |
173 | //\r | |
174 | EFI_LOAD_FILE_PROTOCOL LoadFile;\r | |
175 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
176 | UINT32 Id;\r | |
95b5c32f FS |
177 | EFI_HTTP_BOOT_CALLBACK_PROTOCOL *HttpBootCallback;\r |
178 | EFI_HTTP_BOOT_CALLBACK_PROTOCOL LoadFileCallback;\r | |
bb4831c0 FS |
179 | \r |
180 | //\r | |
181 | // Data for the default HTTP Boot callback protocol\r | |
182 | //\r | |
95b5c32f FS |
183 | UINT64 FileSize;\r |
184 | UINT64 ReceivedSize;\r | |
185 | UINT32 Percentage;\r | |
d933e70a | 186 | \r |
fa848a40 FS |
187 | //\r |
188 | // HII callback info block\r | |
189 | //\r | |
190 | HTTP_BOOT_FORM_CALLBACK_INFO CallbackInfo;\r | |
191 | \r | |
d933e70a JW |
192 | //\r |
193 | // Mode data\r | |
194 | //\r | |
195 | BOOLEAN UsingIpv6;\r | |
196 | BOOLEAN Started;\r | |
197 | EFI_IP_ADDRESS StationIp;\r | |
198 | EFI_IP_ADDRESS SubnetMask;\r | |
199 | EFI_IP_ADDRESS GatewayIp;\r | |
b659408b | 200 | EFI_IP_ADDRESS ServerIp;\r |
d933e70a | 201 | UINT16 Port;\r |
7b1dbd15 JW |
202 | UINT32 DnsServerCount;\r |
203 | EFI_IP_ADDRESS *DnsServerIp;\r | |
587d204c FS |
204 | \r |
205 | //\r | |
206 | // The URI string attempt to download through HTTP, may point to\r | |
207 | // the memory in cached DHCP offer, or to the memory in FilePathUri.\r | |
208 | //\r | |
d933e70a JW |
209 | CHAR8 *BootFileUri;\r |
210 | VOID *BootFileUriParser;\r | |
211 | UINTN BootFileSize;\r | |
b659408b | 212 | BOOLEAN NoGateway;\r |
44a7d08b | 213 | HTTP_BOOT_IMAGE_TYPE ImageType;\r |
d933e70a | 214 | \r |
fa848a40 FS |
215 | //\r |
216 | // URI string extracted from the input FilePath parameter.\r | |
217 | //\r | |
218 | CHAR8 *FilePathUri;\r | |
219 | VOID *FilePathUriParser;\r | |
220 | \r | |
d933e70a JW |
221 | //\r |
222 | // Cached HTTP data\r | |
223 | //\r | |
224 | LIST_ENTRY CacheList;\r | |
225 | \r | |
226 | //\r | |
227 | // Cached DHCP offer\r | |
228 | //\r | |
229 | // OfferIndex records the index of DhcpOffer[] buffer, and OfferCount records the num of each type of offer.\r | |
230 | //\r | |
231 | // It supposed that\r | |
232 | //\r | |
233 | // OfferNum: 8\r | |
234 | // OfferBuffer: [ProxyNameUri, DhcpNameUri, DhcpIpUri, ProxyNameUri, ProxyIpUri, DhcpOnly, DhcpIpUri, DhcpNameUriDns]\r | |
235 | // (OfferBuffer is 0-based.)\r | |
236 | //\r | |
237 | // And assume that (DhcpIpUri is the first priority actually.)\r | |
238 | //\r | |
239 | // SelectIndex: 5\r | |
240 | // SelectProxyType: HttpOfferTypeProxyIpUri\r | |
241 | // (SelectIndex is 1-based, and 0 means no one is selected.)\r | |
242 | //\r | |
243 | // So it should be\r | |
244 | //\r | |
245 | // DhcpIpUri DhcpNameUriDns DhcpDns DhcpOnly ProxyNameUri ProxyIpUri DhcpNameUri\r | |
246 | // OfferCount: [ 2, 1, 0, 1, 2, 1, 1]\r | |
247 | //\r | |
248 | // OfferIndex: {[ 2, 7, 0, 5, 0, *4, 1]\r | |
249 | // [ 6, 0, 0, 0, 3, 0, 0]\r | |
250 | // [ 0, 0, 0, 0, 0, 0, 0]\r | |
251 | // ... ]}\r | |
252 | // (OfferIndex is 0-based.)\r | |
253 | //\r | |
254 | //\r | |
255 | UINT32 SelectIndex;\r | |
256 | UINT32 SelectProxyType;\r | |
257 | HTTP_BOOT_DHCP_PACKET_CACHE OfferBuffer[HTTP_BOOT_OFFER_MAX_NUM];\r | |
258 | UINT32 OfferNum;\r | |
259 | UINT32 OfferCount[HttpOfferTypeMax];\r | |
260 | UINT32 OfferIndex[HttpOfferTypeMax][HTTP_BOOT_OFFER_MAX_NUM];\r | |
261 | };\r | |
262 | \r | |
263 | #define HTTP_BOOT_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'B', 'P', 'D')\r | |
b659408b | 264 | #define HTTP_BOOT_VIRTUAL_NIC_SIGNATURE SIGNATURE_32 ('H', 'B', 'V', 'N')\r |
d933e70a JW |
265 | #define HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE(a) CR (a, HTTP_BOOT_PRIVATE_DATA, LoadFile, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)\r |
266 | #define HTTP_BOOT_PRIVATE_DATA_FROM_ID(a) CR (a, HTTP_BOOT_PRIVATE_DATA, Id, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)\r | |
b659408b | 267 | #define HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, HTTP_BOOT_VIRTUAL_NIC, LoadFile, HTTP_BOOT_VIRTUAL_NIC_SIGNATURE)\r |
d933e70a JW |
268 | extern EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile;\r |
269 | \r | |
270 | /**\r | |
f75a7f56 | 271 | Tests to see if this driver supports a given controller. If a child device is provided,\r |
d933e70a JW |
272 | it further tests to see if this driver supports creating a handle for the specified child device.\r |
273 | \r | |
f75a7f56 LG |
274 | This function checks to see if the driver specified by This supports the device specified by\r |
275 | ControllerHandle. Drivers will typically use the device path attached to\r | |
276 | ControllerHandle and/or the services from the bus I/O abstraction attached to\r | |
277 | ControllerHandle to determine if the driver supports ControllerHandle. This function\r | |
278 | may be called many times during platform initialization. In order to reduce boot times, the tests\r | |
279 | performed by this function must be very small, and take as little time as possible to execute. This\r | |
280 | function must not change the state of any hardware devices, and this function must be aware that the\r | |
281 | device specified by ControllerHandle may already be managed by the same driver or a\r | |
282 | different driver. This function must match its calls to AllocatePages() with FreePages(),\r | |
283 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r | |
284 | Because ControllerHandle may have been previously started by the same driver, if a protocol is\r | |
285 | already in the opened state, then it must not be closed with CloseProtocol(). This is required\r | |
d933e70a JW |
286 | to guarantee the state of ControllerHandle is not modified by this function.\r |
287 | \r | |
288 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
f75a7f56 LG |
289 | @param[in] ControllerHandle The handle of the controller to test. This handle\r |
290 | must support a protocol interface that supplies\r | |
d933e70a | 291 | an I/O abstraction to the driver.\r |
f75a7f56 LG |
292 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r |
293 | parameter is ignored by device drivers, and is optional for bus\r | |
294 | drivers. For bus drivers, if this parameter is not NULL, then\r | |
295 | the bus driver must determine if the bus controller specified\r | |
296 | by ControllerHandle and the child controller specified\r | |
297 | by RemainingDevicePath are both supported by this\r | |
d933e70a JW |
298 | bus driver.\r |
299 | \r | |
300 | @retval EFI_SUCCESS The device specified by ControllerHandle and\r | |
301 | RemainingDevicePath is supported by the driver specified by This.\r | |
302 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r | |
303 | RemainingDevicePath is already being managed by the driver\r | |
304 | specified by This.\r | |
305 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r | |
306 | RemainingDevicePath is already being managed by a different\r | |
307 | driver or an application that requires exclusive access.\r | |
308 | Currently not implemented.\r | |
309 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r | |
310 | RemainingDevicePath is not supported by the driver specified by This.\r | |
311 | **/\r | |
312 | EFI_STATUS\r | |
313 | EFIAPI\r | |
314 | HttpBootIp4DxeDriverBindingSupported (\r | |
315 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
316 | IN EFI_HANDLE ControllerHandle,\r | |
317 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
318 | );\r | |
319 | \r | |
320 | /**\r | |
321 | Starts a device controller or a bus controller.\r | |
322 | \r | |
323 | The Start() function is designed to be invoked from the EFI boot service ConnectController().\r | |
f75a7f56 LG |
324 | As a result, much of the error checking on the parameters to Start() has been moved into this\r |
325 | common boot service. It is legal to call Start() from other locations,\r | |
d933e70a JW |
326 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r |
327 | 1. ControllerHandle must be a valid EFI_HANDLE.\r | |
328 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r | |
329 | EFI_DEVICE_PATH_PROTOCOL.\r | |
330 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r | |
f75a7f56 | 331 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r |
d933e70a JW |
332 | \r |
333 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
f75a7f56 LG |
334 | @param[in] ControllerHandle The handle of the controller to start. This handle\r |
335 | must support a protocol interface that supplies\r | |
d933e70a | 336 | an I/O abstraction to the driver.\r |
f75a7f56 LG |
337 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r |
338 | parameter is ignored by device drivers, and is optional for bus\r | |
339 | drivers. For a bus driver, if this parameter is NULL, then handles\r | |
340 | for all the children of Controller are created by this driver.\r | |
341 | If this parameter is not NULL and the first Device Path Node is\r | |
342 | not the End of Device Path Node, then only the handle for the\r | |
343 | child device specified by the first Device Path Node of\r | |
d933e70a | 344 | RemainingDevicePath is created by this driver.\r |
f75a7f56 | 345 | If the first Device Path Node of RemainingDevicePath is\r |
d933e70a JW |
346 | the End of Device Path Node, no child handle is created by this\r |
347 | driver.\r | |
348 | \r | |
349 | @retval EFI_SUCCESS The device was started.\r | |
350 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
351 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
c36b7b51 | 352 | @retval Others The driver failed to start the device.\r |
d933e70a JW |
353 | \r |
354 | **/\r | |
355 | EFI_STATUS\r | |
356 | EFIAPI\r | |
357 | HttpBootIp4DxeDriverBindingStart (\r | |
358 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
359 | IN EFI_HANDLE ControllerHandle,\r | |
360 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
361 | );\r | |
362 | \r | |
363 | /**\r | |
364 | Stops a device controller or a bus controller.\r | |
f75a7f56 LG |
365 | \r |
366 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r | |
367 | As a result, much of the error checking on the parameters to Stop() has been moved\r | |
368 | into this common boot service. It is legal to call Stop() from other locations,\r | |
d933e70a JW |
369 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r |
370 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r | |
371 | same driver's Start() function.\r | |
372 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r | |
373 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r | |
374 | Start() function, and the Start() function must have called OpenProtocol() on\r | |
375 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
f75a7f56 | 376 | \r |
d933e70a | 377 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r |
f75a7f56 LG |
378 | @param[in] ControllerHandle A handle to the device being stopped. The handle must\r |
379 | support a bus specific I/O protocol for the driver\r | |
d933e70a JW |
380 | to use to stop the device.\r |
381 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r | |
f75a7f56 | 382 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r |
d933e70a JW |
383 | if NumberOfChildren is 0.\r |
384 | \r | |
385 | @retval EFI_SUCCESS The device was stopped.\r | |
386 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
387 | \r | |
388 | **/\r | |
389 | EFI_STATUS\r | |
390 | EFIAPI\r | |
391 | HttpBootIp4DxeDriverBindingStop (\r | |
392 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
393 | IN EFI_HANDLE ControllerHandle,\r | |
394 | IN UINTN NumberOfChildren,\r | |
395 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r | |
396 | );\r | |
397 | \r | |
b659408b | 398 | /**\r |
f75a7f56 | 399 | Tests to see if this driver supports a given controller. If a child device is provided,\r |
b659408b ZL |
400 | it further tests to see if this driver supports creating a handle for the specified child device.\r |
401 | \r | |
f75a7f56 LG |
402 | This function checks to see if the driver specified by This supports the device specified by\r |
403 | ControllerHandle. Drivers will typically use the device path attached to\r | |
404 | ControllerHandle and/or the services from the bus I/O abstraction attached to\r | |
405 | ControllerHandle to determine if the driver supports ControllerHandle. This function\r | |
406 | may be called many times during platform initialization. In order to reduce boot times, the tests\r | |
407 | performed by this function must be very small, and take as little time as possible to execute. This\r | |
408 | function must not change the state of any hardware devices, and this function must be aware that the\r | |
409 | device specified by ControllerHandle may already be managed by the same driver or a\r | |
410 | different driver. This function must match its calls to AllocatePages() with FreePages(),\r | |
411 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r | |
412 | Because ControllerHandle may have been previously started by the same driver, if a protocol is\r | |
413 | already in the opened state, then it must not be closed with CloseProtocol(). This is required\r | |
b659408b ZL |
414 | to guarantee the state of ControllerHandle is not modified by this function.\r |
415 | \r | |
416 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
f75a7f56 LG |
417 | @param[in] ControllerHandle The handle of the controller to test. This handle\r |
418 | must support a protocol interface that supplies\r | |
b659408b | 419 | an I/O abstraction to the driver.\r |
f75a7f56 LG |
420 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r |
421 | parameter is ignored by device drivers, and is optional for bus\r | |
422 | drivers. For bus drivers, if this parameter is not NULL, then\r | |
423 | the bus driver must determine if the bus controller specified\r | |
424 | by ControllerHandle and the child controller specified\r | |
425 | by RemainingDevicePath are both supported by this\r | |
b659408b ZL |
426 | bus driver.\r |
427 | \r | |
428 | @retval EFI_SUCCESS The device specified by ControllerHandle and\r | |
429 | RemainingDevicePath is supported by the driver specified by This.\r | |
430 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r | |
431 | RemainingDevicePath is already being managed by the driver\r | |
432 | specified by This.\r | |
433 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r | |
434 | RemainingDevicePath is already being managed by a different\r | |
435 | driver or an application that requires exclusive access.\r | |
436 | Currently not implemented.\r | |
437 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r | |
438 | RemainingDevicePath is not supported by the driver specified by This.\r | |
439 | **/\r | |
440 | EFI_STATUS\r | |
441 | EFIAPI\r | |
442 | HttpBootIp6DxeDriverBindingSupported (\r | |
443 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
444 | IN EFI_HANDLE ControllerHandle,\r | |
445 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
446 | );\r | |
447 | \r | |
448 | /**\r | |
449 | Starts a device controller or a bus controller.\r | |
450 | \r | |
451 | The Start() function is designed to be invoked from the EFI boot service ConnectController().\r | |
f75a7f56 LG |
452 | As a result, much of the error checking on the parameters to Start() has been moved into this\r |
453 | common boot service. It is legal to call Start() from other locations,\r | |
b659408b ZL |
454 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r |
455 | 1. ControllerHandle must be a valid EFI_HANDLE.\r | |
456 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r | |
457 | EFI_DEVICE_PATH_PROTOCOL.\r | |
458 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r | |
f75a7f56 | 459 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r |
b659408b ZL |
460 | \r |
461 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
f75a7f56 LG |
462 | @param[in] ControllerHandle The handle of the controller to start. This handle\r |
463 | must support a protocol interface that supplies\r | |
b659408b | 464 | an I/O abstraction to the driver.\r |
f75a7f56 LG |
465 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r |
466 | parameter is ignored by device drivers, and is optional for bus\r | |
467 | drivers. For a bus driver, if this parameter is NULL, then handles\r | |
468 | for all the children of Controller are created by this driver.\r | |
469 | If this parameter is not NULL and the first Device Path Node is\r | |
470 | not the End of Device Path Node, then only the handle for the\r | |
471 | child device specified by the first Device Path Node of\r | |
b659408b | 472 | RemainingDevicePath is created by this driver.\r |
f75a7f56 | 473 | If the first Device Path Node of RemainingDevicePath is\r |
b659408b ZL |
474 | the End of Device Path Node, no child handle is created by this\r |
475 | driver.\r | |
476 | \r | |
477 | @retval EFI_SUCCESS The device was started.\r | |
478 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
479 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
c36b7b51 | 480 | @retval Others The driver failed to start the device.\r |
b659408b ZL |
481 | \r |
482 | **/\r | |
483 | EFI_STATUS\r | |
484 | EFIAPI\r | |
485 | HttpBootIp6DxeDriverBindingStart (\r | |
486 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
487 | IN EFI_HANDLE ControllerHandle,\r | |
488 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
489 | );\r | |
490 | \r | |
491 | /**\r | |
492 | Stops a device controller or a bus controller.\r | |
f75a7f56 LG |
493 | \r |
494 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r | |
495 | As a result, much of the error checking on the parameters to Stop() has been moved\r | |
496 | into this common boot service. It is legal to call Stop() from other locations,\r | |
b659408b ZL |
497 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r |
498 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r | |
499 | same driver's Start() function.\r | |
500 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r | |
501 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r | |
502 | Start() function, and the Start() function must have called OpenProtocol() on\r | |
503 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
f75a7f56 | 504 | \r |
b659408b | 505 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r |
f75a7f56 LG |
506 | @param[in] ControllerHandle A handle to the device being stopped. The handle must\r |
507 | support a bus specific I/O protocol for the driver\r | |
b659408b ZL |
508 | to use to stop the device.\r |
509 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r | |
f75a7f56 | 510 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r |
b659408b ZL |
511 | if NumberOfChildren is 0.\r |
512 | \r | |
513 | @retval EFI_SUCCESS The device was stopped.\r | |
514 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
515 | \r | |
516 | **/\r | |
517 | EFI_STATUS\r | |
518 | EFIAPI\r | |
519 | HttpBootIp6DxeDriverBindingStop (\r | |
520 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
521 | IN EFI_HANDLE ControllerHandle,\r | |
522 | IN UINTN NumberOfChildren,\r | |
523 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r | |
524 | );\r | |
d933e70a | 525 | #endif\r |