VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.h@ 106058

Last change on this file since 106058 was 105670, checked in by vboxsync, 8 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: 8.6 KB
Line 
1/** @file
2 Header file of Redfish Configuration Handler UEFI driver.
3
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#ifndef EFI_REDFISH_CONFIG_HANDLER_DRIVER_H_
12#define EFI_REDFISH_CONFIG_HANDLER_DRIVER_H_
13
14#include "RedfishConfigHandlerCommon.h"
15
16//
17// UEFI Driver Model Protocols
18//
19
20#include <Protocol/DriverBinding.h>
21#include <Protocol/RedfishDiscover.h>
22#include <Protocol/RestEx.h>
23
24//
25// Protocol instances
26//
27extern EFI_DRIVER_BINDING_PROTOCOL gRedfishConfigDriverBinding;
28extern EFI_COMPONENT_NAME_PROTOCOL gRedfishConfigHandlerComponentName;
29extern EFI_COMPONENT_NAME2_PROTOCOL gRedfishConfigHandlerComponentName2;
30
31extern REDFISH_CONFIG_DRIVER_DATA gRedfishConfigData;
32extern EDKII_REDFISH_CREDENTIAL_PROTOCOL *gCredential;
33extern EFI_EVENT gEndOfDxeEvent;
34extern EFI_EVENT gExitBootServiceEvent;
35
36/**
37 Tests to see if this driver supports a given controller. If a child device is provided,
38 it further tests to see if this driver supports creating a handle for the specified child device.
39
40 This function checks to see if the driver specified by This supports the device specified by
41 ControllerHandle. Drivers will typically use the device path attached to
42 ControllerHandle and/or the services from the bus I/O abstraction attached to
43 ControllerHandle to determine if the driver supports ControllerHandle. This function
44 may be called many times during platform initialization. In order to reduce boot times, the tests
45 performed by this function must be very small, and take as little time as possible to execute. This
46 function must not change the state of any hardware devices, and this function must be aware that the
47 device specified by ControllerHandle may already be managed by the same driver or a
48 different driver. This function must match its calls to AllocatePages() with FreePages(),
49 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
50 Because ControllerHandle may have been previously started by the same driver, if a protocol is
51 already in the opened state, then it must not be closed with CloseProtocol(). This is required
52 to guarantee the state of ControllerHandle is not modified by this function.
53
54 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
55 @param[in] ControllerHandle The handle of the controller to test. This handle
56 must support a protocol interface that supplies
57 an I/O abstraction to the driver.
58 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
59 parameter is ignored by device drivers, and is optional for bus
60 drivers. For bus drivers, if this parameter is not NULL, then
61 the bus driver must determine if the bus controller specified
62 by ControllerHandle and the child controller specified
63 by RemainingDevicePath are both supported by this
64 bus driver.
65
66 @retval EFI_SUCCESS The device specified by ControllerHandle and
67 RemainingDevicePath is supported by the driver specified by This.
68 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
69 RemainingDevicePath is already being managed by the driver
70 specified by This.
71 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
72 RemainingDevicePath is already being managed by a different
73 driver or an application that requires exclusive access.
74 Currently not implemented.
75 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
76 RemainingDevicePath is not supported by the driver specified by This.
77**/
78EFI_STATUS
79EFIAPI
80RedfishConfigDriverBindingSupported (
81 IN EFI_DRIVER_BINDING_PROTOCOL *This,
82 IN EFI_HANDLE ControllerHandle,
83 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
84 );
85
86/**
87 Starts a device controller or a bus controller.
88
89 The Start() function is designed to be invoked from the EFI boot service ConnectController().
90 As a result, much of the error checking on the parameters to Start() has been moved into this
91 common boot service. It is legal to call Start() from other locations,
92 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
93 1. ControllerHandle must be a valid EFI_HANDLE.
94 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
95 EFI_DEVICE_PATH_PROTOCOL.
96 3. Prior to calling Start(), the Supported() function for the driver specified by This must
97 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
98
99 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
100 @param[in] ControllerHandle The handle of the controller to start. This handle
101 must support a protocol interface that supplies
102 an I/O abstraction to the driver.
103 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
104 parameter is ignored by device drivers, and is optional for bus
105 drivers. For a bus driver, if this parameter is NULL, then handles
106 for all the children of Controller are created by this driver.
107 If this parameter is not NULL and the first Device Path Node is
108 not the End of Device Path Node, then only the handle for the
109 child device specified by the first Device Path Node of
110 RemainingDevicePath is created by this driver.
111 If the first Device Path Node of RemainingDevicePath is
112 the End of Device Path Node, no child handle is created by this
113 driver.
114
115 @retval EFI_SUCCESS The driver is started.
116 @retval EFI_ALREADY_STARTED The driver was already started.
117
118**/
119EFI_STATUS
120EFIAPI
121RedfishConfigDriverBindingStart (
122 IN EFI_DRIVER_BINDING_PROTOCOL *This,
123 IN EFI_HANDLE ControllerHandle,
124 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
125 );
126
127/**
128 Stops a device controller or a bus controller.
129
130 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
131 As a result, much of the error checking on the parameters to Stop() has been moved
132 into this common boot service. It is legal to call Stop() from other locations,
133 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
134 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
135 same driver's Start() function.
136 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
137 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
138 Start() function, and the Start() function must have called OpenProtocol() on
139 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
140
141 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
142 @param[in] ControllerHandle A handle to the device being stopped. The handle must
143 support a bus specific I/O protocol for the driver
144 to use to stop the device.
145 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
146 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
147 if NumberOfChildren is 0.
148
149 @retval EFI_SUCCESS The device was stopped.
150 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
151
152**/
153EFI_STATUS
154EFIAPI
155RedfishConfigDriverBindingStop (
156 IN EFI_DRIVER_BINDING_PROTOCOL *This,
157 IN EFI_HANDLE ControllerHandle,
158 IN UINTN NumberOfChildren,
159 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
160 );
161
162#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