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