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