target/loongarch: Implement vmskltz/vmskgez/vmsknz
[qemu/kevin.git] / qapi / tpm.json
blobeac87d30b29f765048d77a22566a336137597b16
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 (since 2.11)
49 # Since: 1.5
51 { 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
52   'if': 'CONFIG_TPM' }
55 # @query-tpm-types:
57 # Return a list of supported TPM types
59 # Returns: a list of TpmType
61 # Since: 1.5
63 # Example:
65 # -> { "execute": "query-tpm-types" }
66 # <- { "return": [ "passthrough", "emulator" ] }
69 { 'command': 'query-tpm-types', 'returns': ['TpmType'],
70   'if': 'CONFIG_TPM' }
73 # @TPMPassthroughOptions:
75 # Information about the TPM passthrough type
77 # @path: string describing the path used for accessing the TPM device
79 # @cancel-path: string showing the TPM's sysfs cancel file
80 #               for cancellation of TPM commands while they are executing
82 # Since: 1.5
84 { 'struct': 'TPMPassthroughOptions',
85   'data': { '*path': 'str',
86             '*cancel-path': 'str' },
87   'if': 'CONFIG_TPM' }
90 # @TPMEmulatorOptions:
92 # Information about the TPM emulator type
94 # @chardev: Name of a unix socket chardev
96 # Since: 2.11
98 { 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
99   'if': 'CONFIG_TPM' }
102 # @TPMPassthroughOptionsWrapper:
104 # Since: 1.5
106 { 'struct': 'TPMPassthroughOptionsWrapper',
107   'data': { 'data': 'TPMPassthroughOptions' },
108   'if': 'CONFIG_TPM' }
111 # @TPMEmulatorOptionsWrapper:
113 # Since: 2.11
115 { 'struct': 'TPMEmulatorOptionsWrapper',
116   'data': { 'data': 'TPMEmulatorOptions' },
117   'if': 'CONFIG_TPM' }
120 # @TpmTypeOptions:
122 # A union referencing different TPM backend types' configuration options
124 # @type: - 'passthrough' The configuration options for the TPM passthrough type
125 #        - 'emulator' The configuration options for TPM emulator backend type
127 # Since: 1.5
129 { 'union': 'TpmTypeOptions',
130   'base': { 'type': 'TpmType' },
131   'discriminator': 'type',
132   'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
133             'emulator': 'TPMEmulatorOptionsWrapper' },
134   'if': 'CONFIG_TPM' }
137 # @TPMInfo:
139 # Information about the TPM
141 # @id: The Id of the TPM
143 # @model: The TPM frontend model
145 # @options: The TPM (backend) type configuration options
147 # Since: 1.5
149 { 'struct': 'TPMInfo',
150   'data': {'id': 'str',
151            'model': 'TpmModel',
152            'options': 'TpmTypeOptions' },
153   'if': 'CONFIG_TPM' }
156 # @query-tpm:
158 # Return information about the TPM device
160 # Returns: @TPMInfo on success
162 # Since: 1.5
164 # Example:
166 # -> { "execute": "query-tpm" }
167 # <- { "return":
168 #      [
169 #        { "model": "tpm-tis",
170 #          "options":
171 #            { "type": "passthrough",
172 #              "data":
173 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
174 #                  "path": "/dev/tpm0"
175 #                }
176 #            },
177 #          "id": "tpm0"
178 #        }
179 #      ]
180 #    }
183 { 'command': 'query-tpm', 'returns': ['TPMInfo'],
184   'if': 'CONFIG_TPM' }