2 Implement TPM1.2 Ownership related command.
4 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/BaseMemoryLib.h>
11 #include <Library/BaseLib.h>
12 #include <Library/Tpm12DeviceLib.h>
15 Send ForceClear command to TPM1.2.
17 @retval EFI_SUCCESS Operation completed successfully.
18 @retval EFI_DEVICE_ERROR Unexpected device behavior.
27 TPM_RQU_COMMAND_HDR Command
;
28 TPM_RSP_COMMAND_HDR Response
;
32 // send Tpm command TPM_ORD_ForceClear
34 Command
.tag
= SwapBytes16 (TPM_TAG_RQU_COMMAND
);
35 Command
.paramSize
= SwapBytes32 (sizeof (Command
));
36 Command
.ordinal
= SwapBytes32 (TPM_ORD_ForceClear
);
37 Length
= sizeof (Response
);
39 Status
= Tpm12SubmitCommand (sizeof (Command
), (UINT8
*)&Command
, &Length
, (UINT8
*)&Response
);
40 if (EFI_ERROR (Status
)) {
43 switch (SwapBytes32 (Response
.returnCode
)) {
47 return EFI_DEVICE_ERROR
;