Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / qapi / tpm.json
blob4e2ea9756a6315ed3908f783360bb74539991456
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = TPM (trusted platform module) devices
7 ##
9 ##
10 # @TpmModel:
12 # An enumeration of TPM models
14 # @tpm-tis: TPM TIS model
15 # @tpm-crb: TPM CRB model (since 2.12)
16 # @tpm-spapr: TPM SPAPR model (since 5.0)
18 # Since: 1.5
20 { 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
21   'if': 'CONFIG_TPM' }
24 # @query-tpm-models:
26 # Return a list of supported TPM models
28 # Returns: a list of TpmModel
30 # Since: 1.5
32 # Example:
34 # -> { "execute": "query-tpm-models" }
35 # <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
38 { 'command': 'query-tpm-models', 'returns': ['TpmModel'],
39   'if': 'CONFIG_TPM' }
42 # @TpmType:
44 # An enumeration of TPM types
46 # @passthrough: TPM passthrough type
47 # @emulator: Software Emulator TPM type
48 #            Since: 2.11
50 # Since: 1.5
52 { 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
53   'if': 'CONFIG_TPM' }
56 # @query-tpm-types:
58 # Return a list of supported TPM types
60 # Returns: a list of TpmType
62 # Since: 1.5
64 # Example:
66 # -> { "execute": "query-tpm-types" }
67 # <- { "return": [ "passthrough", "emulator" ] }
70 { 'command': 'query-tpm-types', 'returns': ['TpmType'],
71   'if': 'CONFIG_TPM' }
74 # @TPMPassthroughOptions:
76 # Information about the TPM passthrough type
78 # @path: string describing the path used for accessing the TPM device
80 # @cancel-path: string showing the TPM's sysfs cancel file
81 #               for cancellation of TPM commands while they are executing
83 # Since: 1.5
85 { 'struct': 'TPMPassthroughOptions',
86   'data': { '*path': 'str',
87             '*cancel-path': 'str' },
88   'if': 'CONFIG_TPM' }
91 # @TPMEmulatorOptions:
93 # Information about the TPM emulator type
95 # @chardev: Name of a unix socket chardev
97 # Since: 2.11
99 { 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
100   'if': 'CONFIG_TPM' }
103 # @TPMPassthroughOptionsWrapper:
105 # Since: 1.5
107 { 'struct': 'TPMPassthroughOptionsWrapper',
108   'data': { 'data': 'TPMPassthroughOptions' },
109   'if': 'CONFIG_TPM' }
112 # @TPMEmulatorOptionsWrapper:
114 # Since: 2.11
116 { 'struct': 'TPMEmulatorOptionsWrapper',
117   'data': { 'data': 'TPMEmulatorOptions' },
118   'if': 'CONFIG_TPM' }
121 # @TpmTypeOptions:
123 # A union referencing different TPM backend types' configuration options
125 # @type: - 'passthrough' The configuration options for the TPM passthrough type
126 #        - 'emulator' The configuration options for TPM emulator backend type
128 # Since: 1.5
130 { 'union': 'TpmTypeOptions',
131   'base': { 'type': 'TpmType' },
132   'discriminator': 'type',
133   'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
134             'emulator': 'TPMEmulatorOptionsWrapper' },
135   'if': 'CONFIG_TPM' }
138 # @TPMInfo:
140 # Information about the TPM
142 # @id: The Id of the TPM
144 # @model: The TPM frontend model
146 # @options: The TPM (backend) type configuration options
148 # Since: 1.5
150 { 'struct': 'TPMInfo',
151   'data': {'id': 'str',
152            'model': 'TpmModel',
153            'options': 'TpmTypeOptions' },
154   'if': 'CONFIG_TPM' }
157 # @query-tpm:
159 # Return information about the TPM device
161 # Returns: @TPMInfo on success
163 # Since: 1.5
165 # Example:
167 # -> { "execute": "query-tpm" }
168 # <- { "return":
169 #      [
170 #        { "model": "tpm-tis",
171 #          "options":
172 #            { "type": "passthrough",
173 #              "data":
174 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
175 #                  "path": "/dev/tpm0"
176 #                }
177 #            },
178 #          "id": "tpm0"
179 #        }
180 #      ]
181 #    }
184 { 'command': 'query-tpm', 'returns': ['TPMInfo'],
185   'if': 'CONFIG_TPM' }