]> git.proxmox.com Git - mirror_edk2.git/blob - RedfishPkg/RedfishRestExDxe/RedfishRestExInternal.h
OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE
[mirror_edk2.git] / RedfishPkg / RedfishRestExDxe / RedfishRestExInternal.h
1 /** @file
2 RedfishRestExDxe support functions definitions.
3
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2019-2020 Hewlett Packard Enterprise Development LP<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef EFI_REDFISH_RESTEX_INTERNAL_H_
12 #define EFI_REDFISH_RESTEX_INTERNAL_H_
13
14 ///
15 /// Libraries classes
16 ///
17 #include <Library/BaseLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/DevicePathLib.h>
21 #include <Library/HttpIoLib.h>
22 #include <Library/MemoryAllocationLib.h>
23 #include <Library/NetLib.h>
24 #include <Library/UefiLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27
28 ///
29 /// UEFI Driver Model Protocols
30 ///
31 #include <Protocol/DriverBinding.h>
32 #include <Protocol/RestEx.h>
33 #include <Protocol/ServiceBinding.h>
34
35 #include "RedfishRestExDriver.h"
36
37 /**
38 This function check
39
40 @param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
41 REST service.
42 @param[in] HttpReceiveEfiStatus This is the status return from HttpIoRecvResponse
43
44 @retval EFI_SUCCESS The payload receive from Redfish service in sucessfully.
45 @retval EFI_NOT_READY May need to resend the HTTP request.
46 @retval EFI_DEVICE_ERROR Something wrong and can't be resolved.
47 @retval Others Other errors as indicated.
48
49 **/
50 EFI_STATUS
51 RedfishCheckHttpReceiveStatus (
52 IN RESTEX_INSTANCE *Instance,
53 IN EFI_STATUS HttpIoReceiveStatus
54 );
55
56 /**
57 This function send the HTTP request without body to see
58 if the write to URL is permitted by Redfish service. This function
59 checks if the HTTP request has Content-length in HTTP header. If yes,
60 set HTTP body to NULL and then send to service. Check the HTTP status
61 for the firther actions.
62
63 @param[in] This Pointer to EFI_REST_EX_PROTOCOL instance for a particular
64 REST service.
65 @param[in] RequestMessage Pointer to the HTTP request data for this resource
66 @param[in] PreservedRequestHeaders The pointer to save the request headers
67 @param[in] ItsWrite This is write method to URL.
68
69 @retval EFI_INVALID_PARAMETER Improper given parameters.
70 @retval EFI_SUCCESS This HTTP request is free to send to Redfish service.
71 @retval EFI_OUT_OF_RESOURCES NOt enough memory to process.
72 @retval EFI_ACCESS_DENIED Not allowed to write to this URL.
73
74 @retval Others Other errors as indicated.
75
76 **/
77 EFI_STATUS
78 RedfishHttpAddExpectation (
79 IN EFI_REST_EX_PROTOCOL *This,
80 IN EFI_HTTP_MESSAGE *RequestMessage,
81 IN EFI_HTTP_HEADER **PreservedRequestHeaders,
82 IN BOOLEAN *ItsWrite
83 );
84
85 /**
86 Provides a simple HTTP-like interface to send and receive resources from a REST service.
87
88 The SendReceive() function sends an HTTP request to this REST service, and returns a
89 response when the data is retrieved from the service. RequestMessage contains the HTTP
90 request to the REST resource identified by RequestMessage.Request.Url. The
91 ResponseMessage is the returned HTTP response for that request, including any HTTP
92 status.
93
94 @param[in] This Pointer to EFI_REST_EX_PROTOCOL instance for a particular
95 REST service.
96 @param[in] RequestMessage Pointer to the HTTP request data for this resource
97 @param[out] ResponseMessage Pointer to the HTTP response data obtained for this requested.
98
99 @retval EFI_SUCCESS operation succeeded.
100 @retval EFI_INVALID_PARAMETER This, RequestMessage, or ResponseMessage are NULL.
101 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
102
103 **/
104 EFI_STATUS
105 EFIAPI
106 RedfishRestExSendReceive (
107 IN EFI_REST_EX_PROTOCOL *This,
108 IN EFI_HTTP_MESSAGE *RequestMessage,
109 OUT EFI_HTTP_MESSAGE *ResponseMessage
110 );
111
112 /**
113 Obtain the current time from this REST service instance.
114
115 The GetServiceTime() function is an optional interface to obtain the current time from
116 this REST service instance. If this REST service does not support to retrieve the time,
117 this function returns EFI_UNSUPPORTED. This function must returns EFI_UNSUPPORTED if
118 EFI_REST_EX_SERVICE_TYPE returned in EFI_REST_EX_SERVICE_INFO from GetService() is
119 EFI_REST_EX_SERVICE_UNSPECIFIC.
120
121 @param[in] This Pointer to EFI_REST_EX_PROTOCOL instance for a particular
122 REST service.
123 @param[out] Time A pointer to storage to receive a snapshot of the current time of
124 the REST service.
125
126 @retval EFI_SUCCESS operation succeeded.
127 @retval EFI_INVALID_PARAMETER This or Time are NULL.
128 @retval EFI_UNSUPPORTED The RESTful service does not support returning the time.
129 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
130 @retval EFI_NOT_READY The configuration of this instance is not set yet. Configure() must
131 be executed and returns successfully prior to invoke this function.
132
133 **/
134 EFI_STATUS
135 EFIAPI
136 RedfishRestExGetServiceTime (
137 IN EFI_REST_EX_PROTOCOL *This,
138 OUT EFI_TIME *Time
139 );
140
141 /**
142 This function returns the information of REST service provided by this EFI REST EX driver instance.
143
144 The information such as the type of REST service and the access mode of REST EX driver instance
145 (In-band or Out-of-band) are described in EFI_REST_EX_SERVICE_INFO structure. For the vendor-specific
146 REST service, vendor-specific REST service information is returned in VendorSpecifcData.
147 REST EX driver designer is well know what REST service this REST EX driver instance intends to
148 communicate with. The designer also well know this driver instance is used to talk to BMC through
149 specific platform mechanism or talk to REST server through UEFI HTTP protocol. REST EX driver is
150 responsible to fill up the correct information in EFI_REST_EX_SERVICE_INFO. EFI_REST_EX_SERVICE_INFO
151 is referred by EFI REST clients to pickup the proper EFI REST EX driver instance to get and set resource.
152 GetService() is a basic and mandatory function which must be able to use even Configure() is not invoked
153 in previously.
154
155 @param[in] This Pointer to EFI_REST_EX_PROTOCOL instance for a particular
156 REST service.
157 @param[out] RestExServiceInfo Pointer to receive a pointer to EFI_REST_EX_SERVICE_INFO structure. The
158 format of EFI_REST_EX_SERVICE_INFO is version controlled for the future
159 extension. The version of EFI_REST_EX_SERVICE_INFO structure is returned
160 in the header within this structure. EFI REST client refers to the correct
161 format of structure according to the version number. The pointer to
162 EFI_REST_EX_SERVICE_INFO is a memory block allocated by EFI REST EX driver
163 instance. That is caller's responsibility to free this memory when this
164 structure is no longer needed. Refer to Related Definitions below for the
165 definitions of EFI_REST_EX_SERVICE_INFO structure.
166
167 @retval EFI_SUCCESS EFI_REST_EX_SERVICE_INFO is returned in RestExServiceInfo. This function
168 is not supported in this REST EX Protocol driver instance.
169 @retval EFI_UNSUPPORTED This function is not supported in this REST EX Protocol driver instance.
170
171 **/
172 EFI_STATUS
173 EFIAPI
174 RedfishRestExGetService (
175 IN EFI_REST_EX_PROTOCOL *This,
176 OUT EFI_REST_EX_SERVICE_INFO **RestExServiceInfo
177 );
178
179 /**
180 This function returns operational configuration of current EFI REST EX child instance.
181
182 This function returns the current configuration of EFI REST EX child instance. The format of
183 operational configuration depends on the implementation of EFI REST EX driver instance. For
184 example, HTTP-aware EFI REST EX driver instance uses EFI HTTP protocol as the undying protocol
185 to communicate with REST service. In this case, the type of configuration is
186 EFI_REST_EX_CONFIG_TYPE_HTTP returned from GetService(). EFI_HTTP_CONFIG_DATA is used as EFI REST
187 EX configuration format and returned to EFI REST client. User has to type cast RestExConfigData
188 to EFI_HTTP_CONFIG_DATA. For those non HTTP-aware REST EX driver instances, the type of configuration
189 is EFI_REST_EX_CONFIG_TYPE_UNSPECIFIC returned from GetService(). In this case, the format of
190 returning data could be non industrial. Instead, the format of configuration data is system/platform
191 specific definition such as BMC mechanism used in EFI REST EX driver instance. EFI REST client and
192 EFI REST EX driver instance have to refer to the specific system /platform spec which is out of UEFI scope.
193
194 @param[in] This This is the EFI_REST_EX_PROTOCOL instance.
195 @param[out] RestExConfigData Pointer to receive a pointer to EFI_REST_EX_CONFIG_DATA.
196 The memory allocated for configuration data should be freed
197 by caller. See Related Definitions for the details.
198
199 @retval EFI_SUCCESS EFI_REST_EX_CONFIG_DATA is returned in successfully.
200 @retval EFI_UNSUPPORTED This function is not supported in this REST EX Protocol driver instance.
201 @retval EFI_NOT_READY The configuration of this instance is not set yet. Configure() must be
202 executed and returns successfully prior to invoke this function.
203
204 **/
205 EFI_STATUS
206 EFIAPI
207 RedfishRestExGetModeData (
208 IN EFI_REST_EX_PROTOCOL *This,
209 OUT EFI_REST_EX_CONFIG_DATA *RestExConfigData
210 );
211
212 /**
213 This function is used to configure EFI REST EX child instance.
214
215 This function is used to configure the setting of underlying protocol of REST EX child
216 instance. The type of configuration is according to the implementation of EFI REST EX
217 driver instance. For example, HTTP-aware EFI REST EX driver instance uses EFI HTTP protocol
218 as the undying protocol to communicate with REST service. The type of configuration is
219 EFI_REST_EX_CONFIG_TYPE_HTTP and RestExConfigData is the same format with EFI_HTTP_CONFIG_DATA.
220 Akin to HTTP configuration, REST EX child instance can be configure to use different HTTP
221 local access point for the data transmission. Multiple REST clients may use different
222 configuration of HTTP to distinguish themselves, such as to use the different TCP port.
223 For those non HTTP-aware REST EX driver instance, the type of configuration is
224 EFI_REST_EX_CONFIG_TYPE_UNSPECIFIC. RestExConfigData refers to the non industrial standard.
225 Instead, the format of configuration data is system/platform specific definition such as BMC.
226 In this case, EFI REST client and EFI REST EX driver instance have to refer to the specific
227 system/platform spec which is out of the UEFI scope. Besides GetService()function, no other
228 EFI REST EX functions can be executed by this instance until Configure()is executed and returns
229 successfully. All other functions must returns EFI_NOT_READY if this instance is not configured
230 yet. Set RestExConfigData to NULL means to put EFI REST EX child instance into the unconfigured
231 state.
232
233 @param[in] This This is the EFI_REST_EX_PROTOCOL instance.
234 @param[in] RestExConfigData Pointer to EFI_REST_EX_CONFIG_DATA. See Related Definitions in
235 GetModeData() protocol interface.
236
237 @retval EFI_SUCCESS EFI_REST_EX_CONFIG_DATA is set in successfully.
238 @retval EFI_DEVICE_ERROR Configuration for this REST EX child instance is failed with the given
239 EFI_REST_EX_CONFIG_DATA.
240 @retval EFI_UNSUPPORTED This function is not supported in this REST EX Protocol driver instance.
241
242 **/
243 EFI_STATUS
244 EFIAPI
245 RedfishRestExConfigure (
246 IN EFI_REST_EX_PROTOCOL *This,
247 IN EFI_REST_EX_CONFIG_DATA RestExConfigData
248 );
249
250 /**
251 This function sends REST request to REST service and signal caller's event asynchronously when
252 the final response is received by REST EX Protocol driver instance.
253
254 The essential design of this function is to handle asynchronous send/receive implicitly according
255 to REST service asynchronous request mechanism. Caller will get the notification once the response
256 is returned from REST service.
257
258 @param[in] This This is the EFI_REST_EX_PROTOCOL instance.
259 @param[in] RequestMessage This is the HTTP request message sent to REST service. Set RequestMessage
260 to NULL to cancel the previous asynchronous request associated with the
261 corresponding RestExToken. See descriptions for the details.
262 @param[in] RestExToken REST EX token which REST EX Protocol instance uses to notify REST client
263 the status of response of asynchronous REST request. See related definition
264 of EFI_REST_EX_TOKEN.
265 @param[in] TimeOutInMilliSeconds The pointer to the timeout in milliseconds which REST EX Protocol driver
266 instance refers as the duration to drop asynchronous REST request. NULL
267 pointer means no timeout for this REST request. REST EX Protocol driver
268 signals caller's event with EFI_STATUS set to EFI_TIMEOUT in RestExToken
269 if REST EX Protocol can't get the response from REST service within
270 TimeOutInMilliSeconds.
271
272 @retval EFI_SUCCESS Asynchronous REST request is established.
273 @retval EFI_UNSUPPORTED This REST EX Protocol driver instance doesn't support asynchronous request.
274 @retval EFI_TIMEOUT Asynchronous REST request is not established and timeout is expired.
275 @retval EFI_ABORT Previous asynchronous REST request has been canceled.
276 @retval EFI_DEVICE_ERROR Otherwise, returns EFI_DEVICE_ERROR for other errors according to HTTP Status Code.
277 @retval EFI_NOT_READY The configuration of this instance is not set yet. Configure() must be executed
278 and returns successfully prior to invoke this function.
279
280 **/
281 EFI_STATUS
282 EFIAPI
283 RedfishRestExAyncSendReceive (
284 IN EFI_REST_EX_PROTOCOL *This,
285 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
286 IN EFI_REST_EX_TOKEN *RestExToken,
287 IN UINTN *TimeOutInMilliSeconds OPTIONAL
288 );
289
290 /**
291 This function sends REST request to a REST Event service and signals caller's event
292 token asynchronously when the URI resource change event is received by REST EX
293 Protocol driver instance.
294
295 The essential design of this function is to monitor event implicitly according to
296 REST service event service mechanism. Caller will get the notification if certain
297 resource is changed.
298
299 @param[in] This This is the EFI_REST_EX_PROTOCOL instance.
300 @param[in] RequestMessage This is the HTTP request message sent to REST service. Set RequestMessage
301 to NULL to cancel the previous event service associated with the corresponding
302 RestExToken. See descriptions for the details.
303 @param[in] RestExToken REST EX token which REST EX Protocol driver instance uses to notify REST client
304 the URI resource which monitored by REST client has been changed. See the related
305 definition of EFI_REST_EX_TOKEN in EFI_REST_EX_PROTOCOL.AsyncSendReceive().
306
307 @retval EFI_SUCCESS Asynchronous REST request is established.
308 @retval EFI_UNSUPPORTED This REST EX Protocol driver instance doesn't support asynchronous request.
309 @retval EFI_ABORT Previous asynchronous REST request has been canceled or event subscription has been
310 delete from service.
311 @retval EFI_DEVICE_ERROR Otherwise, returns EFI_DEVICE_ERROR for other errors according to HTTP Status Code.
312 @retval EFI_NOT_READY The configuration of this instance is not set yet. Configure() must be executed
313 and returns successfully prior to invoke this function.
314
315 **/
316 EFI_STATUS
317 EFIAPI
318 RedfishRestExEventService (
319 IN EFI_REST_EX_PROTOCOL *This,
320 IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL,
321 IN EFI_REST_EX_TOKEN *RestExToken
322 );
323 /**
324 Create a new TLS session becuase the previous on is closed.
325 status.
326
327 @param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
328 REST service.
329 @retval EFI_SUCCESS operation succeeded.
330 @retval EFI Errors Other errors.
331
332 **/
333 EFI_STATUS
334 ResetHttpTslSession (
335 IN RESTEX_INSTANCE *Instance
336 );
337
338
339 /**
340 Callback function which provided by user to remove one node in NetDestroyLinkList process.
341
342 @param[in] Entry The entry to be removed.
343 @param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
344
345 @retval EFI_SUCCESS The entry has been removed successfully.
346 @retval Others Fail to remove the entry.
347
348 **/
349 EFI_STATUS
350 EFIAPI
351 RestExDestroyChildEntryInHandleBuffer (
352 IN LIST_ENTRY *Entry,
353 IN VOID *Context
354 );
355
356 /**
357 Destroy the RestEx instance and recycle the resources.
358
359 @param[in] Instance The pointer to the RestEx instance.
360
361 **/
362 VOID
363 RestExDestroyInstance (
364 IN RESTEX_INSTANCE *Instance
365 );
366
367 /**
368 Create the RestEx instance and initialize it.
369
370 @param[in] Service The pointer to the RestEx service.
371 @param[out] Instance The pointer to the RestEx instance.
372
373 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
374 @retval EFI_SUCCESS The RestEx instance is created.
375
376 **/
377 EFI_STATUS
378 RestExCreateInstance (
379 IN RESTEX_SERVICE *Service,
380 OUT RESTEX_INSTANCE **Instance
381 );
382
383
384 /**
385 Release all the resource used the RestEx service binding instance.
386
387 @param[in] RestExSb The RestEx service binding instance.
388
389 **/
390 VOID
391 RestExDestroyService (
392 IN RESTEX_SERVICE *RestExSb
393 );
394
395 /**
396 Create then initialize a RestEx service binding instance.
397
398 @param[in] Controller The controller to install the RestEx service
399 binding on.
400 @param[in] Image The driver binding image of the RestEx driver.
401 @param[out] Service The variable to receive the created service
402 binding instance.
403
404 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to create the instance.
405 @retval EFI_SUCCESS The service instance is created for the controller.
406
407 **/
408 EFI_STATUS
409 RestExCreateService (
410 IN EFI_HANDLE Controller,
411 IN EFI_HANDLE Image,
412 OUT RESTEX_SERVICE **Service
413 );
414
415 /**
416 This is the declaration of an EFI image entry point. This entry point is
417 the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
418 both device drivers and bus drivers.
419
420 @param[in] ImageHandle The firmware allocated handle for the UEFI image.
421 @param[in] SystemTable A pointer to the EFI System Table.
422
423 @retval EFI_SUCCESS The operation completed successfully.
424 @retval Others An unexpected error occurred.
425 **/
426 EFI_STATUS
427 EFIAPI
428 RedfishRestExDriverEntryPoint (
429 IN EFI_HANDLE ImageHandle,
430 IN EFI_SYSTEM_TABLE *SystemTable
431 );
432
433 /**
434 Tests to see if this driver supports a given controller. If a child device is provided,
435 it further tests to see if this driver supports creating a handle for the specified child device.
436
437 This function checks to see if the driver specified by This supports the device specified by
438 ControllerHandle. Drivers will typically use the device path attached to
439 ControllerHandle and/or the services from the bus I/O abstraction attached to
440 ControllerHandle to determine if the driver supports ControllerHandle. This function
441 may be called many times during platform initialization. In order to reduce boot times, the tests
442 performed by this function must be very small, and take as little time as possible to execute. This
443 function must not change the state of any hardware devices, and this function must be aware that the
444 device specified by ControllerHandle may already be managed by the same driver or a
445 different driver. This function must match its calls to AllocatePages() with FreePages(),
446 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
447 Because ControllerHandle may have been previously started by the same driver, if a protocol is
448 already in the opened state, then it must not be closed with CloseProtocol(). This is required
449 to guarantee the state of ControllerHandle is not modified by this function.
450
451 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
452 @param[in] ControllerHandle The handle of the controller to test. This handle
453 must support a protocol interface that supplies
454 an I/O abstraction to the driver.
455 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
456 parameter is ignored by device drivers, and is optional for bus
457 drivers. For bus drivers, if this parameter is not NULL, then
458 the bus driver must determine if the bus controller specified
459 by ControllerHandle and the child controller specified
460 by RemainingDevicePath are both supported by this
461 bus driver.
462
463 @retval EFI_SUCCESS The device specified by ControllerHandle and
464 RemainingDevicePath is supported by the driver specified by This.
465 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
466 RemainingDevicePath is already being managed by the driver
467 specified by This.
468 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
469 RemainingDevicePath is already being managed by a different
470 driver or an application that requires exclusive access.
471 Currently not implemented.
472 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
473 RemainingDevicePath is not supported by the driver specified by This.
474 **/
475 EFI_STATUS
476 EFIAPI
477 RedfishRestExDriverBindingSupported (
478 IN EFI_DRIVER_BINDING_PROTOCOL *This,
479 IN EFI_HANDLE ControllerHandle,
480 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
481 );
482
483 /**
484 Starts a device controller or a bus controller.
485
486 The Start() function is designed to be invoked from the EFI boot service ConnectController().
487 As a result, much of the error checking on the parameters to Start() has been moved into this
488 common boot service. It is legal to call Start() from other locations,
489 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
490 1. ControllerHandle must be a valid EFI_HANDLE.
491 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
492 EFI_DEVICE_PATH_PROTOCOL.
493 3. Prior to calling Start(), the Supported() function for the driver specified by This must
494 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
495
496 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
497 @param[in] ControllerHandle The handle of the controller to start. This handle
498 must support a protocol interface that supplies
499 an I/O abstraction to the driver.
500 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
501 parameter is ignored by device drivers, and is optional for bus
502 drivers. For a bus driver, if this parameter is NULL, then handles
503 for all the children of Controller are created by this driver.
504 If this parameter is not NULL and the first Device Path Node is
505 not the End of Device Path Node, then only the handle for the
506 child device specified by the first Device Path Node of
507 RemainingDevicePath is created by this driver.
508 If the first Device Path Node of RemainingDevicePath is
509 the End of Device Path Node, no child handle is created by this
510 driver.
511
512 @retval EFI_SUCCESS The device was started.
513 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
514 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
515 @retval Others The driver failded to start the device.
516
517 **/
518 EFI_STATUS
519 EFIAPI
520 RedfishRestExDriverBindingStart (
521 IN EFI_DRIVER_BINDING_PROTOCOL *This,
522 IN EFI_HANDLE ControllerHandle,
523 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
524 );
525
526 /**
527 Stops a device controller or a bus controller.
528
529 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
530 As a result, much of the error checking on the parameters to Stop() has been moved
531 into this common boot service. It is legal to call Stop() from other locations,
532 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
533 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
534 same driver's Start() function.
535 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
536 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
537 Start() function, and the Start() function must have called OpenProtocol() on
538 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
539
540 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
541 @param[in] ControllerHandle A handle to the device being stopped. The handle must
542 support a bus specific I/O protocol for the driver
543 to use to stop the device.
544 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
545 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
546 if NumberOfChildren is 0.
547
548 @retval EFI_SUCCESS The device was stopped.
549 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
550
551 **/
552 EFI_STATUS
553 EFIAPI
554 RedfishRestExDriverBindingStop (
555 IN EFI_DRIVER_BINDING_PROTOCOL *This,
556 IN EFI_HANDLE ControllerHandle,
557 IN UINTN NumberOfChildren,
558 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
559 );
560
561 /**
562 Creates a child handle and installs a protocol.
563
564 The CreateChild() function installs a protocol on ChildHandle.
565 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
566 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
567
568 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
569 @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
570 then a new handle is created. If it is a pointer to an existing UEFI handle,
571 then the protocol is added to the existing UEFI handle.
572
573 @retval EFI_SUCCES The protocol was added to ChildHandle.
574 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
575 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
576 the child
577 @retval other The child handle was not created
578
579 **/
580 EFI_STATUS
581 EFIAPI
582 RedfishRestExServiceBindingCreateChild (
583 IN EFI_SERVICE_BINDING_PROTOCOL *This,
584 IN EFI_HANDLE *ChildHandle
585 );
586
587 /**
588 Destroys a child handle with a protocol installed on it.
589
590 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
591 that was installed by CreateChild() from ChildHandle. If the removed protocol is the
592 last protocol on ChildHandle, then ChildHandle is destroyed.
593
594 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
595 @param[in] ChildHandle Handle of the child to destroy
596
597 @retval EFI_SUCCES The protocol was removed from ChildHandle.
598 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
599 @retval EFI_INVALID_PARAMETER Child handle is NULL.
600 @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
601 because its services are being used.
602 @retval other The child handle was not destroyed
603
604 **/
605 EFI_STATUS
606 EFIAPI
607 RedfishRestExServiceBindingDestroyChild (
608 IN EFI_SERVICE_BINDING_PROTOCOL *This,
609 IN EFI_HANDLE ChildHandle
610 );
611 #endif