]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiFormValues.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPassword / OpalHiiFormValues.h
1 /** @file
2 Defines Opal HII form ids, structures and values.
3
4 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _OPAL_HII_FORM_VALUES_H_
10 #define _OPAL_HII_FORM_VALUES_H_
11
12 // ID's for various forms that will be used by HII
13 #define FORMID_VALUE_MAIN_MENU 0x01
14 #define FORMID_VALUE_DISK_INFO_FORM_MAIN 0x02
15
16 #pragma pack(1)
17 typedef struct {
18 UINT16 Lock : 1;
19 UINT16 Unlock : 1;
20 UINT16 SetAdminPwd : 1;
21 UINT16 SetUserPwd : 1;
22 UINT16 SecureErase : 1;
23 UINT16 Revert : 1;
24 UINT16 PsidRevert : 1;
25 UINT16 DisableUser : 1;
26 UINT16 DisableFeature : 1;
27 UINT16 EnableFeature : 1;
28 UINT16 Reserved : 5;
29 UINT16 KeepUserData : 1;
30 } OPAL_REQUEST;
31
32 typedef struct {
33 UINT8 NumDisks;
34 UINT8 SelectedDiskIndex;
35 UINT16 SelectedDiskAvailableActions;
36 UINT16 SupportedDisks;
37 BOOLEAN KeepUserDataForced;
38 OPAL_REQUEST OpalRequest;
39 UINT8 EnableBlockSid;
40 } OPAL_HII_CONFIGURATION;
41
42 #pragma pack()
43
44 /* Action Flags */
45 #define HII_ACTION_NONE 0x0000
46 #define HII_ACTION_LOCK 0x0001
47 #define HII_ACTION_UNLOCK 0x0002
48 #define HII_ACTION_SET_ADMIN_PWD 0x0004
49 #define HII_ACTION_SET_USER_PWD 0x0008
50 #define HII_ACTION_SECURE_ERASE 0x0010
51 #define HII_ACTION_REVERT 0x0020
52 #define HII_ACTION_PSID_REVERT 0x0040
53 #define HII_ACTION_DISABLE_USER 0x0080
54 #define HII_ACTION_DISABLE_FEATURE 0x0100
55 #define HII_ACTION_ENABLE_FEATURE 0x0200
56
57 /* Number of bits allocated for each part of a unique key for an HII_ITEM
58 * all bits together must be <= 16 (EFI_QUESTION_ID is UINT16)
59 * 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
60 * | |-----------------------| |---------------------------|
61 * FLG INDEX ID
62 */
63 #define HII_KEY_ID_BITS 8
64 #define HII_KEY_INDEX_BITS 7
65 #define HII_KEY_FLAG_BITS 1
66
67 #define HII_KEY_FLAG 0x8000 // bit 15 (zero based)
68
69 /***********/
70 /* Key IDs */
71 /***********/
72
73 #define HII_KEY_ID_GOTO_DISK_INFO 1
74
75 #define HII_KEY_ID_VAR_SUPPORTED_DISKS 2
76 #define HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS 3
77
78 #define HII_KEY_ID_BLOCKSID 4
79 #define HII_KEY_ID_SET_ADMIN_PWD 5
80 #define HII_KEY_ID_SET_USER_PWD 6
81 #define HII_KEY_ID_SECURE_ERASE 7
82 #define HII_KEY_ID_REVERT 8
83 #define HII_KEY_ID_KEEP_USER_DATA 9
84 #define HII_KEY_ID_PSID_REVERT 0xA
85 #define HII_KEY_ID_DISABLE_USER 0xB
86 #define HII_KEY_ID_ENABLE_FEATURE 0xC
87
88 #define HII_KEY_ID_MAX 0xC // !!Update each time a new ID is added!!
89
90 #define HII_KEY_WITH_INDEX(id, index) \
91 ( \
92 HII_KEY_FLAG | \
93 (id) | \
94 ((index) << HII_KEY_ID_BITS) \
95 )
96
97 #define HII_KEY(id) HII_KEY_WITH_INDEX(id, 0)
98
99 #define PACKAGE_LIST_GUID { 0xf0308176, 0x9058, 0x4153, { 0x93, 0x3d, 0xda, 0x2f, 0xdc, 0xc8, 0x3e, 0x44 } }
100
101 /* {410483CF-F4F9-4ece-848A-1958FD31CEB7} */
102 #define SETUP_FORMSET_GUID { 0x410483cf, 0xf4f9, 0x4ece, { 0x84, 0x8a, 0x19, 0x58, 0xfd, 0x31, 0xce, 0xb7 } }
103
104 // {BBF1ACD2-28D8-44ea-A291-58A237FEDF1A}
105 #define SETUP_VARIABLE_GUID { 0xbbf1acd2, 0x28d8, 0x44ea, { 0xa2, 0x91, 0x58, 0xa2, 0x37, 0xfe, 0xdf, 0x1a } }
106
107 #endif //_HII_FORM_VALUES_H_