1 | /** @file
|
---|
2 | * PDM - Pluggable Device Manager, TPM related interfaces.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2021 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef VBOX_INCLUDED_vmm_pdmtpmifs_h
|
---|
27 | #define VBOX_INCLUDED_vmm_pdmtpmifs_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <VBox/types.h>
|
---|
33 |
|
---|
34 | RT_C_DECLS_BEGIN
|
---|
35 |
|
---|
36 | /** @defgroup grp_pdm_ifs_tpm PDM TPM Interfaces
|
---|
37 | * @ingroup grp_pdm_interfaces
|
---|
38 | * @{
|
---|
39 | */
|
---|
40 |
|
---|
41 |
|
---|
42 | /** Pointer to a TPM port interface. */
|
---|
43 | typedef struct PDMITPMPORT *PPDMITPMPORT;
|
---|
44 | /**
|
---|
45 | * TPM port interface (down).
|
---|
46 | */
|
---|
47 | typedef struct PDMITPMPORT
|
---|
48 | {
|
---|
49 | /**
|
---|
50 | * @todo
|
---|
51 | */
|
---|
52 | DECLR3CALLBACKMEMBER(int, pfnDummy, (PPDMITPMPORT pInterface));
|
---|
53 |
|
---|
54 | } PDMITPMPORT;
|
---|
55 | /** PDMITPMPORT interface ID. */
|
---|
56 | #define PDMITPMPORT_IID "1e57710f-f820-47ec-afa6-2713195f8f94"
|
---|
57 |
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * TPM version enumeration.
|
---|
61 | */
|
---|
62 | typedef enum TPMVERSION
|
---|
63 | {
|
---|
64 | /** Invalid TPM version, don't use. */
|
---|
65 | TPMVERSION_INVALID = 0,
|
---|
66 | /** TPM works according to version 1.2 of the specification. */
|
---|
67 | TPMVERSION_1_2,
|
---|
68 | /** TPM works according to version 2.0 of the specification. */
|
---|
69 | TPMVERSION_2_0,
|
---|
70 | /** TPM version is unknown. */
|
---|
71 | TPMVERSION_UNKNOWN
|
---|
72 | } TPMVERSION;
|
---|
73 |
|
---|
74 |
|
---|
75 | /** Pointer to a TPM interface. */
|
---|
76 | typedef struct PDMITPMCONNECTOR *PPDMITPMCONNECTOR;
|
---|
77 | /**
|
---|
78 | * TPM interface (up).
|
---|
79 | * Pairs with PDMITPMPORT.
|
---|
80 | */
|
---|
81 | typedef struct PDMITPMCONNECTOR
|
---|
82 | {
|
---|
83 | /**
|
---|
84 | * Returns the version of the TPM implemented by the driver below.
|
---|
85 | *
|
---|
86 | * @returns The TPM version.
|
---|
87 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
88 | */
|
---|
89 | DECLR3CALLBACKMEMBER(TPMVERSION, pfnGetVersion, (PPDMITPMCONNECTOR pInterface));
|
---|
90 |
|
---|
91 | /**
|
---|
92 | * Returns the maximum supported locality of the driver below.
|
---|
93 | *
|
---|
94 | * @returns The maximum supported locality (0-4).
|
---|
95 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
96 | */
|
---|
97 | DECLR3CALLBACKMEMBER(uint32_t, pfnGetLocalityMax, (PPDMITPMCONNECTOR pInterface));
|
---|
98 |
|
---|
99 | /**
|
---|
100 | * Returns the command/response buffer size of the driver below.
|
---|
101 | *
|
---|
102 | * @returns Buffer size in bytes.
|
---|
103 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
104 | */
|
---|
105 | DECLR3CALLBACKMEMBER(uint32_t, pfnGetBufferSize, (PPDMITPMCONNECTOR pInterface));
|
---|
106 |
|
---|
107 | /**
|
---|
108 | * Returns the status of the established flag.
|
---|
109 | *
|
---|
110 | * @returns Status of the established flag.
|
---|
111 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
112 | */
|
---|
113 | DECLR3CALLBACKMEMBER(bool, pfnGetEstablishedFlag, (PPDMITPMCONNECTOR pInterface));
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * Resets the TPM established flag.
|
---|
117 | *
|
---|
118 | * @returns VBox status code.
|
---|
119 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
120 | * @param bLoc The locality issuing this request.
|
---|
121 | */
|
---|
122 | DECLR3CALLBACKMEMBER(int, pfnResetEstablishedFlag, (PPDMITPMCONNECTOR pInterface, uint8_t bLoc));
|
---|
123 |
|
---|
124 | /**
|
---|
125 | * Executes the given command.
|
---|
126 | *
|
---|
127 | * @returns VBox status code.
|
---|
128 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
129 | * @param bLoc The locality the command is issued from.
|
---|
130 | * @param pvCmd Pointer to the command data.
|
---|
131 | * @param cbCmd Size of the command in bytes.
|
---|
132 | * @param pvResp Where to store the response data.
|
---|
133 | * @param cbResp Size of the response buffer in bytes.
|
---|
134 | */
|
---|
135 | DECLR3CALLBACKMEMBER(int, pfnCmdExec, (PPDMITPMCONNECTOR pInterface, uint8_t bLoc, const void *pvCmd, size_t cbCmd, void *pvResp, size_t cbResp));
|
---|
136 |
|
---|
137 | /**
|
---|
138 | * Cancels the currently executed command.
|
---|
139 | *
|
---|
140 | * @returns VBox status code.
|
---|
141 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
142 | */
|
---|
143 | DECLR3CALLBACKMEMBER(int, pfnCmdCancel, (PPDMITPMCONNECTOR pInterface));
|
---|
144 |
|
---|
145 | } PDMITPMCONNECTOR;
|
---|
146 | /** PDMITPMCONNECTOR interface ID. */
|
---|
147 | #define PDMITPMCONNECTOR_IID "30afefd8-c11f-4e2a-a746-424e3d99fa86"
|
---|
148 |
|
---|
149 | /** @} */
|
---|
150 |
|
---|
151 | RT_C_DECLS_END
|
---|
152 |
|
---|
153 | #endif /* !VBOX_INCLUDED_vmm_pdmtpmifs_h */
|
---|