Implement TPM1.2 Get Capabilities related commands.\r
\r
Copyright (c) 2016 - 2018, 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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#pragma pack(1)\r
\r
typedef struct {\r
- TPM_RQU_COMMAND_HDR Hdr;\r
- UINT32 Capability;\r
- UINT32 CapabilityFlagSize;\r
- UINT32 CapabilityFlag;\r
+ TPM_RQU_COMMAND_HDR Hdr;\r
+ UINT32 Capability;\r
+ UINT32 CapabilityFlagSize;\r
+ UINT32 CapabilityFlag;\r
} TPM_CMD_GET_CAPABILITY;\r
\r
typedef struct {\r
- TPM_RSP_COMMAND_HDR Hdr;\r
- UINT32 ResponseSize;\r
- TPM_PERMANENT_FLAGS Flags;\r
+ TPM_RSP_COMMAND_HDR Hdr;\r
+ UINT32 ResponseSize;\r
+ TPM_PERMANENT_FLAGS Flags;\r
} TPM_RSP_GET_CAPABILITY_PERMANENT_FLAGS;\r
\r
typedef struct {\r
- TPM_RSP_COMMAND_HDR Hdr;\r
- UINT32 ResponseSize;\r
- TPM_STCLEAR_FLAGS Flags;\r
+ TPM_RSP_COMMAND_HDR Hdr;\r
+ UINT32 ResponseSize;\r
+ TPM_STCLEAR_FLAGS Flags;\r
} TPM_RSP_GET_CAPABILITY_STCLEAR_FLAGS;\r
\r
#pragma pack()\r
Command.Capability = SwapBytes32 (TPM_CAP_FLAG);\r
Command.CapabilityFlagSize = SwapBytes32 (sizeof (TPM_CAP_FLAG_PERMANENT));\r
Command.CapabilityFlag = SwapBytes32 (TPM_CAP_FLAG_PERMANENT);\r
- Length = sizeof (Response);\r
- Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+ Length = sizeof (Response);\r
+ Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
}\r
\r
ZeroMem (TpmPermanentFlags, sizeof (*TpmPermanentFlags));\r
- CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), SwapBytes32(Response.ResponseSize)));\r
+ CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), SwapBytes32 (Response.ResponseSize)));\r
\r
return Status;\r
}\r
Command.Capability = SwapBytes32 (TPM_CAP_FLAG);\r
Command.CapabilityFlagSize = SwapBytes32 (sizeof (TPM_CAP_FLAG_VOLATILE));\r
Command.CapabilityFlag = SwapBytes32 (TPM_CAP_FLAG_VOLATILE);\r
- Length = sizeof (Response);\r
- Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+ Length = sizeof (Response);\r
+ Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
}\r
\r
ZeroMem (VolatileFlags, sizeof (*VolatileFlags));\r
- CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), SwapBytes32(Response.ResponseSize)));\r
+ CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), SwapBytes32 (Response.ResponseSize)));\r
\r
return Status;\r
}\r