summaryrefslogtreecommitdiff
path: root/Vlv2TbltDevicePkg/Include/Protocol/TpmMp.h
blob: 415e53daf29a36d17ddc4553a4ef4c0025c5a570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*++

  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
                                                                                   

  SPDX-License-Identifier: BSD-2-Clause-Patent

                                                                                   



Module Name:

  Tpm.h

Abstract:


--*/

#ifndef __EFI_TPM_MP_DRIVER_PROTOCOL_H__
#define __EFI_TPM_MP_DRIVER_PROTOCOL_H__


#define EFI_TPM_MP_DRIVER_PROTOCOL_GUID \
  { 0xde161cfe, 0x1e60, 0x42a1, 0x8c, 0xc3, 0xee, 0x7e, 0xf0, 0x73, 0x52, 0x12 }


EFI_FORWARD_DECLARATION (EFI_TPM_MP_DRIVER_PROTOCOL);

#define TPM_DRIVER_STATUS         0
#define TPM_DEVICE_STATUS         1

#define TPM_DRIVER_OK             0
#define TPM_DRIVER_FAILED         1
#define TPM_DRIVER_NOT_OPENED     2
#define TPM_DEVICE_OK             0
#define TPM_DEVICE_UNRECOVERABLE  1
#define TPM_DEVICE_RECOVERABLE    2
#define TPM_DEVICE_NOT_FOUND      3

//
// Prototypes for the TPM MP Driver Protocol
//

/**
  This service Open the TPM interface

  @param[in] This             A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.

  @retval  EFI_SUCCESS        Operation completed successfully
  @retval  EFI_DEVICE_ERROR   The command was unsuccessful
  @retval  EFI_NOT_FOUND      The component was not running

**/
typedef
EFI_STATUS
(EFIAPI *EFI_TPM_MP_INIT) (
  IN EFI_TPM_MP_DRIVER_PROTOCOL   *This
  );

/**
  This service close the TPM interface and deactivate TPM

  @param[in] This            A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.

  @retval EFI_SUCCESS        Operation completed successfully
  @retval EFI_DEVICE_ERROR   The command was unsuccessful
  @retval EFI_NOT_FOUND      The component was not running

**/
typedef
EFI_STATUS
(EFIAPI *EFI_TPM_MP_CLOSE) (
  IN EFI_TPM_MP_DRIVER_PROTOCOL   *This
  );

/**
  This service get the current status infomation of TPM

  @param[in]  This                  A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
  @param[in]  ReqStatusType	        Requested type of status information, driver or device.
  @param[in]  Status	              Pointer to the returned status.

  @retval  EFI_SUCCESS              Operation completed successfully
  @retval  EFI_DEVICE_ERROR         The command was unsuccessful
  @retval  EFI_INVALID_PARAMETER    One or more of the parameters are incorrect
  @retval  EFI_BUFFER_TOO_SMALL     The receive buffer is too small
  @retval  EFI_NOT_FOUND            The component was not running

**/
typedef
EFI_STATUS
(EFIAPI *EFI_TPM_MP_GET_STATUS_INFO) (
  IN EFI_TPM_MP_DRIVER_PROTOCOL   *This,
  IN UINT32				                ReqStatusType,
  OUT UINT32				              *Status
  );

/**
  This service transmit data to the TPM and get response from TPM

  @param[in] This                  A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
  @param[in] TransmitBuf	         Pointer to a buffer containing TPM transmit data.
  @param[in] TransmitBufLen	       Sizeof TPM input buffer in bytes.
  @param[in] ReceiveBuf	           Pointer to a buffer containing TPM receive data.
  @param[in]  ReceiveBufLen	       On input, size of TPM receive buffer in bytes.
                                   On output, number of bytes written.

  @retval  EFI_SUCCESS             Operation completed successfully
  @retval  EFI_DEVICE_ERROR        The command was unsuccessful
  @retval  EFI_INVALID_PARAMETER   One or more of the parameters are incorrect
  @retval  EFI_BUFFER_TOO_SMALL    The receive buffer is too small
  @retval  EFI_NOT_FOUND           The component was not running

**/
typedef
EFI_STATUS
(EFIAPI *EFI_TPM_MP_TRANSMIT) (
  IN EFI_TPM_MP_DRIVER_PROTOCOL   *This,
  IN UINT8				  	            *TransmitBuffer,
  IN UINT32			  	              TransmitBufferLen,
  OUT UINT8				  	            *ReceiveBuf,
  IN OUT UINT32			  	          *ReceiveBufLen
  );



typedef struct _EFI_TPM_MP_DRIVER_PROTOCOL {
  EFI_TPM_MP_INIT			              Init;
  EFI_TPM_MP_CLOSE			            Close;
  EFI_TPM_MP_GET_STATUS_INFO 		    GetStatusInfo;
  EFI_TPM_MP_TRANSMIT		            Transmit;
} EFI_TPM_MP_DRIVER_PROTOCOL;

extern EFI_GUID gEfiTpmMpDriverProtocolGuid;

#endif