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