VirtualBox

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

Last change on this file since 90512 was 90512, checked in by vboxsync, 4 years ago

Devices/Security/DevTpm: Updates to the TPM code, started implmenting the CRB interface first as it looks saner, bugref:10075

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 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/** Pointer to a TPM interface. */
60typedef struct PDMITPMCONNECTOR *PPDMITPMCONNECTOR;
61/**
62 * TPM interface (up).
63 * Pairs with PDMITPMPORT.
64 */
65typedef struct PDMITPMCONNECTOR
66{
67 /**
68 * Starts the TPM.
69 *
70 * @returns VBox status code.
71 * @param pInterface Pointer to the interface structure containing the called function pointer.
72 * @param cbCmdResp Size of the command/response buffer.
73 */
74 DECLR3CALLBACKMEMBER(int, pfnStartup, (PPDMITPMCONNECTOR pInterface, size_t cbCmdResp));
75
76 /**
77 * Shuts down the TPM.
78 *
79 * @returns VBox status code.
80 * @param pInterface Pointer to the interface structure containing the called function pointer.
81 */
82 DECLR3CALLBACKMEMBER(int, pfnShutdown, (PPDMITPMCONNECTOR pInterface));
83
84 /**
85 * Resets the TPM.
86 *
87 * @returns VBox status code.
88 * @param pInterface Pointer to the interface structure containing the called function pointer.
89 */
90 DECLR3CALLBACKMEMBER(int, pfnReset, (PPDMITPMCONNECTOR pInterface));
91
92 /**
93 * Returns the version of the TPM implemented by the driver below.
94 *
95 * @returns The TPM version.
96 * @param pInterface Pointer to the interface structure containing the called function pointer.
97 */
98 DECLR3CALLBACKMEMBER(uint32_t, pfnGetVersion, (PPDMITPMCONNECTOR pInterface));
99
100 /**
101 * Returns the status of the established flag.
102 *
103 * @returns Status of the established flag.
104 * @param pInterface Pointer to the interface structure containing the called function pointer.
105 */
106 DECLR3CALLBACKMEMBER(bool, pfnGetEstablishedFlag, (PPDMITPMCONNECTOR pInterface));
107
108 /**
109 * Resets the TPM established flag.
110 *
111 * @returns VBox status code.
112 * @param pInterface Pointer to the interface structure containing the called function pointer.
113 * @param bLoc The locality issuing this request.
114 */
115 DECLR3CALLBACKMEMBER(int, pfnResetEstablishedFlag, (PPDMITPMCONNECTOR pInterface, uint8_t bLoc));
116
117 /**
118 * Executes the given command.
119 *
120 * @returns Status of the established flag.
121 * @param pInterface Pointer to the interface structure containing the called function pointer.
122 * @param pvCmd Pointer to the command data.
123 * @param cbCmd Size of the command in bytes.
124 * @param pvResp Where to store the response data.
125 * @param cbResp Size of the response buffer in bytes.
126 */
127 DECLR3CALLBACKMEMBER(bool, pfnCmdExec, (PPDMITPMCONNECTOR pInterface, const void *pvCmd, size_t cbCmd, void *pvResp, size_t cbResp));
128
129 /**
130 * Cancels the currently executed command.
131 *
132 * @returns Status of the established flag.
133 * @param pInterface Pointer to the interface structure containing the called function pointer.
134 */
135 DECLR3CALLBACKMEMBER(bool, pfnCmdCancel, (PPDMITPMCONNECTOR pInterface));
136
137} PDMITPMCONNECTOR;
138/** PDMITPMCONNECTOR interface ID. */
139#define PDMITPMCONNECTOR_IID "30afefd8-c11f-4e2a-a746-424e3d99fa86"
140
141/** @} */
142
143RT_C_DECLS_END
144
145#endif /* !VBOX_INCLUDED_vmm_pdmtpmifs_h */
Note: See TracBrowser for help on using the repository browser.

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