blob: d50deef5e97c3481a9dd5ce8fba29a9866f7422b [file] [log] [blame]
Markus Armbruster3859b6c2017-08-24 21:14:03 +02001# -*- Mode: Python -*-
2#
3
4##
5# = TPM (trusted platform module) devices
6##
7
8##
9# @TpmModel:
10#
11# An enumeration of TPM models
12#
13# @tpm-tis: TPM TIS model
Marc-André Lureau4ab6cb42018-01-29 19:33:07 +010014# @tpm-crb: TPM CRB model (since 2.12)
Markus Armbruster3859b6c2017-08-24 21:14:03 +020015#
16# Since: 1.5
17##
Marc-André Lureau4ab6cb42018-01-29 19:33:07 +010018{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb' ] }
Markus Armbruster3859b6c2017-08-24 21:14:03 +020019
20##
21# @query-tpm-models:
22#
23# Return a list of supported TPM models
24#
25# Returns: a list of TpmModel
26#
27# Since: 1.5
28#
29# Example:
30#
31# -> { "execute": "query-tpm-models" }
Marc-André Lureau4ab6cb42018-01-29 19:33:07 +010032# <- { "return": [ "tpm-tis", "tpm-crb" ] }
Markus Armbruster3859b6c2017-08-24 21:14:03 +020033#
34##
35{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
36
37##
38# @TpmType:
39#
40# An enumeration of TPM types
41#
42# @passthrough: TPM passthrough type
Amarnath Vallurif4ede812017-09-29 14:10:20 +030043# @emulator: Software Emulator TPM type
44# Since: 2.11
Markus Armbruster3859b6c2017-08-24 21:14:03 +020045#
46# Since: 1.5
47##
Amarnath Vallurif4ede812017-09-29 14:10:20 +030048{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] }
Markus Armbruster3859b6c2017-08-24 21:14:03 +020049
50##
51# @query-tpm-types:
52#
53# Return a list of supported TPM types
54#
55# Returns: a list of TpmType
56#
57# Since: 1.5
58#
59# Example:
60#
61# -> { "execute": "query-tpm-types" }
Amarnath Vallurif4ede812017-09-29 14:10:20 +030062# <- { "return": [ "passthrough", "emulator" ] }
Markus Armbruster3859b6c2017-08-24 21:14:03 +020063#
64##
65{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
66
67##
68# @TPMPassthroughOptions:
69#
70# Information about the TPM passthrough type
71#
72# @path: string describing the path used for accessing the TPM device
73#
74# @cancel-path: string showing the TPM's sysfs cancel file
75# for cancellation of TPM commands while they are executing
76#
77# Since: 1.5
78##
79{ 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
80 '*cancel-path' : 'str'} }
81
82##
Amarnath Vallurif4ede812017-09-29 14:10:20 +030083# @TPMEmulatorOptions:
84#
85# Information about the TPM emulator type
86#
87# @chardev: Name of a unix socket chardev
88#
89# Since: 2.11
90##
91{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' } }
92
93##
Markus Armbruster3859b6c2017-08-24 21:14:03 +020094# @TpmTypeOptions:
95#
96# A union referencing different TPM backend types' configuration options
97#
98# @type: 'passthrough' The configuration options for the TPM passthrough type
Amarnath Vallurif4ede812017-09-29 14:10:20 +030099# 'emulator' The configuration options for TPM emulator backend type
Markus Armbruster3859b6c2017-08-24 21:14:03 +0200100#
101# Since: 1.5
102##
103{ 'union': 'TpmTypeOptions',
Amarnath Vallurif4ede812017-09-29 14:10:20 +0300104 'data': { 'passthrough' : 'TPMPassthroughOptions',
105 'emulator': 'TPMEmulatorOptions' } }
Markus Armbruster3859b6c2017-08-24 21:14:03 +0200106
107##
108# @TPMInfo:
109#
110# Information about the TPM
111#
112# @id: The Id of the TPM
113#
114# @model: The TPM frontend model
115#
116# @options: The TPM (backend) type configuration options
117#
118# Since: 1.5
119##
120{ 'struct': 'TPMInfo',
121 'data': {'id': 'str',
122 'model': 'TpmModel',
123 'options': 'TpmTypeOptions' } }
124
125##
126# @query-tpm:
127#
128# Return information about the TPM device
129#
130# Returns: @TPMInfo on success
131#
132# Since: 1.5
133#
134# Example:
135#
136# -> { "execute": "query-tpm" }
137# <- { "return":
138# [
139# { "model": "tpm-tis",
140# "options":
141# { "type": "passthrough",
142# "data":
143# { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
144# "path": "/dev/tpm0"
145# }
146# },
147# "id": "tpm0"
148# }
149# ]
150# }
151#
152##
153{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }