1 /** @file 2 Opal Specification defined values and structures. 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 #ifndef _TCG_STORAGE_OPAL_H_ 16 #define _TCG_STORAGE_OPAL_H_ 17 18 #include <IndustryStandard/TcgStorageCore.h> 19 20 #define OPAL_UID_ADMIN_SP TCG_TO_UID(0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x01) 21 #define OPAL_UID_ADMIN_SP_C_PIN_MSID TCG_TO_UID(0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x84, 0x02) 22 #define OPAL_UID_ADMIN_SP_C_PIN_SID TCG_TO_UID(0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01) 23 #define OPAL_UID_LOCKING_SP TCG_TO_UID(0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x02) 24 25 // ADMIN_SP 26 // Authorities 27 #define OPAL_ADMIN_SP_ANYBODY_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01) 28 #define OPAL_ADMIN_SP_ADMINS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02) 29 #define OPAL_ADMIN_SP_MAKERS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03) 30 #define OPAL_ADMIN_SP_SID_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06) 31 #define OPAL_ADMIN_SP_ADMIN1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x02, 0x01) 32 #define OPAL_ADMIN_SP_PSID_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0xFF, 0x01) 33 34 #define OPAL_ADMIN_SP_ACTIVATE_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x03) 35 #define OPAL_ADMIN_SP_REVERT_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x02) 36 37 38 // LOCKING SP 39 // Authorities 40 #define OPAL_LOCKING_SP_ANYBODY_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01) 41 #define OPAL_LOCKING_SP_ADMINS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02) 42 #define OPAL_LOCKING_SP_ADMIN1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x01) 43 #define OPAL_LOCKING_SP_USERS_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x03, 0x00, 0x00) 44 #define OPAL_LOCKING_SP_USER1_AUTHORITY TCG_TO_UID(0x00, 0x00, 0x00, 0x09, 0x00, 0x03, 0x00, 0x01) 45 46 #define OPAL_LOCKING_SP_REVERTSP_METHOD TCG_TO_UID(0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11) 47 48 // C_PIN Table Rows 49 #define OPAL_LOCKING_SP_C_PIN_ADMIN1 TCG_TO_UID( 0x00, 0x00, 0x00, 0x0B, 0x00, 0x01, 0x00, 0x01 ) 50 #define OPAL_LOCKING_SP_C_PIN_USER1 TCG_TO_UID( 0x00, 0x00, 0x00, 0x0B, 0x00, 0x03, 0x00, 0x01 ) 51 52 // Locking Table 53 #define OPAL_LOCKING_SP_LOCKING_GLOBALRANGE TCG_TO_UID( 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x01 ) 54 #define OPAL_LOCKING_SP_LOCKING_RANGE1 TCG_TO_UID( 0x00, 0x00, 0x08, 0x02, 0x00, 0x03, 0x00, 0x01 ) 55 56 57 // LOCKING SP ACE Table Preconfiguration 58 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_GET_ALL TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xD0, 0x00 ) 59 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_RDLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE0, 0x00 ) 60 #define OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_WRLOCKED TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xE8, 0x00 ) 61 62 #define OPAL_LOCKING_SP_ACE_K_AES_256_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB8, 0x00 ) 63 #define OPAL_LOCKING_SP_ACE_K_AES_128_GLOBALRANGE_GENKEY TCG_TO_UID( 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0xB0, 0x00 ) 64 65 66 // LOCKING SP LockingInfo Table Preconfiguration 67 #define OPAL_LOCKING_SP_LOCKING_INFO TCG_TO_UID( 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01 ) 68 69 #define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTREQUIRED_COL 0x7 70 #define OPAL_LOCKING_SP_LOCKINGINFO_LOGICALBLOCKSIZE_COL 0x8 71 #define OPAL_LOCKING_SP_LOCKINGINFO_ALIGNMENTGRANULARITY_COL 0x9 72 #define OPAL_LOCKING_SP_LOCKINGINFO_LOWESTALIGNEDLBA_COL 0xA 73 74 // K_AES_256 Table Preconfiguration 75 #define OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x00, 0x01 ) 76 77 // K_AES_128 Table Preconfiguration 78 #define OPAL_LOCKING_SP_K_AES_128_GLOBALRANGE_KEY TCG_TO_UID( 0x00, 0x00, 0x08, 0x05, 0x00, 0x00, 0x00, 0x01 ) 79 80 // Minimum Properties that an Opal Compliant SD Shall support 81 #define OPAL_MIN_MAX_COM_PACKET_SIZE 2048 82 #define OPAL_MIN_MAX_REPONSE_COM_PACKET_SIZE 2048 83 #define OPAL_MIN_MAX_PACKET_SIZE 2028 84 #define OPAL_MIN_MAX_IND_TOKEN_SIZE 1992 85 #define OPAL_MIN_MAX_PACKETS 1 86 #define OPAL_MIN_MAX_SUBPACKETS 1 87 #define OPAL_MIN_MAX_METHODS 1 88 #define OPAL_MIN_MAX_SESSIONS 1 89 #define OPAL_MIN_MAX_AUTHENTICATIONS 2 90 #define OPAL_MIN_MAX_TRANSACTION_LIMIT 1 91 92 #define OPAL_ADMIN_SP_PIN_COL 3 93 #define OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL 5 94 #define OPAL_RANDOM_METHOD_MAX_COUNT_SIZE 32 95 96 #pragma pack(1) 97 98 typedef struct _OPAL_GEOMETRY_REPORTING_FEATURE { 99 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 100 UINT8 Reserved[8]; 101 UINT32 LogicalBlockSizeBE; 102 UINT64 AlignmentGranularityBE; 103 UINT64 LowestAlignedLBABE; 104 } OPAL_GEOMETRY_REPORTING_FEATURE; 105 106 typedef struct _OPAL_SINGLE_USER_MODE_FEATURE { 107 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 108 UINT32 NumLockingObjectsSupportedBE; 109 UINT8 Any : 1; 110 UINT8 All : 1; 111 UINT8 Policy : 1; 112 UINT8 Reserved : 5; 113 UINT8 Reserved2[7]; 114 } OPAL_SINGLE_USER_MODE_FEATURE; 115 116 typedef struct _OPAL_DATASTORE_TABLE_FEATURE { 117 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 118 UINT16 Reserved; 119 UINT16 MaxNumTablesBE; 120 UINT32 MaxTotalSizeBE; 121 UINT32 SizeAlignmentBE; 122 } OPAL_DATASTORE_TABLE_FEATURE; 123 124 typedef struct _OPAL_SSCV1_FEATURE_DESCRIPTOR { 125 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 126 UINT16 BaseComdIdBE; 127 UINT16 NumComIdsBE; 128 UINT8 RangeCrossing : 1; 129 UINT8 Reserved : 7; 130 UINT8 Future[11]; 131 } OPAL_SSCV1_FEATURE_DESCRIPTOR; 132 133 typedef struct _OPAL_SSCV2_FEATURE_DESCRIPTOR { 134 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 135 UINT16 BaseComdIdBE; 136 UINT16 NumComIdsBE; 137 UINT8 Reserved; 138 UINT16 NumLockingSpAdminAuthoritiesSupportedBE; 139 UINT16 NumLockingSpUserAuthoritiesSupportedBE; 140 UINT8 InitialCPINSIDPIN; 141 UINT8 CPINSIDPINRevertBehavior; 142 UINT8 Future[5]; 143 } OPAL_SSCV2_FEATURE_DESCRIPTOR; 144 145 typedef struct _OPAL_SSCLITE_FEATURE_DESCRIPTOR { 146 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 147 UINT16 BaseComdIdBE; 148 UINT16 NumComIdsBE; 149 UINT8 Reserved[5]; 150 UINT8 InitialCPINSIDPIN; 151 UINT8 CPINSIDPINRevertBehavior; 152 UINT8 Future[5]; 153 } OPAL_SSCLITE_FEATURE_DESCRIPTOR; 154 155 typedef struct _PYRITE_SSC_FEATURE_DESCRIPTOR { 156 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER Header; 157 UINT16 BaseComdIdBE; 158 UINT16 NumComIdsBE; 159 UINT8 Reserved[5]; 160 UINT8 InitialCPINSIDPIN; 161 UINT8 CPINSIDPINRevertBehavior; 162 UINT8 Future[5]; 163 } PYRITE_SSC_FEATURE_DESCRIPTOR; 164 165 typedef union { 166 TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER CommonHeader; 167 TCG_TPER_FEATURE_DESCRIPTOR Tper; 168 TCG_LOCKING_FEATURE_DESCRIPTOR Locking; 169 OPAL_GEOMETRY_REPORTING_FEATURE Geometry; 170 OPAL_SINGLE_USER_MODE_FEATURE SingleUser; 171 OPAL_DATASTORE_TABLE_FEATURE DataStore; 172 OPAL_SSCV1_FEATURE_DESCRIPTOR OpalSscV1; 173 OPAL_SSCV2_FEATURE_DESCRIPTOR OpalSscV2; 174 OPAL_SSCLITE_FEATURE_DESCRIPTOR OpalSscLite; 175 PYRITE_SSC_FEATURE_DESCRIPTOR PyriteSsc; 176 TCG_BLOCK_SID_FEATURE_DESCRIPTOR BlockSid; 177 } OPAL_LEVEL0_FEATURE_DESCRIPTOR; 178 179 #pragma pack() 180 181 #endif // _OPAL_H_ 182