1 /*++ 2 3 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR> 4 5 This program and the accompanying materials are licensed and made available under 6 the terms and conditions of the BSD License that accompanies this distribution. 7 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 _EFI_PTT_PASS_THRU_H 16 #define _EFI_PTT_PASS_THRU_H 17 18 #define PTT_PASS_THRU_PROTOCOL_GUID \ 19 { \ 20 0x73e2576, 0xf6c1, 0x4b91, 0x92, 0xa9, 0xd4, 0x67, 0x5d, 0xda, 0x34, 0xb1 \ 21 } 22 // {073E2576-F6C1-4b91-92A9-D4675DDA34B1} 23 //static const GUID <<name>> = 24 //{ 0x73e2576, 0xf6c1, 0x4b91, { 0x92, 0xa9, 0xd4, 0x67, 0x5d, 0xda, 0x34, 0xb1 } }; 25 26 27 //#define EFI_PTT_PROTOCOL_GUID HECI_PROTOCOL_GUID 28 29 typedef struct _PTT_PASS_THRU_PROTOCOL PTT_PASS_THRU_PROTOCOL; 30 31 /** 32 This service enables the sending of commands to the TPM2. 33 34 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block. 35 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block. 36 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block. 37 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block. 38 39 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received. 40 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device. 41 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small. 42 **/ 43 typedef 44 EFI_STATUS 45 (EFIAPI *TPM2_SUBMIT_COMMAND) ( 46 IN PTT_PASS_THRU_PROTOCOL *This, 47 IN UINT32 InputParameterBlockSize, 48 IN UINT8 *InputParameterBlock, 49 IN OUT UINT32 *OutputParameterBlockSize, 50 IN UINT8 *OutputParameterBlock 51 ); 52 53 /** 54 This service requests use TPM2. 55 56 @retval EFI_SUCCESS Get the control of TPM2 chip. 57 @retval EFI_NOT_FOUND TPM2 not found. 58 @retval EFI_DEVICE_ERROR Unexpected device behavior. 59 **/ 60 typedef 61 EFI_STATUS 62 (EFIAPI *TPM2_REQUEST_USE_TPM) ( 63 IN PTT_PASS_THRU_PROTOCOL *This 64 ); 65 66 typedef struct { 67 EFI_GUID ProviderGuid; 68 TPM2_SUBMIT_COMMAND Tpm2SubmitCommand; 69 TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm; 70 } PTT_TPM2_DEVICE_INTERFACE; 71 72 73 /** 74 This service register TPM2 device. 75 76 @param Tpm2Device TPM2 device 77 78 @retval EFI_SUCCESS This TPM2 device is registered successfully. 79 @retval EFI_UNSUPPORTED System does not support register this TPM2 device. 80 @retval EFI_ALREADY_STARTED System already register this TPM2 device. 81 **/ 82 typedef 83 EFI_STATUS 84 (EFIAPI *TPM2_REGISTER_TPM2_DEVICE_LIB) ( 85 IN PTT_PASS_THRU_PROTOCOL *This, 86 IN PTT_TPM2_DEVICE_INTERFACE *Tpm2Device 87 ); 88 89 typedef struct _PTT_PASS_THRU_PROTOCOL { 90 TPM2_SUBMIT_COMMAND Tpm2SubmitCommand; 91 TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm; 92 TPM2_REGISTER_TPM2_DEVICE_LIB Tpm2RegisterTpm2DeviceLib; 93 } PTT_PASS_THRU_PROTOCOL; 94 95 extern EFI_GUID gPttPassThruProtocolGuid; 96 97 #endif // _EFI_HECI_H 98