VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h@ 99404

Last change on this file since 99404 was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette