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