VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmtpmifs.h@ 90530

Last change on this file since 90530 was 90530, checked in by vboxsync, 3 years ago

Devices/Security: Start implementation of a TPM driver talking to the software TPM emulator (swtpm) over TCP, bugref:10075

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
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
34RT_C_DECLS_BEGIN
35
36/** @defgroup grp_pdm_ifs_serial PDM TPM Interfaces
37 * @ingroup grp_pdm_interfaces
38 * @{
39 */
40
41
42/** Pointer to a TPM port interface. */
43typedef struct PDMITPMPORT *PPDMITPMPORT;
44/**
45 * TPM port interface (down).
46 */
47typedef 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 */
62typedef 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. */
76typedef struct PDMITPMCONNECTOR *PPDMITPMCONNECTOR;
77/**
78 * TPM interface (up).
79 * Pairs with PDMITPMPORT.
80 */
81typedef struct PDMITPMCONNECTOR
82{
83 /**
84 * Starts the TPM.
85 *
86 * @returns VBox status code.
87 * @param pInterface Pointer to the interface structure containing the called function pointer.
88 * @param cbCmdResp Size of the command/response buffer.
89 */
90 DECLR3CALLBACKMEMBER(int, pfnStartup, (PPDMITPMCONNECTOR pInterface, size_t cbCmdResp));
91
92 /**
93 * Shuts down the TPM.
94 *
95 * @returns VBox status code.
96 * @param pInterface Pointer to the interface structure containing the called function pointer.
97 */
98 DECLR3CALLBACKMEMBER(int, pfnShutdown, (PPDMITPMCONNECTOR pInterface));
99
100 /**
101 * Resets the TPM.
102 *
103 * @returns VBox status code.
104 * @param pInterface Pointer to the interface structure containing the called function pointer.
105 */
106 DECLR3CALLBACKMEMBER(int, pfnReset, (PPDMITPMCONNECTOR pInterface));
107
108 /**
109 * Returns the version of the TPM implemented by the driver below.
110 *
111 * @returns The TPM version.
112 * @param pInterface Pointer to the interface structure containing the called function pointer.
113 */
114 DECLR3CALLBACKMEMBER(TPMVERSION, pfnGetVersion, (PPDMITPMCONNECTOR pInterface));
115
116 /**
117 * Returns the status of the established flag.
118 *
119 * @returns Status of the established flag.
120 * @param pInterface Pointer to the interface structure containing the called function pointer.
121 */
122 DECLR3CALLBACKMEMBER(bool, pfnGetEstablishedFlag, (PPDMITPMCONNECTOR pInterface));
123
124 /**
125 * Resets the TPM established flag.
126 *
127 * @returns VBox status code.
128 * @param pInterface Pointer to the interface structure containing the called function pointer.
129 * @param bLoc The locality issuing this request.
130 */
131 DECLR3CALLBACKMEMBER(int, pfnResetEstablishedFlag, (PPDMITPMCONNECTOR pInterface, uint8_t bLoc));
132
133 /**
134 * Executes the given command.
135 *
136 * @returns VBox status code.
137 * @param pInterface Pointer to the interface structure containing the called function pointer.
138 * @param bLoc The locality the command is issued from.
139 * @param pvCmd Pointer to the command data.
140 * @param cbCmd Size of the command in bytes.
141 * @param pvResp Where to store the response data.
142 * @param cbResp Size of the response buffer in bytes.
143 */
144 DECLR3CALLBACKMEMBER(int, pfnCmdExec, (PPDMITPMCONNECTOR pInterface, uint8_t bLoc, const void *pvCmd, size_t cbCmd, void *pvResp, size_t cbResp));
145
146 /**
147 * Cancels the currently executed command.
148 *
149 * @returns VBox status code.
150 * @param pInterface Pointer to the interface structure containing the called function pointer.
151 */
152 DECLR3CALLBACKMEMBER(int, pfnCmdCancel, (PPDMITPMCONNECTOR pInterface));
153
154} PDMITPMCONNECTOR;
155/** PDMITPMCONNECTOR interface ID. */
156#define PDMITPMCONNECTOR_IID "30afefd8-c11f-4e2a-a746-424e3d99fa86"
157
158/** @} */
159
160RT_C_DECLS_END
161
162#endif /* !VBOX_INCLUDED_vmm_pdmtpmifs_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette