Home | History | Annotate | Download | only in Ppi
      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_PPI_H
     16 #define _EFI_PTT_PASS_THRU_PPI_H
     17 
     18 #define PTT_PASS_THRU_PPI_GUID \
     19   { \
     20     0xc5068bac, 0xa7dc, 0x42f1, 0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b   \
     21   }
     22 // {C5068BAC-A7DC-42f1-AE80-CAA24BB4904B}
     23 //static const GUID <<name>> =
     24 //{ 0xc5068bac, 0xa7dc, 0x42f1, { 0xae, 0x80, 0xca, 0xa2, 0x4b, 0xb4, 0x90, 0x4b } };
     25 
     26 
     27 
     28 //#define EFI_PTT_PROTOCOL_GUID  HECI_PROTOCOL_GUID
     29 
     30 typedef struct _PTT_PASS_THRU_PPI PTT_PASS_THRU_PPI;
     31 
     32 /**
     33   This service enables the sending of commands to the TPM2.
     34 
     35   @param[in]      InputParameterBlockSize  Size of the TPM2 input parameter block.
     36   @param[in]      InputParameterBlock      Pointer to the TPM2 input parameter block.
     37   @param[in,out]  OutputParameterBlockSize Size of the TPM2 output parameter block.
     38   @param[in]      OutputParameterBlock     Pointer to the TPM2 output parameter block.
     39 
     40   @retval EFI_SUCCESS            The command byte stream was successfully sent to the device and a response was successfully received.
     41   @retval EFI_DEVICE_ERROR       The command was not successfully sent to the device or a response was not successfully received from the device.
     42   @retval EFI_BUFFER_TOO_SMALL   The output parameter block is too small.
     43 **/
     44 typedef
     45 EFI_STATUS
     46 (EFIAPI *TPM2_SUBMIT_COMMAND) (
     47   IN PTT_PASS_THRU_PPI *This,
     48   IN UINT32                  InputParameterBlockSize,
     49   IN UINT8                   *InputParameterBlock,
     50   IN OUT UINT32              *OutputParameterBlockSize,
     51   IN UINT8                   *OutputParameterBlock
     52   );
     53 
     54 /**
     55   This service requests use TPM2.
     56 
     57   @retval EFI_SUCCESS      Get the control of TPM2 chip.
     58   @retval EFI_NOT_FOUND    TPM2 not found.
     59   @retval EFI_DEVICE_ERROR Unexpected device behavior.
     60 **/
     61 typedef
     62 EFI_STATUS
     63 (EFIAPI *TPM2_REQUEST_USE_TPM) (
     64   IN PTT_PASS_THRU_PPI *This
     65   );
     66 
     67 typedef struct {
     68   EFI_GUID                           ProviderGuid;
     69   TPM2_SUBMIT_COMMAND                Tpm2SubmitCommand;
     70   TPM2_REQUEST_USE_TPM               Tpm2RequestUseTpm;
     71 } PTT_TPM2_DEVICE_INTERFACE;
     72 
     73 
     74 /**
     75   This service register TPM2 device.
     76 
     77   @param Tpm2Device  TPM2 device
     78 
     79   @retval EFI_SUCCESS          This TPM2 device is registered successfully.
     80   @retval EFI_UNSUPPORTED      System does not support register this TPM2 device.
     81   @retval EFI_ALREADY_STARTED  System already register this TPM2 device.
     82 **/
     83 typedef
     84 EFI_STATUS
     85 (EFIAPI *TPM2_REGISTER_TPM2_DEVICE_LIB) (
     86   IN PTT_PASS_THRU_PPI  *This,
     87   IN PTT_TPM2_DEVICE_INTERFACE   *Tpm2Device
     88   );
     89 
     90 typedef struct _PTT_PASS_THRU_PPI {
     91   TPM2_SUBMIT_COMMAND             Tpm2SubmitCommand;
     92   TPM2_REQUEST_USE_TPM            Tpm2RequestUseTpm;
     93   TPM2_REGISTER_TPM2_DEVICE_LIB   Tpm2RegisterTpm2DeviceLib;
     94 } PTT_PASS_THRU_PPI;
     95 
     96 extern EFI_GUID gPttPassThruPpiGuid;
     97 
     98 #endif // _EFI_HECI_H
     99