]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/IndustryStandard/Tpm12.h
MdePkg: add missing #defines for decoding PCIe 2.1 extended capability structures
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Tpm12.h
index eca5eec32717387d363501c3c4f30dbdf17e9f7d..5bcc16ca7e3cef3b28d008860104a17346ceb8af 100644 (file)
@@ -1,9 +1,9 @@
 /** @file   \r
-  TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)\r
+  TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103)\r
   See http://trustedcomputinggroup.org for latest specification updates\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials                          \r
+  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   http://opensource.org/licenses/bsd-license.php                                            \r
@@ -19,7 +19,7 @@
 ///\r
 /// The start of TPM return codes\r
 ///\r
-#define TPM_BASE                    (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))\r
+#define TPM_BASE                    0\r
 \r
 //\r
 // All structures MUST be packed on a byte boundary.\r
 //\r
 // Part 2, section 2.2.3: Helper redefinitions\r
 //\r
+///\r
+/// Indicates the conditions where it is required that authorization be presented\r
+///\r
 typedef UINT8                       TPM_AUTH_DATA_USAGE;\r
+///\r
+/// The information as to what the payload is in an encrypted structure\r
+///\r
 typedef UINT8                       TPM_PAYLOAD_TYPE;\r
+///\r
+/// The version info breakdown\r
+///\r
 typedef UINT8                       TPM_VERSION_BYTE;\r
+///\r
+/// The state of the dictionary attack mitigation logic\r
+///\r
+typedef UINT8                       TPM_DA_STATE;\r
+///\r
+/// The request or response authorization type\r
+///\r
 typedef UINT16                      TPM_TAG;\r
+///\r
+/// The protocol in use\r
+///\r
 typedef UINT16                      TPM_PROTOCOL_ID;\r
+///\r
+/// Indicates the start state\r
+///\r
 typedef UINT16                      TPM_STARTUP_TYPE;\r
+///\r
+/// The definition of the encryption scheme\r
+///\r
 typedef UINT16                      TPM_ENC_SCHEME;\r
+///\r
+/// The definition of the signature scheme\r
+///\r
 typedef UINT16                      TPM_SIG_SCHEME;\r
+///\r
+/// The definition of the migration scheme\r
+///\r
 typedef UINT16                      TPM_MIGRATE_SCHEME;\r
+///\r
+/// Sets the state of the physical presence mechanism\r
+///\r
 typedef UINT16                      TPM_PHYSICAL_PRESENCE;\r
+///\r
+/// Indicates the types of entity that are supported by the TPM\r
+///\r
 typedef UINT16                      TPM_ENTITY_TYPE;\r
+///\r
+/// Indicates the permitted usage of the key\r
+///\r
 typedef UINT16                      TPM_KEY_USAGE;\r
+///\r
+/// The type of asymmetric encrypted structure in use by the endorsement key\r
+///\r
 typedef UINT16                      TPM_EK_TYPE;\r
+///\r
+/// The tag for the structure\r
+///\r
 typedef UINT16                      TPM_STRUCTURE_TAG;\r
+///\r
+/// The platform specific spec to which the information relates to\r
+///\r
 typedef UINT16                      TPM_PLATFORM_SPECIFIC;\r
+///\r
+/// The command ordinal\r
+///\r
 typedef UINT32                      TPM_COMMAND_CODE;\r
+///\r
+/// Identifies a TPM capability area\r
+///\r
 typedef UINT32                      TPM_CAPABILITY_AREA;\r
+///\r
+/// Indicates information regarding a key\r
+///\r
 typedef UINT32                      TPM_KEY_FLAGS;\r
+///\r
+/// Indicates the type of algorithm\r
+///\r
 typedef UINT32                      TPM_ALGORITHM_ID;\r
+///\r
+/// The locality modifier\r
+///\r
 typedef UINT32                      TPM_MODIFIER_INDICATOR;\r
+///\r
+/// The actual number of a counter\r
+///\r
 typedef UINT32                      TPM_ACTUAL_COUNT;\r
+///\r
+/// Attributes that define what options are in use for a transport session\r
+///\r
 typedef UINT32                      TPM_TRANSPORT_ATTRIBUTES;\r
+///\r
+/// Handle to an authorization session\r
+///\r
 typedef UINT32                      TPM_AUTHHANDLE;\r
+///\r
+/// Index to a DIR register\r
+///\r
 typedef UINT32                      TPM_DIRINDEX;\r
+///\r
+/// The area where a key is held assigned by the TPM\r
+///\r
 typedef UINT32                      TPM_KEY_HANDLE;\r
+///\r
+/// Index to a PCR register\r
+///\r
 typedef UINT32                      TPM_PCRINDEX;\r
+///\r
+/// The return code from a function\r
+///\r
 typedef UINT32                      TPM_RESULT;\r
+///\r
+/// The types of resources that a TPM may have using internal resources\r
+///\r
 typedef UINT32                      TPM_RESOURCE_TYPE;\r
+///\r
+/// Allows for controlling of the key when loaded and how to handle TPM_Startup issues\r
+///\r
 typedef UINT32                      TPM_KEY_CONTROL;\r
+///\r
+/// The index into the NV storage area\r
+///\r
 typedef UINT32                      TPM_NV_INDEX;\r
+///\r
+/// The family ID. Family IDs are automatically assigned a sequence number by the TPM. \r
+/// A trusted process can set the FamilyID value in an individual row to NULL, which \r
+/// invalidates that row. The family ID resets to NULL on each change of TPM Owner.\r
+///\r
 typedef UINT32                      TPM_FAMILY_ID;\r
+///\r
+/// IA value used as a label for the most recent verification of this family. Set to zero when not in use.\r
+///\r
 typedef UINT32                      TPM_FAMILY_VERIFICATION;\r
+///\r
+/// How the TPM handles var\r
+///\r
 typedef UINT32                      TPM_STARTUP_EFFECTS;\r
+///\r
+/// The mode of a symmetric encryption\r
+///\r
 typedef UINT32                      TPM_SYM_MODE;\r
+///\r
+/// The family flags\r
+///\r
 typedef UINT32                      TPM_FAMILY_FLAGS;\r
+///\r
+/// The index value for the delegate NV table\r
+///\r
 typedef UINT32                      TPM_DELEGATE_INDEX;\r
+///\r
+/// The restrictions placed on delegation of CMK commands\r
+///\r
 typedef UINT32                      TPM_CMK_DELEGATE;\r
+///\r
+/// The ID value of a monotonic counter\r
+///\r
 typedef UINT32                      TPM_COUNT_ID;\r
+///\r
+/// A command to execute\r
+///\r
 typedef UINT32                      TPM_REDIT_COMMAND;\r
+///\r
+/// A transport session handle\r
+///\r
 typedef UINT32                      TPM_TRANSHANDLE;\r
+///\r
+/// A generic handle could be key, transport etc\r
+///\r
 typedef UINT32                      TPM_HANDLE;\r
+///\r
+/// What operation is happening\r
+///\r
 typedef UINT32                      TPM_FAMILY_OPERATION;\r
 \r
 //\r
@@ -138,6 +270,9 @@ typedef UINT32                      TPM_FAMILY_OPERATION;
 #define TPM_TAG_CMK_SIGTICKET       ((TPM_STRUCTURE_TAG) 0x0034)\r
 #define TPM_TAG_CMK_MA_APPROVAL     ((TPM_STRUCTURE_TAG) 0x0035)\r
 #define TPM_TAG_QUOTE_INFO2         ((TPM_STRUCTURE_TAG) 0x0036)\r
+#define TPM_TAG_DA_INFO             ((TPM_STRUCTURE_TAG) 0x0037)\r
+#define TPM_TAG_DA_LIMITED          ((TPM_STRUCTURE_TAG) 0x0038)\r
+#define TPM_TAG_DA_ACTION_TYPE      ((TPM_STRUCTURE_TAG) 0x0039)\r
 \r
 //\r
 // Part 2, section 4: TPM Types\r
@@ -184,6 +319,7 @@ typedef UINT32                      TPM_FAMILY_OPERATION;
 #define TPM_ET_DEL_KEY_BLOB         ((UINT16) 0x0009) ///< The entity is a delegate key blob\r
 #define TPM_ET_COUNTER              ((UINT16) 0x000A) ///< The entity is a counter\r
 #define TPM_ET_NV                   ((UINT16) 0x000B) ///< The entity is a NV index\r
+#define TPM_ET_OPERATOR             ((UINT16) 0x000C) ///< The entity is the operator\r
 #define TPM_ET_RESERVED_HANDLE      ((UINT16) 0x0040) ///< Reserved. This value avoids collisions with the handle MSB setting.\r
 //\r
 // TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable\r
@@ -302,24 +438,38 @@ typedef struct tdTPM_VERSION {
 } TPM_VERSION;\r
 \r
 \r
-///\r
-/// Part 2, section 5.4: TPM_DIGEST\r
-///\r
 #define TPM_SHA1_160_HASH_LEN       0x14\r
 #define TPM_SHA1BASED_NONCE_LEN     TPM_SHA1_160_HASH_LEN\r
 \r
+///\r
+/// Part 2, section 5.4: TPM_DIGEST\r
+///\r
 typedef struct tdTPM_DIGEST{\r
   UINT8                             digest[TPM_SHA1_160_HASH_LEN];\r
 } TPM_DIGEST;\r
 \r
+///\r
+/// This SHALL be the digest of the chosen identityLabel and privacyCA for a new TPM identity\r
+///\r
 typedef TPM_DIGEST                  TPM_CHOSENID_HASH;\r
+///\r
+/// This SHALL be the hash of a list of PCR indexes and PCR values that a key or data is bound to\r
+///\r
 typedef TPM_DIGEST                  TPM_COMPOSITE_HASH;\r
+///\r
+/// This SHALL be the value of a DIR register\r
+///\r
 typedef TPM_DIGEST                  TPM_DIRVALUE;\r
+\r
 typedef TPM_DIGEST                  TPM_HMAC;\r
+///\r
+/// The value inside of the PCR\r
+///\r
 typedef TPM_DIGEST                  TPM_PCRVALUE;\r
+///\r
+/// This SHALL be the value of the current internal audit state\r
+///\r
 typedef TPM_DIGEST                  TPM_AUDITDIGEST;\r
-typedef TPM_DIGEST                  TPM_DAA_TPM_SEED;\r
-typedef TPM_DIGEST                  TPM_DAA_CONTEXT_SEED;\r
 \r
 ///\r
 /// Part 2, section 5.5: TPM_NONCE\r
@@ -328,12 +478,33 @@ typedef struct tdTPM_NONCE{
   UINT8                             nonce[20];\r
 } TPM_NONCE;\r
 \r
+///\r
+/// This SHALL be a random value generated by a TPM immediately after the EK is installed\r
+/// in that TPM, whenever an EK is installed in that TPM\r
+///\r
+typedef TPM_NONCE                  TPM_DAA_TPM_SEED;\r
+///\r
+/// This SHALL be a random value\r
+///\r
+typedef TPM_NONCE                  TPM_DAA_CONTEXT_SEED;\r
+\r
 //\r
 // Part 2, section 5.6: TPM_AUTHDATA\r
 //\r
+///\r
+/// The AuthData data is the information that is saved or passed to provide proof of ownership\r
+/// 296 of an entity\r
+///\r
 typedef UINT8                       tdTPM_AUTHDATA[20];\r
+\r
 typedef tdTPM_AUTHDATA              TPM_AUTHDATA;\r
+///\r
+/// A secret plaintext value used in the authorization process\r
+///\r
 typedef TPM_AUTHDATA                TPM_SECRET;\r
+///\r
+/// A ciphertext (encrypted) version of AuthData data. The encryption mechanism depends on the context\r
+///\r
 typedef TPM_AUTHDATA                TPM_ENCAUTH;\r
 \r
 ///\r
@@ -395,7 +566,8 @@ typedef struct tdTPM_KEY_HANDLE_LIST {
 #define TPM_ES_NONE                 ((TPM_ENC_SCHEME) 0x0001)\r
 #define TPM_ES_RSAESPKCSv15         ((TPM_ENC_SCHEME) 0x0002)\r
 #define TPM_ES_RSAESOAEP_SHA1_MGF1  ((TPM_ENC_SCHEME) 0x0003)\r
-#define TPM_ES_SYM_CNT              ((TPM_ENC_SCHEME) 0x0004)\r
+#define TPM_ES_SYM_CNT              ((TPM_ENC_SCHEME) 0x0004)  ///< rev94 defined\r
+#define TPM_ES_SYM_CTR              ((TPM_ENC_SCHEME) 0x0004)\r
 #define TPM_ES_SYM_OFB              ((TPM_ENC_SCHEME) 0x0005)\r
 \r
 #define TPM_SS_NONE                 ((TPM_SIG_SCHEME) 0x0001)\r
@@ -586,6 +758,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
   BOOLEAN                           readSRKPub;\r
   BOOLEAN                           tpmEstablished;\r
   BOOLEAN                           maintenanceDone;\r
+  BOOLEAN                           disableFullDALogicInfo;\r
 } TPM_PERMANENT_FLAGS;\r
 \r
 //\r
@@ -610,6 +783,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
 #define TPM_PF_READSRKPUB                   ((TPM_CAPABILITY_AREA) 17)\r
 #define TPM_PF_TPMESTABLISHED               ((TPM_CAPABILITY_AREA) 18)\r
 #define TPM_PF_MAINTENANCEDONE              ((TPM_CAPABILITY_AREA) 19)\r
+#define TPM_PF_DISABLEFULLDALOGICINFO       ((TPM_CAPABILITY_AREA) 20)\r
 \r
 ///\r
 /// Part 2, section 7.2: TPM_STCLEAR_FLAGS\r
@@ -655,6 +829,75 @@ typedef struct tdTPM_STANY_FLAGS{
 // All those structures defined in section 7.4, 7.5, 7.6 are not normative and \r
 // thus no definitions here\r
 //\r
+// Part 2, section 7.4: TPM_PERMANENT_DATA\r
+//\r
+#define TPM_MIN_COUNTERS            4   ///< the minimum number of counters is 4\r
+#define TPM_DELEGATE_KEY            TPM_KEY\r
+#define TPM_NUM_PCR                 16\r
+#define TPM_MAX_NV_WRITE_NOOWNER    64\r
+\r
+//\r
+// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability\r
+//\r
+#define TPM_PD_REVMAJOR               ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_PD_REVMINOR               ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_PD_TPMPROOF               ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_PD_OWNERAUTH              ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_PD_OPERATORAUTH           ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_PD_MANUMAINTPUB           ((TPM_CAPABILITY_AREA) 6)\r
+#define TPM_PD_ENDORSEMENTKEY         ((TPM_CAPABILITY_AREA) 7)\r
+#define TPM_PD_SRK                    ((TPM_CAPABILITY_AREA) 8)\r
+#define TPM_PD_DELEGATEKEY            ((TPM_CAPABILITY_AREA) 9)\r
+#define TPM_PD_CONTEXTKEY             ((TPM_CAPABILITY_AREA) 10)\r
+#define TPM_PD_AUDITMONOTONICCOUNTER  ((TPM_CAPABILITY_AREA) 11)\r
+#define TPM_PD_MONOTONICCOUNTER       ((TPM_CAPABILITY_AREA) 12)\r
+#define TPM_PD_PCRATTRIB              ((TPM_CAPABILITY_AREA) 13)\r
+#define TPM_PD_ORDINALAUDITSTATUS     ((TPM_CAPABILITY_AREA) 14)\r
+#define TPM_PD_AUTHDIR                ((TPM_CAPABILITY_AREA) 15)\r
+#define TPM_PD_RNGSTATE               ((TPM_CAPABILITY_AREA) 16)\r
+#define TPM_PD_FAMILYTABLE            ((TPM_CAPABILITY_AREA) 17)\r
+#define TPM_DELEGATETABLE             ((TPM_CAPABILITY_AREA) 18)\r
+#define TPM_PD_EKRESET                ((TPM_CAPABILITY_AREA) 19)\r
+#define TPM_PD_MAXNVBUFSIZE           ((TPM_CAPABILITY_AREA) 20)\r
+#define TPM_PD_LASTFAMILYID           ((TPM_CAPABILITY_AREA) 21)\r
+#define TPM_PD_NOOWNERNVWRITE         ((TPM_CAPABILITY_AREA) 22)\r
+#define TPM_PD_RESTRICTDELEGATE       ((TPM_CAPABILITY_AREA) 23)\r
+#define TPM_PD_TPMDAASEED             ((TPM_CAPABILITY_AREA) 24)\r
+#define TPM_PD_DAAPROOF               ((TPM_CAPABILITY_AREA) 25)\r
+\r
+///\r
+/// Part 2, section 7.5: TPM_STCLEAR_DATA\r
+///   available inside TPM only\r
+///\r
+ typedef struct tdTPM_STCLEAR_DATA{\r
+   TPM_STRUCTURE_TAG                  tag;\r
+   TPM_NONCE                          contextNonceKey;\r
+   TPM_COUNT_ID                       countID;\r
+   UINT32                             ownerReference;\r
+   BOOLEAN                            disableResetLock;\r
+   TPM_PCRVALUE                       PCR[TPM_NUM_PCR];\r
+   UINT32                             deferredPhysicalPresence;\r
+ }TPM_STCLEAR_DATA;\r
+\r
+//\r
+// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability\r
+//\r
+#define TPM_SD_CONTEXTNONCEKEY            ((TPM_CAPABILITY_AREA)0x00000001)\r
+#define TPM_SD_COUNTID                    ((TPM_CAPABILITY_AREA)0x00000002)\r
+#define TPM_SD_OWNERREFERENCE             ((TPM_CAPABILITY_AREA)0x00000003)\r
+#define TPM_SD_DISABLERESETLOCK           ((TPM_CAPABILITY_AREA)0x00000004)\r
+#define TPM_SD_PCR                        ((TPM_CAPABILITY_AREA)0x00000005)\r
+#define TPM_SD_DEFERREDPHYSICALPRESENCE   ((TPM_CAPABILITY_AREA)0x00000006)\r
+\r
+//\r
+// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability\r
+//\r
+#define TPM_AD_CONTEXTNONCESESSION        ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_AD_AUDITDIGEST                ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_AD_CURRENTTICKS               ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_AD_CONTEXTCOUNT               ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_AD_CONTEXTLIST                ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_AD_SESSIONS                   ((TPM_CAPABILITY_AREA) 6)\r
 \r
 //\r
 // Part 2, section 8: PCR Structures\r
@@ -1052,9 +1295,9 @@ typedef struct tdTPM_TRANSPORT_PUBLIC {
 //\r
 // Part 2, section 13.1.1 TPM_TRANSPORT_ATTRIBUTES Definitions\r
 //\r
-#define TPM_TRANSPORT_ENCRYPT       ((UINT32)0x00000001)\r
-#define TPM_TRANSPORT_LOG           ((UINT32)0x00000002)\r
-#define TPM_TRANSPORT_EXCLUSIVE     ((UINT32)0x00000004)\r
+#define TPM_TRANSPORT_ENCRYPT       ((UINT32)BIT0)\r
+#define TPM_TRANSPORT_LOG           ((UINT32)BIT1)\r
+#define TPM_TRANSPORT_EXCLUSIVE     ((UINT32)BIT2)\r
 \r
 ///\r
 /// Part 2, section 13.2 TPM_TRANSPORT_INTERNAL\r
@@ -1439,18 +1682,12 @@ typedef struct tdTPM_CONTEXT_SENSITIVE {
 #define TPM_NV_INDEX_PERIPHERAL_BASE   ((UINT32)0x00011500)\r
 #define TPM_NV_INDEX_GROUP_RESV_BASE   ((UINT32)0x00010000)\r
 \r
-///\r
-/// The typedefs TPM_NV_PER_ATTRIBUTES (not present in TPM 1.2 Spec. have been added \r
-/// and structure fields that were to hold the following values\r
-///\r
-typedef UINT32 TPM_NV_PER_ATTRIBUTES;\r
-\r
 ///\r
 /// Part 2, section 19.2: TPM_NV_ATTRIBUTES\r
 ///\r
 typedef struct tdTPM_NV_ATTRIBUTES {\r
   TPM_STRUCTURE_TAG               tag;\r
-  TPM_NV_PER_ATTRIBUTES           attributes;\r
+  UINT32                          attributes;\r
 } TPM_NV_ATTRIBUTES;\r
 \r
 #define TPM_NV_PER_READ_STCLEAR        (BIT31)\r
@@ -1484,12 +1721,11 @@ typedef struct tdTPM_NV_DATA_PUBLIC {
 // Part 2, section 20: Delegate Structures\r
 //\r
 \r
-//\r
-// Part 2, section 20.2: Delegate Definitions\r
-//\r
 #define TPM_DEL_OWNER_BITS          ((UINT32)0x00000001)\r
 #define TPM_DEL_KEY_BITS            ((UINT32)0x00000002)\r
-\r
+///\r
+/// Part 2, section 20.2: Delegate Definitions\r
+///\r
 typedef struct tdTPM_DELEGATIONS {\r
   TPM_STRUCTURE_TAG               tag;\r
   UINT32                          delegateType;\r
@@ -1503,7 +1739,9 @@ typedef struct tdTPM_DELEGATIONS {
 #define TPM_DELEGATE_SetOrdinalAuditStatus          (BIT30)\r
 #define TPM_DELEGATE_DirWriteAuth                   (BIT29)\r
 #define TPM_DELEGATE_CMK_ApproveMA                  (BIT28)\r
+#define TPM_DELEGATE_NV_WriteValue                  (BIT27)\r
 #define TPM_DELEGATE_CMK_CreateTicket               (BIT26)\r
+#define TPM_DELEGATE_NV_ReadValue                   (BIT25)\r
 #define TPM_DELEGATE_Delegate_LoadOwnerDelegation   (BIT24)\r
 #define TPM_DELEGATE_DAA_Join                       (BIT23)\r
 #define TPM_DELEGATE_AuthorizeMigrationKey          (BIT22)\r
@@ -1514,6 +1752,7 @@ typedef struct tdTPM_DELEGATIONS {
 #define TPM_DELEGATE_ResetLockValue                 (BIT17)\r
 #define TPM_DELEGATE_OwnerClear                     (BIT16)\r
 #define TPM_DELEGATE_DisableOwnerClear              (BIT15)\r
+#define TPM_DELEGATE_NV_DefineSpace                 (BIT14)\r
 #define TPM_DELEGATE_OwnerSetDisable                (BIT13)\r
 #define TPM_DELEGATE_SetCapability                  (BIT12)\r
 #define TPM_DELEGATE_MakeIdentity                   (BIT11)\r
@@ -1735,6 +1974,16 @@ typedef struct tdTPM_DELEGATE_KEY_BLOB {
 #define TPM_CAP_PROP_MAX_NV_AVAILABLE   ((TPM_CAPABILITY_AREA) 0x00000123)\r
 #define TPM_CAP_PROP_INPUT_BUFFER       ((TPM_CAPABILITY_AREA) 0x00000124)\r
 \r
+//\r
+// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability\r
+//\r
+#define TPM_SET_PERM_FLAGS              ((TPM_CAPABILITY_AREA) 0x00000001)\r
+#define TPM_SET_PERM_DATA               ((TPM_CAPABILITY_AREA) 0x00000002)\r
+#define TPM_SET_STCLEAR_FLAGS           ((TPM_CAPABILITY_AREA) 0x00000003)\r
+#define TPM_SET_STCLEAR_DATA            ((TPM_CAPABILITY_AREA) 0x00000004)\r
+#define TPM_SET_STANY_FLAGS             ((TPM_CAPABILITY_AREA) 0x00000005)\r
+#define TPM_SET_STANY_DATA              ((TPM_CAPABILITY_AREA) 0x00000006)\r
+\r
 ///\r
 /// Part 2, section 21.6: TPM_CAP_VERSION_INFO\r
 ///   [size_is(vendorSpecificSize)] BYTE* vendorSpecific;\r
@@ -1749,6 +1998,50 @@ typedef struct tdTPM_CAP_VERSION_INFO {
   UINT8                             *vendorSpecific;\r
 } TPM_CAP_VERSION_INFO;\r
 \r
+///\r
+/// Part 2, section 21.10: TPM_DA_ACTION_TYPE\r
+///\r
+typedef struct tdTPM_DA_ACTION_TYPE {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  UINT32                            actions;\r
+} TPM_DA_ACTION_TYPE;\r
+\r
+#define TPM_DA_ACTION_FAILURE_MODE     (((UINT32)1)<<3)\r
+#define TPM_DA_ACTION_DEACTIVATE       (((UINT32)1)<<2)\r
+#define TPM_DA_ACTION_DISABLE          (((UINT32)1)<<1)\r
+#define TPM_DA_ACTION_TIMEOUT          (((UINT32)1)<<0)\r
+\r
+///\r
+/// Part 2, section 21.7: TPM_DA_INFO\r
+///\r
+typedef struct tdTPM_DA_INFO {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  TPM_DA_STATE                      state;\r
+  UINT16                            currentCount;\r
+  UINT16                            thresholdCount;\r
+  TPM_DA_ACTION_TYPE                actionAtThreshold;\r
+  UINT32                            actionDependValue;\r
+  UINT32                            vendorDataSize;\r
+  UINT8                             *vendorData;\r
+} TPM_DA_INFO;\r
+\r
+///\r
+/// Part 2, section 21.8: TPM_DA_INFO_LIMITED\r
+///\r
+typedef struct tdTPM_DA_INFO_LIMITED {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  TPM_DA_STATE                      state;\r
+  TPM_DA_ACTION_TYPE                actionAtThreshold;\r
+  UINT32                            vendorDataSize;\r
+  UINT8                             *vendorData;\r
+} TPM_DA_INFO_LIMITED;\r
+\r
+//\r
+// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability\r
+//\r
+#define TPM_DA_STATE_INACTIVE          ((UINT8)0x00)\r
+#define TPM_DA_STATE_ACTIVE            ((UINT8)0x01)\r
+\r
 //\r
 // Part 2, section 22: DAA Structures\r
 //\r
@@ -1858,7 +2151,7 @@ typedef struct tdTPM_DAA_SENSITIVE {
 #define TPM_REDIR_GPIO              (0x00000001)\r
 \r
 ///\r
-/// TPM Command & Response Headers defined in Part 3\r
+/// TPM Command Headers defined in Part 3\r
 ///\r
 typedef struct tdTPM_RQU_COMMAND_HDR {\r
   TPM_STRUCTURE_TAG                 tag;\r
@@ -1866,6 +2159,9 @@ typedef struct tdTPM_RQU_COMMAND_HDR {
   TPM_COMMAND_CODE                  ordinal;\r
 } TPM_RQU_COMMAND_HDR;\r
 \r
+///\r
+/// TPM Response Headers defined in Part 3\r
+///\r
 typedef struct tdTPM_RSP_COMMAND_HDR {\r
   TPM_STRUCTURE_TAG                 tag;\r
   UINT32                            paramSize;\r