]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiFormValues.h
SecurityPkg OpalPasswordDxe: Change BlockSid position.
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPasswordDxe / OpalHiiFormValues.h
CommitLineData
a06875e1
ED
1/** @file\r
2 Defines Opal HII form ids, structures and values.\r
3\r
4Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15\r
16#ifndef _OPAL_HII_FORM_VALUES_H_\r
17#define _OPAL_HII_FORM_VALUES_H_\r
18\r
19// Maximum Opal password Length\r
20#define MAX_PASSWORD_CHARACTER_LENGTH 0x14\r
21\r
22// PSID Length\r
23#define PSID_CHARACTER_LENGTH 0x20\r
24\r
25// ID's for various forms that will be used by HII\r
26#define FORMID_VALUE_MAIN_MENU 0x01\r
27#define FORMID_VALUE_DISK_INFO_FORM_MAIN 0x02\r
28#define FORMID_VALUE_DISK_ACTION_FORM 0x03\r
29\r
30// Structure defining the OPAL_HII_CONFIGURATION\r
31#pragma pack(1)\r
32typedef struct {\r
33 UINT8 NumDisks;\r
34 UINT8 SelectedDiskIndex;\r
35 UINT8 SelectedAction;\r
36 UINT16 SelectedDiskAvailableActions;\r
37 UINT16 SupportedDisks;\r
38 UINT8 KeepUserData;\r
39 UINT16 AvailableFields;\r
40 UINT16 Password[MAX_PASSWORD_CHARACTER_LENGTH];\r
41 UINT16 Psid[PSID_CHARACTER_LENGTH];\r
42 UINT8 EnableBlockSid;\r
43} OPAL_HII_CONFIGURATION;\r
44#pragma pack()\r
45\r
46/* Action Flags */\r
47#define HII_ACTION_NONE 0x0000\r
48#define HII_ACTION_LOCK 0x0001\r
49#define HII_ACTION_UNLOCK 0x0002\r
50#define HII_ACTION_SET_ADMIN_PWD 0x0004\r
51#define HII_ACTION_SET_USER_PWD 0x0008\r
52#define HII_ACTION_SECURE_ERASE 0x0010\r
53#define HII_ACTION_PSID_REVERT 0x0020\r
54#define HII_ACTION_DISABLE_USER 0x0040\r
55#define HII_ACTION_REVERT 0x0080\r
56#define HII_ACTION_DISABLE_FEATURE 0x0100\r
57#define HII_ACTION_ENABLE_FEATURE 0x0200\r
a06875e1
ED
58\r
59/* Flags for diskActionAvailableFields */\r
60#define HII_FIELD_PASSWORD 0x0001\r
61#define HII_FIELD_PSID 0x0002\r
62#define HII_FIELD_KEEP_USER_DATA 0x0004\r
63#define HII_FIELD_KEEP_USER_DATA_FORCED 0x0008\r
64\r
65/* Number of bits allocated for each part of a unique key for an HII_ITEM\r
66 * all bits together must be <= 16 (EFI_QUESTION_ID is UINT16)\r
67 * 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\r
68 * | |-----------------------| |---------------------------|\r
69 * FLG INDEX ID\r
70 */\r
71#define HII_KEY_ID_BITS 8\r
72#define HII_KEY_INDEX_BITS 7\r
73#define HII_KEY_FLAG_BITS 1\r
74\r
75#define HII_KEY_FLAG 0x8000 // bit 15 (zero based)\r
76\r
77/***********/\r
78/* Key IDs */\r
79/***********/\r
80\r
81#define HII_KEY_ID_GOTO_MAIN_MENU 0\r
82#define HII_KEY_ID_GOTO_DISK_INFO 1\r
83#define HII_KEY_ID_GOTO_LOCK 2\r
84#define HII_KEY_ID_GOTO_UNLOCK 3\r
85#define HII_KEY_ID_GOTO_SET_ADMIN_PWD 4\r
86#define HII_KEY_ID_GOTO_SET_USER_PWD 5\r
87#define HII_KEY_ID_GOTO_SECURE_ERASE 6\r
88#define HII_KEY_ID_GOTO_PSID_REVERT 7\r
89#define HII_KEY_ID_GOTO_REVERT 8\r
90#define HII_KEY_ID_GOTO_DISABLE_USER 9\r
91#define HII_KEY_ID_GOTO_ENABLE_FEATURE 0xA //10\r
92#define HII_KEY_ID_GOTO_CONFIRM_TO_MAIN_MENU 0xB //11\r
93#define HII_KEY_ID_ENTER_PASSWORD 0xC //12\r
94#define HII_KEY_ID_ENTER_PSID 0xD //13\r
95#define HII_KEY_ID_VAR_SUPPORTED_DISKS 0xE //14\r
96#define HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS 0xF //15\r
97\r
98#define HII_KEY_ID_BLOCKSID 0x17 //23\r
99#define HII_KEY_ID_MAX 0x17 //23 // !!Update each time a new ID is added!!\r
100\r
101#define HII_KEY_WITH_INDEX(id, index) \\r
102 ( \\r
103 HII_KEY_FLAG | \\r
104 (id) | \\r
105 ((index) << HII_KEY_ID_BITS) \\r
106 )\r
107\r
108#define HII_KEY(id) HII_KEY_WITH_INDEX(id, 0)\r
109\r
110#define PACKAGE_LIST_GUID { 0xf0308176, 0x9058, 0x4153, { 0x93, 0x3d, 0xda, 0x2f, 0xdc, 0xc8, 0x3e, 0x44 } }\r
111\r
112/* {410483CF-F4F9-4ece-848A-1958FD31CEB7} */\r
113#define SETUP_FORMSET_GUID { 0x410483cf, 0xf4f9, 0x4ece, { 0x84, 0x8a, 0x19, 0x58, 0xfd, 0x31, 0xce, 0xb7 } }\r
114\r
115// {BBF1ACD2-28D8-44ea-A291-58A237FEDF1A}\r
116#define SETUP_VARIABLE_GUID { 0xbbf1acd2, 0x28d8, 0x44ea, { 0xa2, 0x91, 0x58, 0xa2, 0x37, 0xfe, 0xdf, 0x1a } }\r
117\r
118#endif //_HII_FORM_VALUES_H_\r
119\r