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