2 Private functions and sturctures used by the Opal UEFI Driver.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _OPAL_HII_PRIVATE_H_
16 #define _OPAL_HII_PRIVATE_H_
20 #include <Library/OpalPasswordSupportLib.h>
21 #include <Protocol/HiiConfigAccess.h>
24 #include "OpalHiiFormValues.h"
27 #define OPAL_PASSWORD_CONFIG_GUID \
29 0x0d510a4f, 0xa81b, 0x473f, { 0x87, 0x07, 0xb7, 0xfd, 0xfb, 0xc0, 0x45, 0xba } \
35 UINT16 Id
: HII_KEY_ID_BITS
;
36 UINT16 Index
: HII_KEY_INDEX_BITS
;
37 UINT16 Flag
: HII_KEY_FLAG_BITS
;
46 VENDOR_DEVICE_PATH VendorDevicePath
;
47 EFI_DEVICE_PATH_PROTOCOL End
;
48 } HII_VENDOR_DEVICE_PATH
;
51 * Opal PSID Authority utilized for PSID revert
53 * The type indicates the structure of the PSID authority
56 UINT8 Psid
[PSID_CHARACTER_LENGTH
];
60 This function processes the results of changes in configuration.
62 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
63 @param Configuration A null-terminated Unicode string in <ConfigResp>
65 @param Progress A pointer to a string filled in with the offset of
66 the most recent '&' before the first failing
67 name/value pair (or the beginning of the string if
68 the failure is in the first name/value pair) or
69 the terminating NULL if all was successful.
71 @retval EFI_SUCCESS The Results is processed successfully.
72 @retval EFI_INVALID_PARAMETER Configuration is NULL.
73 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
80 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
81 CONST EFI_STRING Configuration
,
86 This function allows a caller to extract the current configuration for one
87 or more named elements from the target driver.
89 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
90 @param Request A null-terminated Unicode string in
91 <ConfigRequest> format.
92 @param Progress On return, points to a character in the Request
93 string. Points to the string's null terminator if
94 request was successful. Points to the most recent
95 '&' before the first failing name/value pair (or
96 the beginning of the string if the failure is in
97 the first name/value pair) if the request was not
99 @param Results A null-terminated Unicode string in
100 <ConfigAltResp> format which has all values filled
101 in for the names in the Request string. String to
102 be allocated by the called function.
104 @retval EFI_SUCCESS The Results is filled with the requested values.
105 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
106 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
107 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
114 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
115 CONST EFI_STRING Request
,
116 EFI_STRING
*Progress
,
121 This function processes the results of changes in configuration.
123 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
124 @param Action Specifies the type of action taken by the browser.
125 @param QuestionId A unique value which is sent to the original
126 exporting driver so that it can identify the type
128 @param Type The type of value for the question.
129 @param Value A pointer to the data being sent to the original
131 @param ActionRequest On return, points to the action requested by the
134 @retval EFI_SUCCESS The callback successfully handled the action.
135 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
136 variable and its data.
137 @retval EFI_DEVICE_ERROR The variable could not be saved.
138 @retval EFI_UNSUPPORTED The specified Action is not supported by the
145 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
* This
,
146 EFI_BROWSER_ACTION Action
,
147 EFI_QUESTION_ID QuestionId
,
149 EFI_IFR_TYPE_VALUE
* Value
,
150 EFI_BROWSER_ACTION_REQUEST
* ActionRequest
155 Pass the current system state to the bios via the hii_G_Configuration.
159 OpalHiiSetBrowserData (
165 Populate the hii_g_Configuraton with the browser Data.
169 OpalHiiGetBrowserData (
174 Draws the disk info form.
176 @retval EFI_SUCCESS Draw the disk info success.
180 HiiPopulateDiskInfoForm(
185 Update the global Disk index info.
187 @param Index The input disk index info.
189 @retval EFI_SUCCESS Update the disk index info success.
198 Use the input password to do the specified action.
200 @param Str The input password saved in.
202 @retval EFI_SUCCESS Do the required action success.
203 @retval Others Other error occur.
212 Update block sid info.
214 @param Enable Enable/disable BlockSid.
216 @retval EFI_SUCCESS Do the required action success.
217 @retval Others Other error occur.
226 Reverts the Opal disk to factory default.
228 @param PsidStringId The string id for the PSID info.
230 @retval EFI_SUCCESS Do the required action success.
235 EFI_STRING_ID PsidStringId
239 Get disk name string id.
241 @param DiskIndex The input disk index info.
243 @retval The disk name string id.
252 Update the device info.
254 @param OpalDisk The Opal device.
256 @retval EFI_SUCESS Initialize the device success.
257 @retval EFI_DEVICE_ERROR Get info from device failed.
258 @retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
262 OpalDiskUpdateStatus (