Home | History | Annotate | Download | only in OpalPasswordDxe
      1 /** @file
      2   Defines Opal HII form ids, structures and values.
      3 
      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
      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 // Maximum Opal password Length
     20 #define MAX_PASSWORD_CHARACTER_LENGTH                      0x14
     21 
     22 // PSID Length
     23 #define PSID_CHARACTER_LENGTH                              0x20
     24 #define PSID_CHARACTER_STRING_END_LENGTH                   0x21
     25 
     26 // ID's for various forms that will be used by HII
     27 #define FORMID_VALUE_MAIN_MENU                             0x01
     28 #define FORMID_VALUE_DISK_INFO_FORM_MAIN                   0x02
     29 #define FORMID_VALUE_DISK_ACTION_FORM                      0x03
     30 
     31 // Structure defining the OPAL_HII_CONFIGURATION
     32 #pragma pack(1)
     33 typedef struct {
     34     UINT8   NumDisks;
     35     UINT8   SelectedDiskIndex;
     36     UINT8   SelectedAction;
     37     UINT16  SelectedDiskAvailableActions;
     38     UINT16  SupportedDisks;
     39     UINT8   KeepUserData;
     40     UINT16  AvailableFields;
     41     UINT16  Password[MAX_PASSWORD_CHARACTER_LENGTH];
     42     UINT16  Psid[PSID_CHARACTER_STRING_END_LENGTH];
     43     UINT8   EnableBlockSid;
     44 } OPAL_HII_CONFIGURATION;
     45 #pragma pack()
     46 
     47 /* Action Flags */
     48 #define HII_ACTION_NONE                                        0x0000
     49 #define HII_ACTION_LOCK                                        0x0001
     50 #define HII_ACTION_UNLOCK                                      0x0002
     51 #define HII_ACTION_SET_ADMIN_PWD                               0x0004
     52 #define HII_ACTION_SET_USER_PWD                                0x0008
     53 #define HII_ACTION_SECURE_ERASE                                0x0010
     54 #define HII_ACTION_PSID_REVERT                                 0x0020
     55 #define HII_ACTION_DISABLE_USER                                0x0040
     56 #define HII_ACTION_REVERT                                      0x0080
     57 #define HII_ACTION_DISABLE_FEATURE                             0x0100
     58 #define HII_ACTION_ENABLE_FEATURE                              0x0200
     59 
     60 /* Flags for diskActionAvailableFields */
     61 #define HII_FIELD_PASSWORD                      0x0001
     62 #define HII_FIELD_PSID                          0x0002
     63 #define HII_FIELD_KEEP_USER_DATA                0x0004
     64 #define HII_FIELD_KEEP_USER_DATA_FORCED         0x0008
     65 
     66 /* Number of bits allocated for each part of a unique key for an HII_ITEM
     67  * all bits together must be <= 16 (EFI_QUESTION_ID is UINT16)
     68  * 1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
     69  * |   |-----------------------|   |---------------------------|
     70  * FLG INDEX                       ID
     71  */
     72 #define HII_KEY_ID_BITS                                     8
     73 #define HII_KEY_INDEX_BITS                                  7
     74 #define HII_KEY_FLAG_BITS                                   1
     75 
     76 #define HII_KEY_FLAG                                        0x8000 // bit 15 (zero based)
     77 
     78 /***********/
     79 /* Key IDs */
     80 /***********/
     81 
     82 #define HII_KEY_ID_GOTO_MAIN_MENU                       0
     83 #define HII_KEY_ID_GOTO_DISK_INFO                       1
     84 #define HII_KEY_ID_GOTO_LOCK                            2
     85 #define HII_KEY_ID_GOTO_UNLOCK                          3
     86 #define HII_KEY_ID_GOTO_SET_ADMIN_PWD                   4
     87 #define HII_KEY_ID_GOTO_SET_USER_PWD                    5
     88 #define HII_KEY_ID_GOTO_SECURE_ERASE                    6
     89 #define HII_KEY_ID_GOTO_PSID_REVERT                     7
     90 #define HII_KEY_ID_GOTO_REVERT                          8
     91 #define HII_KEY_ID_GOTO_DISABLE_USER                    9
     92 #define HII_KEY_ID_GOTO_ENABLE_FEATURE                  0xA //10
     93 #define HII_KEY_ID_GOTO_CONFIRM_TO_MAIN_MENU            0xB //11
     94 #define HII_KEY_ID_ENTER_PASSWORD                       0xC //12
     95 #define HII_KEY_ID_ENTER_PSID                           0xD //13
     96 #define HII_KEY_ID_VAR_SUPPORTED_DISKS                  0xE //14
     97 #define HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS  0xF //15
     98 
     99 #define HII_KEY_ID_BLOCKSID                             0x17 //23
    100 #define HII_KEY_ID_MAX                                  0x17 //23 // !!Update each time a new ID is added!!
    101 
    102 #define HII_KEY_WITH_INDEX(id, index) \
    103     ( \
    104         HII_KEY_FLAG | \
    105         (id) | \
    106         ((index) << HII_KEY_ID_BITS) \
    107     )
    108 
    109 #define HII_KEY(id) HII_KEY_WITH_INDEX(id, 0)
    110 
    111 #define PACKAGE_LIST_GUID { 0xf0308176, 0x9058, 0x4153, { 0x93, 0x3d, 0xda, 0x2f, 0xdc, 0xc8, 0x3e, 0x44 } }
    112 
    113 /* {410483CF-F4F9-4ece-848A-1958FD31CEB7} */
    114 #define SETUP_FORMSET_GUID { 0x410483cf, 0xf4f9, 0x4ece, { 0x84, 0x8a, 0x19, 0x58, 0xfd, 0x31, 0xce, 0xb7 } }
    115 
    116 // {BBF1ACD2-28D8-44ea-A291-58A237FEDF1A}
    117 #define SETUP_VARIABLE_GUID { 0xbbf1acd2, 0x28d8, 0x44ea, { 0xa2, 0x91, 0x58, 0xa2, 0x37, 0xfe, 0xdf, 0x1a } }
    118 
    119 #endif //_HII_FORM_VALUES_H_
    120 
    121