PttPassThruPpi.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*++
  2. Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. --*/
  5. #ifndef _EFI_PTT_PASS_THRU_PPI_H
  6. #define _EFI_PTT_PASS_THRU_PPI_H
  7. #define PTT_PASS_THRU_PPI_GUID \
  8. { \
  9. 0xc5068bac, 0xa7dc, 0x42f1, 0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b \
  10. }
  11. // {C5068BAC-A7DC-42f1-AE80-CAA24BB4904B}
  12. //static const GUID <<name>> =
  13. //{ 0xc5068bac, 0xa7dc, 0x42f1, { 0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b } };
  14. //#define EFI_PTT_PROTOCOL_GUID HECI_PROTOCOL_GUID
  15. typedef struct _PTT_PASS_THRU_PPI PTT_PASS_THRU_PPI;
  16. /**
  17. This service enables the sending of commands to the TPM2.
  18. @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
  19. @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
  20. @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
  21. @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
  22. @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
  23. @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
  24. @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
  25. **/
  26. typedef
  27. EFI_STATUS
  28. (EFIAPI *TPM2_SUBMIT_COMMAND) (
  29. IN PTT_PASS_THRU_PPI *This,
  30. IN UINT32 InputParameterBlockSize,
  31. IN UINT8 *InputParameterBlock,
  32. IN OUT UINT32 *OutputParameterBlockSize,
  33. IN UINT8 *OutputParameterBlock
  34. );
  35. /**
  36. This service requests use TPM2.
  37. @retval EFI_SUCCESS Get the control of TPM2 chip.
  38. @retval EFI_NOT_FOUND TPM2 not found.
  39. @retval EFI_DEVICE_ERROR Unexpected device behavior.
  40. **/
  41. typedef
  42. EFI_STATUS
  43. (EFIAPI *TPM2_REQUEST_USE_TPM) (
  44. IN PTT_PASS_THRU_PPI *This
  45. );
  46. typedef struct {
  47. EFI_GUID ProviderGuid;
  48. TPM2_SUBMIT_COMMAND Tpm2SubmitCommand;
  49. TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm;
  50. } PTT_TPM2_DEVICE_INTERFACE;
  51. /**
  52. This service register TPM2 device.
  53. @param Tpm2Device TPM2 device
  54. @retval EFI_SUCCESS This TPM2 device is registered successfully.
  55. @retval EFI_UNSUPPORTED System does not support register this TPM2 device.
  56. @retval EFI_ALREADY_STARTED System already register this TPM2 device.
  57. **/
  58. typedef
  59. EFI_STATUS
  60. (EFIAPI *TPM2_REGISTER_TPM2_DEVICE_LIB) (
  61. IN PTT_PASS_THRU_PPI *This,
  62. IN PTT_TPM2_DEVICE_INTERFACE *Tpm2Device
  63. );
  64. typedef struct _PTT_PASS_THRU_PPI {
  65. TPM2_SUBMIT_COMMAND Tpm2SubmitCommand;
  66. TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm;
  67. TPM2_REGISTER_TPM2_DEVICE_LIB Tpm2RegisterTpm2DeviceLib;
  68. } PTT_PASS_THRU_PPI;
  69. extern EFI_GUID gPttPassThruPpiGuid;
  70. #endif // _EFI_HECI_H