2 Public Header file of HII library used by Opal UEFI Driver.
3 Defines required callbacks of Opal HII library.
5 Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Protocol/HiiConfigAccess.h>
15 #include "OpalDriver.h"
16 #include "OpalHiiFormValues.h"
18 #define OPAL_PASSWORD_CONFIG_GUID \
20 0x0d510a4f, 0xa81b, 0x473f, { 0x87, 0x07, 0xb7, 0xfd, 0xfb, 0xc0, 0x45, 0xba } \
23 #define OPAL_REQUEST_VARIABLE_NAME L"OpalRequest"
29 OPAL_REQUEST OpalRequest
;
30 // EFI_DEVICE_PATH_PROTOCOL OpalDevicePath;
31 } OPAL_REQUEST_VARIABLE
;
34 UINT16 Id
: HII_KEY_ID_BITS
;
35 UINT16 Index
: HII_KEY_INDEX_BITS
;
36 UINT16 Flag
: HII_KEY_FLAG_BITS
;
45 VENDOR_DEVICE_PATH VendorDevicePath
;
46 EFI_DEVICE_PATH_PROTOCOL End
;
47 } HII_VENDOR_DEVICE_PATH
;
51 extern const EFI_GUID gHiiSetupVariableGuid
;
54 This function processes the results of changes in configuration.
56 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
57 @param Configuration A null-terminated Unicode string in <ConfigResp>
59 @param Progress A pointer to a string filled in with the offset of
60 the most recent '&' before the first failing
61 name/value pair (or the beginning of the string if
62 the failure is in the first name/value pair) or
63 the terminating NULL if all was successful.
65 @retval EFI_SUCCESS The Results is processed successfully.
66 @retval EFI_INVALID_PARAMETER Configuration is NULL.
67 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
74 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
75 CONST EFI_STRING Configuration
,
80 This function allows a caller to extract the current configuration for one
81 or more named elements from the target driver.
83 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
84 @param Request A null-terminated Unicode string in
85 <ConfigRequest> format.
86 @param Progress On return, points to a character in the Request
87 string. Points to the string's null terminator if
88 request was successful. Points to the most recent
89 '&' before the first failing name/value pair (or
90 the beginning of the string if the failure is in
91 the first name/value pair) if the request was not
93 @param Results A null-terminated Unicode string in
94 <ConfigAltResp> format which has all values filled
95 in for the names in the Request string. String to
96 be allocated by the called function.
98 @retval EFI_SUCCESS The Results is filled with the requested values.
99 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
100 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
101 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
108 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
109 CONST EFI_STRING Request
,
110 EFI_STRING
*Progress
,
115 This function processes the results of changes in configuration.
117 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
118 @param Action Specifies the type of action taken by the browser.
119 @param QuestionId A unique value which is sent to the original
120 exporting driver so that it can identify the type
122 @param Type The type of value for the question.
123 @param Value A pointer to the data being sent to the original
125 @param ActionRequest On return, points to the action requested by the
128 @retval EFI_SUCCESS The callback successfully handled the action.
129 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
130 variable and its data.
131 @retval EFI_DEVICE_ERROR The variable could not be saved.
132 @retval EFI_UNSUPPORTED The specified Action is not supported by the
139 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
140 EFI_BROWSER_ACTION Action
,
141 EFI_QUESTION_ID QuestionId
,
143 EFI_IFR_TYPE_VALUE
*Value
,
144 EFI_BROWSER_ACTION_REQUEST
*ActionRequest
149 Pass the current system state to the bios via the hii_G_Configuration.
153 OpalHiiSetBrowserData (
159 Populate the hii_g_Configuration with the browser Data.
163 OpalHiiGetBrowserData (
168 Draws the disk info form.
170 @retval EFI_SUCCESS Draw the disk info success.
174 HiiPopulateDiskInfoForm (
179 Update the global Disk index info.
181 @param Index The input disk index info.
183 @retval EFI_SUCCESS Update the disk index info success.
192 Use the input password to do the specified action.
194 @param Str The input password saved in.
196 @retval EFI_SUCCESS Do the required action success.
197 @retval Others Other error occur.
206 Update block sid info.
208 @param PpRequest Input the Pp Request.
210 @retval EFI_SUCCESS Do the required action success.
211 @retval Others Other error occur.
215 HiiSetBlockSidAction (
220 Reverts the Opal disk to factory default.
222 @param PsidStringId The string id for the PSID info.
224 @retval EFI_SUCCESS Do the required action success.
229 EFI_STRING_ID PsidStringId
233 Get disk name string id.
235 @param DiskIndex The input disk index info.
237 @retval The disk name string id.
241 GetDiskNameStringId (
246 Update the device info.
248 @param OpalDisk The Opal device.
250 @retval EFI_SUCCESS Initialize the device success.
251 @retval EFI_DEVICE_ERROR Get info from device failed.
252 @retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
256 OpalDiskUpdateStatus (
261 Get the driver image handle.
263 @retval the driver image handle.
267 HiiGetDriverImageHandleCB (
272 Install the HII form and string packages.
274 @retval EFI_SUCCESS Install all the resources success.
275 @retval EFI_OUT_OF_RESOURCES Out of resource error.
283 Returns the opaque pointer to a physical disk context.
285 @param DiskIndex Input the disk index.
287 @retval The device pointer.
296 Returns the disk name.
298 @param DiskIndex Input the disk index.
300 @retval Returns the disk name.
309 Set a string Value in a form.
311 @param DestStringId The stringid which need to update.
312 @param SrcAsciiStr The string nned to update.
314 @retval EFI_SUCCESS Do the required action success.
315 @retval Others Other error occur.
320 EFI_STRING_ID DestStringId
,
325 Install the HII related resources.
327 @retval EFI_SUCCESS Install all the resources success.
328 @retval other Error occur when install the resources.
336 Uninstall the HII capability.
338 @retval EFI_SUCCESS Uninstall all the resources success.
339 @retval others Other errors occur when unistall the hii resource.
347 Initialize the Opal disk base on the hardware info get from device.
349 @param Dev The Opal device.
351 @retval EFI_SUCCESS Initialize the device success.
352 @retval EFI_DEVICE_ERROR Get info from device failed.
357 IN OPAL_DRIVER_DEVICE
*Dev
361 Update the device ownership
363 @param OpalDisk The Opal device.
365 @retval EFI_SUCCESS Get ownership success.
366 @retval EFI_ACCESS_DENIED Has send BlockSID command, can't change ownership.
367 @retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
371 OpalDiskUpdateOwnerShip (