VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h

Last change on this file was 105670, checked in by vboxsync, 7 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

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