1 | /** @file
|
---|
2 | The header files of the driver binding and service binding protocol for DnsDxe driver.
|
---|
3 |
|
---|
4 | Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
---|
5 | This program and the accompanying materials
|
---|
6 | are licensed and made available under the terms and conditions of the BSD License
|
---|
7 | which accompanies this distribution. The full text of the license may be found at
|
---|
8 | http://opensource.org/licenses/bsd-license.php
|
---|
9 |
|
---|
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
---|
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
---|
12 |
|
---|
13 | **/
|
---|
14 |
|
---|
15 | #ifndef _DNS_DRIVER_H_
|
---|
16 | #define _DNS_DRIVER_H_
|
---|
17 |
|
---|
18 | #include <Protocol/DriverBinding.h>
|
---|
19 | #include <Protocol/ServiceBinding.h>
|
---|
20 |
|
---|
21 | ///
|
---|
22 | /// Dns service block
|
---|
23 | ///
|
---|
24 | typedef struct _DNS_DRIVER_DATA DNS_DRIVER_DATA;
|
---|
25 |
|
---|
26 | ///
|
---|
27 | /// Dns service block
|
---|
28 | ///
|
---|
29 | typedef struct _DNS_SERVICE DNS_SERVICE;
|
---|
30 |
|
---|
31 | ///
|
---|
32 | /// Dns instance block
|
---|
33 | ///
|
---|
34 | typedef struct _DNS_INSTANCE DNS_INSTANCE;
|
---|
35 |
|
---|
36 | #define DNS_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'S')
|
---|
37 |
|
---|
38 | #define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
|
---|
39 |
|
---|
40 | struct _DNS_DRIVER_DATA {
|
---|
41 | EFI_EVENT Timer; /// Ticking timer for DNS cache update.
|
---|
42 |
|
---|
43 | LIST_ENTRY Dns4CacheList;
|
---|
44 | LIST_ENTRY Dns4ServerList;
|
---|
45 |
|
---|
46 | LIST_ENTRY Dns6CacheList;
|
---|
47 | LIST_ENTRY Dns6ServerList;
|
---|
48 | };
|
---|
49 |
|
---|
50 | struct _DNS_SERVICE {
|
---|
51 | UINT32 Signature;
|
---|
52 | EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
---|
53 |
|
---|
54 | UINT16 Dns4ChildrenNum;
|
---|
55 | LIST_ENTRY Dns4ChildrenList;
|
---|
56 |
|
---|
57 | UINT16 Dns6ChildrenNum;
|
---|
58 | LIST_ENTRY Dns6ChildrenList;
|
---|
59 |
|
---|
60 | EFI_HANDLE ControllerHandle;
|
---|
61 | EFI_HANDLE ImageHandle;
|
---|
62 |
|
---|
63 | EFI_EVENT TimerToGetMap;
|
---|
64 |
|
---|
65 | EFI_EVENT Timer; /// Ticking timer for packet retransmission.
|
---|
66 |
|
---|
67 | UINT8 IpVersion;
|
---|
68 | UDP_IO *ConnectUdp;
|
---|
69 | };
|
---|
70 |
|
---|
71 | struct _DNS_INSTANCE {
|
---|
72 | UINT32 Signature;
|
---|
73 | LIST_ENTRY Link;
|
---|
74 |
|
---|
75 | EFI_DNS4_PROTOCOL Dns4;
|
---|
76 | EFI_DNS6_PROTOCOL Dns6;
|
---|
77 |
|
---|
78 | INTN State;
|
---|
79 | BOOLEAN InDestroy;
|
---|
80 |
|
---|
81 | DNS_SERVICE *Service;
|
---|
82 | EFI_HANDLE ChildHandle;
|
---|
83 |
|
---|
84 | EFI_DNS4_CONFIG_DATA Dns4CfgData;
|
---|
85 | EFI_DNS6_CONFIG_DATA Dns6CfgData;
|
---|
86 |
|
---|
87 | EFI_IP_ADDRESS SessionDnsServer;
|
---|
88 |
|
---|
89 | NET_MAP Dns4TxTokens;
|
---|
90 | NET_MAP Dns6TxTokens;
|
---|
91 |
|
---|
92 | UDP_IO *UdpIo;
|
---|
93 | };
|
---|
94 |
|
---|
95 | typedef struct {
|
---|
96 | EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
|
---|
97 | UINTN NumberOfChildren;
|
---|
98 | EFI_HANDLE *ChildHandleBuffer;
|
---|
99 | } DNS_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
|
---|
100 |
|
---|
101 | extern DNS_DRIVER_DATA *mDriverData;
|
---|
102 |
|
---|
103 | #define DNS_SERVICE_FROM_THIS(a) \
|
---|
104 | CR (a, DNS_SERVICE, ServiceBinding, DNS_SERVICE_SIGNATURE)
|
---|
105 |
|
---|
106 | #define DNS_INSTANCE_FROM_THIS_PROTOCOL4(a) \
|
---|
107 | CR (a, DNS_INSTANCE, Dns4, DNS_INSTANCE_SIGNATURE)
|
---|
108 |
|
---|
109 | #define DNS_INSTANCE_FROM_THIS_PROTOCOL6(a) \
|
---|
110 | CR (a, DNS_INSTANCE, Dns6, DNS_INSTANCE_SIGNATURE)
|
---|
111 |
|
---|
112 |
|
---|
113 | /**
|
---|
114 | Destroy the DNS instance and recycle the resources.
|
---|
115 |
|
---|
116 | @param[in] Instance The pointer to the DNS instance.
|
---|
117 |
|
---|
118 | **/
|
---|
119 | VOID
|
---|
120 | DnsDestroyInstance (
|
---|
121 | IN DNS_INSTANCE *Instance
|
---|
122 | );
|
---|
123 |
|
---|
124 | /**
|
---|
125 | Create the DNS instance and initialize it.
|
---|
126 |
|
---|
127 | @param[in] Service The pointer to the DNS service.
|
---|
128 | @param[out] Instance The pointer to the DNS instance.
|
---|
129 |
|
---|
130 | @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
|
---|
131 | @retval EFI_SUCCESS The DNS instance is created.
|
---|
132 |
|
---|
133 | **/
|
---|
134 | EFI_STATUS
|
---|
135 | DnsCreateInstance (
|
---|
136 | IN DNS_SERVICE *Service,
|
---|
137 | OUT DNS_INSTANCE **Instance
|
---|
138 | );
|
---|
139 |
|
---|
140 | /**
|
---|
141 | Callback function which provided by user to remove one node in NetDestroyLinkList process.
|
---|
142 |
|
---|
143 | @param[in] Entry The entry to be removed.
|
---|
144 | @param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
|
---|
145 |
|
---|
146 | @retval EFI_SUCCESS The entry has been removed successfully.
|
---|
147 | @retval Others Fail to remove the entry.
|
---|
148 |
|
---|
149 | **/
|
---|
150 | EFI_STATUS
|
---|
151 | EFIAPI
|
---|
152 | DnsDestroyChildEntryInHandleBuffer (
|
---|
153 | IN LIST_ENTRY *Entry,
|
---|
154 | IN VOID *Context
|
---|
155 | );
|
---|
156 |
|
---|
157 | /**
|
---|
158 | Config a NULL UDP that is used to keep the connection between UDP and DNS.
|
---|
159 |
|
---|
160 | Just leave the Udp child unconfigured. When UDP is unloaded,
|
---|
161 | DNS will be informed with DriverBinding Stop.
|
---|
162 |
|
---|
163 | @param UdpIo The UDP_IO to configure
|
---|
164 | @param Context The opaque parameter to the callback
|
---|
165 |
|
---|
166 | @retval EFI_SUCCESS It always return EFI_SUCCESS directly.
|
---|
167 |
|
---|
168 | **/
|
---|
169 | EFI_STATUS
|
---|
170 | EFIAPI
|
---|
171 | DnsConfigNullUdp (
|
---|
172 | IN UDP_IO *UdpIo,
|
---|
173 | IN VOID *Context
|
---|
174 | );
|
---|
175 |
|
---|
176 | /**
|
---|
177 | Release all the resource used the DNS service binding instance.
|
---|
178 |
|
---|
179 | @param DnsSb The Dns service binding instance.
|
---|
180 |
|
---|
181 | **/
|
---|
182 | VOID
|
---|
183 | DnsDestroyService (
|
---|
184 | IN DNS_SERVICE *DnsSb
|
---|
185 | );
|
---|
186 |
|
---|
187 | /**
|
---|
188 | Create then initialize a Dns service binding instance.
|
---|
189 |
|
---|
190 | @param Controller The controller to install the DNS service
|
---|
191 | binding on
|
---|
192 | @param Image The driver binding image of the DNS driver
|
---|
193 | @param IpVersion IpVersion for this service
|
---|
194 | @param Service The variable to receive the created service
|
---|
195 | binding instance.
|
---|
196 |
|
---|
197 | @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to create the instance.
|
---|
198 | @retval EFI_DEVICE_ERROR Failed to create a NULL UDP port to keep
|
---|
199 | connection with UDP.
|
---|
200 | @retval EFI_SUCCESS The service instance is created for the
|
---|
201 | controller.
|
---|
202 |
|
---|
203 | **/
|
---|
204 | EFI_STATUS
|
---|
205 | DnsCreateService (
|
---|
206 | IN EFI_HANDLE Controller,
|
---|
207 | IN EFI_HANDLE Image,
|
---|
208 | IN UINT8 IpVersion,
|
---|
209 | OUT DNS_SERVICE **Service
|
---|
210 | );
|
---|
211 |
|
---|
212 | /**
|
---|
213 | Unloads an image.
|
---|
214 |
|
---|
215 | @param ImageHandle Handle that identifies the image to be unloaded.
|
---|
216 |
|
---|
217 | @retval EFI_SUCCESS The image has been unloaded.
|
---|
218 | @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
|
---|
219 |
|
---|
220 | **/
|
---|
221 | EFI_STATUS
|
---|
222 | EFIAPI
|
---|
223 | DnsUnload (
|
---|
224 | IN EFI_HANDLE ImageHandle
|
---|
225 | );
|
---|
226 |
|
---|
227 | /**
|
---|
228 | This is the declaration of an EFI image entry point. This entry point is
|
---|
229 | the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
|
---|
230 | both device drivers and bus drivers.
|
---|
231 |
|
---|
232 | @param ImageHandle The firmware allocated handle for the UEFI image.
|
---|
233 | @param SystemTable A pointer to the EFI System Table.
|
---|
234 |
|
---|
235 | @retval EFI_SUCCESS The operation completed successfully.
|
---|
236 | @retval Others An unexpected error occurred.
|
---|
237 | **/
|
---|
238 | EFI_STATUS
|
---|
239 | EFIAPI
|
---|
240 | DnsDriverEntryPoint (
|
---|
241 | IN EFI_HANDLE ImageHandle,
|
---|
242 | IN EFI_SYSTEM_TABLE *SystemTable
|
---|
243 | );
|
---|
244 |
|
---|
245 | /**
|
---|
246 | Tests to see if this driver supports a given controller. If a child device is provided,
|
---|
247 | it further tests to see if this driver supports creating a handle for the specified child device.
|
---|
248 |
|
---|
249 | This function checks to see if the driver specified by This supports the device specified by
|
---|
250 | ControllerHandle. Drivers will typically use the device path attached to
|
---|
251 | ControllerHandle and/or the services from the bus I/O abstraction attached to
|
---|
252 | ControllerHandle to determine if the driver supports ControllerHandle. This function
|
---|
253 | may be called many times during platform initialization. In order to reduce boot times, the tests
|
---|
254 | performed by this function must be very small, and take as little time as possible to execute. This
|
---|
255 | function must not change the state of any hardware devices, and this function must be aware that the
|
---|
256 | device specified by ControllerHandle may already be managed by the same driver or a
|
---|
257 | different driver. This function must match its calls to AllocatePages() with FreePages(),
|
---|
258 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
|
---|
259 | Because ControllerHandle may have been previously started by the same driver, if a protocol is
|
---|
260 | already in the opened state, then it must not be closed with CloseProtocol(). This is required
|
---|
261 | to guarantee the state of ControllerHandle is not modified by this function.
|
---|
262 |
|
---|
263 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
264 | @param[in] ControllerHandle The handle of the controller to test. This handle
|
---|
265 | must support a protocol interface that supplies
|
---|
266 | an I/O abstraction to the driver.
|
---|
267 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
---|
268 | parameter is ignored by device drivers, and is optional for bus
|
---|
269 | drivers. For bus drivers, if this parameter is not NULL, then
|
---|
270 | the bus driver must determine if the bus controller specified
|
---|
271 | by ControllerHandle and the child controller specified
|
---|
272 | by RemainingDevicePath are both supported by this
|
---|
273 | bus driver.
|
---|
274 |
|
---|
275 | @retval EFI_SUCCESS The device specified by ControllerHandle and
|
---|
276 | RemainingDevicePath is supported by the driver specified by This.
|
---|
277 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
|
---|
278 | RemainingDevicePath is already being managed by the driver
|
---|
279 | specified by This.
|
---|
280 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
|
---|
281 | RemainingDevicePath is already being managed by a different
|
---|
282 | driver or an application that requires exclusive access.
|
---|
283 | Currently not implemented.
|
---|
284 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
|
---|
285 | RemainingDevicePath is not supported by the driver specified by This.
|
---|
286 | **/
|
---|
287 | EFI_STATUS
|
---|
288 | EFIAPI
|
---|
289 | Dns4DriverBindingSupported (
|
---|
290 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
291 | IN EFI_HANDLE ControllerHandle,
|
---|
292 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
---|
293 | );
|
---|
294 |
|
---|
295 | /**
|
---|
296 | Starts a device controller or a bus controller.
|
---|
297 |
|
---|
298 | The Start() function is designed to be invoked from the EFI boot service ConnectController().
|
---|
299 | As a result, much of the error checking on the parameters to Start() has been moved into this
|
---|
300 | common boot service. It is legal to call Start() from other locations,
|
---|
301 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.
|
---|
302 | 1. ControllerHandle must be a valid EFI_HANDLE.
|
---|
303 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
|
---|
304 | EFI_DEVICE_PATH_PROTOCOL.
|
---|
305 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must
|
---|
306 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
|
---|
307 |
|
---|
308 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
309 | @param[in] ControllerHandle The handle of the controller to start. This handle
|
---|
310 | must support a protocol interface that supplies
|
---|
311 | an I/O abstraction to the driver.
|
---|
312 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
---|
313 | parameter is ignored by device drivers, and is optional for bus
|
---|
314 | drivers. For a bus driver, if this parameter is NULL, then handles
|
---|
315 | for all the children of Controller are created by this driver.
|
---|
316 | If this parameter is not NULL and the first Device Path Node is
|
---|
317 | not the End of Device Path Node, then only the handle for the
|
---|
318 | child device specified by the first Device Path Node of
|
---|
319 | RemainingDevicePath is created by this driver.
|
---|
320 | If the first Device Path Node of RemainingDevicePath is
|
---|
321 | the End of Device Path Node, no child handle is created by this
|
---|
322 | driver.
|
---|
323 |
|
---|
324 | @retval EFI_SUCCESS The device was started.
|
---|
325 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
|
---|
326 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
---|
327 | @retval Others The driver failded to start the device.
|
---|
328 |
|
---|
329 | **/
|
---|
330 | EFI_STATUS
|
---|
331 | EFIAPI
|
---|
332 | Dns4DriverBindingStart (
|
---|
333 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
334 | IN EFI_HANDLE ControllerHandle,
|
---|
335 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
---|
336 | );
|
---|
337 |
|
---|
338 | /**
|
---|
339 | Stops a device controller or a bus controller.
|
---|
340 |
|
---|
341 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
|
---|
342 | As a result, much of the error checking on the parameters to Stop() has been moved
|
---|
343 | into this common boot service. It is legal to call Stop() from other locations,
|
---|
344 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.
|
---|
345 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
|
---|
346 | same driver's Start() function.
|
---|
347 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
|
---|
348 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's
|
---|
349 | Start() function, and the Start() function must have called OpenProtocol() on
|
---|
350 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
|
---|
351 |
|
---|
352 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
353 | @param[in] ControllerHandle A handle to the device being stopped. The handle must
|
---|
354 | support a bus specific I/O protocol for the driver
|
---|
355 | to use to stop the device.
|
---|
356 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
---|
357 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
|
---|
358 | if NumberOfChildren is 0.
|
---|
359 |
|
---|
360 | @retval EFI_SUCCESS The device was stopped.
|
---|
361 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
|
---|
362 |
|
---|
363 | **/
|
---|
364 | EFI_STATUS
|
---|
365 | EFIAPI
|
---|
366 | Dns4DriverBindingStop (
|
---|
367 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
368 | IN EFI_HANDLE ControllerHandle,
|
---|
369 | IN UINTN NumberOfChildren,
|
---|
370 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
---|
371 | );
|
---|
372 |
|
---|
373 | /**
|
---|
374 | Tests to see if this driver supports a given controller. If a child device is provided,
|
---|
375 | it further tests to see if this driver supports creating a handle for the specified child device.
|
---|
376 |
|
---|
377 | This function checks to see if the driver specified by This supports the device specified by
|
---|
378 | ControllerHandle. Drivers will typically use the device path attached to
|
---|
379 | ControllerHandle and/or the services from the bus I/O abstraction attached to
|
---|
380 | ControllerHandle to determine if the driver supports ControllerHandle. This function
|
---|
381 | may be called many times during platform initialization. In order to reduce boot times, the tests
|
---|
382 | performed by this function must be very small, and take as little time as possible to execute. This
|
---|
383 | function must not change the state of any hardware devices, and this function must be aware that the
|
---|
384 | device specified by ControllerHandle may already be managed by the same driver or a
|
---|
385 | different driver. This function must match its calls to AllocatePages() with FreePages(),
|
---|
386 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
|
---|
387 | Because ControllerHandle may have been previously started by the same driver, if a protocol is
|
---|
388 | already in the opened state, then it must not be closed with CloseProtocol(). This is required
|
---|
389 | to guarantee the state of ControllerHandle is not modified by this function.
|
---|
390 |
|
---|
391 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
392 | @param[in] ControllerHandle The handle of the controller to test. This handle
|
---|
393 | must support a protocol interface that supplies
|
---|
394 | an I/O abstraction to the driver.
|
---|
395 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
---|
396 | parameter is ignored by device drivers, and is optional for bus
|
---|
397 | drivers. For bus drivers, if this parameter is not NULL, then
|
---|
398 | the bus driver must determine if the bus controller specified
|
---|
399 | by ControllerHandle and the child controller specified
|
---|
400 | by RemainingDevicePath are both supported by this
|
---|
401 | bus driver.
|
---|
402 |
|
---|
403 | @retval EFI_SUCCESS The device specified by ControllerHandle and
|
---|
404 | RemainingDevicePath is supported by the driver specified by This.
|
---|
405 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
|
---|
406 | RemainingDevicePath is already being managed by the driver
|
---|
407 | specified by This.
|
---|
408 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
|
---|
409 | RemainingDevicePath is already being managed by a different
|
---|
410 | driver or an application that requires exclusive access.
|
---|
411 | Currently not implemented.
|
---|
412 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
|
---|
413 | RemainingDevicePath is not supported by the driver specified by This.
|
---|
414 | **/
|
---|
415 | EFI_STATUS
|
---|
416 | EFIAPI
|
---|
417 | Dns6DriverBindingSupported (
|
---|
418 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
419 | IN EFI_HANDLE ControllerHandle,
|
---|
420 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
---|
421 | );
|
---|
422 |
|
---|
423 | /**
|
---|
424 | Starts a device controller or a bus controller.
|
---|
425 |
|
---|
426 | The Start() function is designed to be invoked from the EFI boot service ConnectController().
|
---|
427 | As a result, much of the error checking on the parameters to Start() has been moved into this
|
---|
428 | common boot service. It is legal to call Start() from other locations,
|
---|
429 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.
|
---|
430 | 1. ControllerHandle must be a valid EFI_HANDLE.
|
---|
431 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
|
---|
432 | EFI_DEVICE_PATH_PROTOCOL.
|
---|
433 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must
|
---|
434 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
|
---|
435 |
|
---|
436 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
437 | @param[in] ControllerHandle The handle of the controller to start. This handle
|
---|
438 | must support a protocol interface that supplies
|
---|
439 | an I/O abstraction to the driver.
|
---|
440 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
---|
441 | parameter is ignored by device drivers, and is optional for bus
|
---|
442 | drivers. For a bus driver, if this parameter is NULL, then handles
|
---|
443 | for all the children of Controller are created by this driver.
|
---|
444 | If this parameter is not NULL and the first Device Path Node is
|
---|
445 | not the End of Device Path Node, then only the handle for the
|
---|
446 | child device specified by the first Device Path Node of
|
---|
447 | RemainingDevicePath is created by this driver.
|
---|
448 | If the first Device Path Node of RemainingDevicePath is
|
---|
449 | the End of Device Path Node, no child handle is created by this
|
---|
450 | driver.
|
---|
451 |
|
---|
452 | @retval EFI_SUCCESS The device was started.
|
---|
453 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
|
---|
454 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
---|
455 | @retval Others The driver failded to start the device.
|
---|
456 |
|
---|
457 | **/
|
---|
458 | EFI_STATUS
|
---|
459 | EFIAPI
|
---|
460 | Dns6DriverBindingStart (
|
---|
461 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
462 | IN EFI_HANDLE ControllerHandle,
|
---|
463 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
---|
464 | );
|
---|
465 |
|
---|
466 | /**
|
---|
467 | Stops a device controller or a bus controller.
|
---|
468 |
|
---|
469 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
|
---|
470 | As a result, much of the error checking on the parameters to Stop() has been moved
|
---|
471 | into this common boot service. It is legal to call Stop() from other locations,
|
---|
472 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.
|
---|
473 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
|
---|
474 | same driver's Start() function.
|
---|
475 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
|
---|
476 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's
|
---|
477 | Start() function, and the Start() function must have called OpenProtocol() on
|
---|
478 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
|
---|
479 |
|
---|
480 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
---|
481 | @param[in] ControllerHandle A handle to the device being stopped. The handle must
|
---|
482 | support a bus specific I/O protocol for the driver
|
---|
483 | to use to stop the device.
|
---|
484 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
---|
485 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
|
---|
486 | if NumberOfChildren is 0.
|
---|
487 |
|
---|
488 | @retval EFI_SUCCESS The device was stopped.
|
---|
489 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
|
---|
490 |
|
---|
491 | **/
|
---|
492 | EFI_STATUS
|
---|
493 | EFIAPI
|
---|
494 | Dns6DriverBindingStop (
|
---|
495 | IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
---|
496 | IN EFI_HANDLE ControllerHandle,
|
---|
497 | IN UINTN NumberOfChildren,
|
---|
498 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
---|
499 | );
|
---|
500 |
|
---|
501 | /**
|
---|
502 | Creates a child handle and installs a protocol.
|
---|
503 |
|
---|
504 | The CreateChild() function installs a protocol on ChildHandle.
|
---|
505 | If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
---|
506 | If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
---|
507 |
|
---|
508 | @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
---|
509 | @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
---|
510 | then a new handle is created. If it is a pointer to an existing UEFI handle,
|
---|
511 | then the protocol is added to the existing UEFI handle.
|
---|
512 |
|
---|
513 | @retval EFI_SUCCES The protocol was added to ChildHandle.
|
---|
514 | @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
|
---|
515 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
|
---|
516 | the child
|
---|
517 | @retval other The child handle was not created
|
---|
518 |
|
---|
519 | **/
|
---|
520 | EFI_STATUS
|
---|
521 | EFIAPI
|
---|
522 | Dns4ServiceBindingCreateChild (
|
---|
523 | IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
---|
524 | IN EFI_HANDLE *ChildHandle
|
---|
525 | );
|
---|
526 |
|
---|
527 | /**
|
---|
528 | Destroys a child handle with a protocol installed on it.
|
---|
529 |
|
---|
530 | The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
---|
531 | that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
---|
532 | last protocol on ChildHandle, then ChildHandle is destroyed.
|
---|
533 |
|
---|
534 | @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
---|
535 | @param[in] ChildHandle Handle of the child to destroy
|
---|
536 |
|
---|
537 | @retval EFI_SUCCES The protocol was removed from ChildHandle.
|
---|
538 | @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
|
---|
539 | @retval EFI_INVALID_PARAMETER Child handle is NULL.
|
---|
540 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
|
---|
541 | because its services are being used.
|
---|
542 | @retval other The child handle was not destroyed
|
---|
543 |
|
---|
544 | **/
|
---|
545 | EFI_STATUS
|
---|
546 | EFIAPI
|
---|
547 | Dns4ServiceBindingDestroyChild (
|
---|
548 | IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
---|
549 | IN EFI_HANDLE ChildHandle
|
---|
550 | );
|
---|
551 |
|
---|
552 | /**
|
---|
553 | Creates a child handle and installs a protocol.
|
---|
554 |
|
---|
555 | The CreateChild() function installs a protocol on ChildHandle.
|
---|
556 | If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
---|
557 | If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
---|
558 |
|
---|
559 | @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
---|
560 | @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
---|
561 | then a new handle is created. If it is a pointer to an existing UEFI handle,
|
---|
562 | then the protocol is added to the existing UEFI handle.
|
---|
563 |
|
---|
564 | @retval EFI_SUCCES The protocol was added to ChildHandle.
|
---|
565 | @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
|
---|
566 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
|
---|
567 | the child
|
---|
568 | @retval other The child handle was not created
|
---|
569 |
|
---|
570 | **/
|
---|
571 | EFI_STATUS
|
---|
572 | EFIAPI
|
---|
573 | Dns6ServiceBindingCreateChild (
|
---|
574 | IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
---|
575 | IN EFI_HANDLE *ChildHandle
|
---|
576 | );
|
---|
577 |
|
---|
578 | /**
|
---|
579 | Destroys a child handle with a protocol installed on it.
|
---|
580 |
|
---|
581 | The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
---|
582 | that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
---|
583 | last protocol on ChildHandle, then ChildHandle is destroyed.
|
---|
584 |
|
---|
585 | @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
---|
586 | @param[in] ChildHandle Handle of the child to destroy
|
---|
587 |
|
---|
588 | @retval EFI_SUCCES The protocol was removed from ChildHandle.
|
---|
589 | @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
|
---|
590 | @retval EFI_INVALID_PARAMETER Child handle is NULL.
|
---|
591 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
|
---|
592 | because its services are being used.
|
---|
593 | @retval other The child handle was not destroyed
|
---|
594 |
|
---|
595 | **/
|
---|
596 | EFI_STATUS
|
---|
597 | EFIAPI
|
---|
598 | Dns6ServiceBindingDestroyChild (
|
---|
599 | IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
---|
600 | IN EFI_HANDLE ChildHandle
|
---|
601 | );
|
---|
602 |
|
---|
603 |
|
---|
604 | #endif
|
---|