# -*- Mode: Python -*-
+# vim: filetype=python
#
##
# An enumeration of TPM models
#
# @tpm-tis: TPM TIS model
+#
# @tpm-crb: TPM CRB model (since 2.12)
+#
# @tpm-spapr: TPM SPAPR model (since 5.0)
#
# Since: 1.5
##
-{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ] }
+{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
+ 'if': 'CONFIG_TPM' }
+
##
# @query-tpm-models:
#
#
# -> { "execute": "query-tpm-models" }
# <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
-#
##
-{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
+{ 'command': 'query-tpm-models', 'returns': ['TpmModel'],
+ 'if': 'CONFIG_TPM' }
##
# @TpmType:
# An enumeration of TPM types
#
# @passthrough: TPM passthrough type
-# @emulator: Software Emulator TPM type
-# Since: 2.11
+#
+# @emulator: Software Emulator TPM type (since 2.11)
#
# Since: 1.5
##
-{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] }
+{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
+ 'if': 'CONFIG_TPM' }
##
# @query-tpm-types:
#
# -> { "execute": "query-tpm-types" }
# <- { "return": [ "passthrough", "emulator" ] }
-#
##
-{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
+{ 'command': 'query-tpm-types', 'returns': ['TpmType'],
+ 'if': 'CONFIG_TPM' }
##
# @TPMPassthroughOptions:
#
# @path: string describing the path used for accessing the TPM device
#
-# @cancel-path: string showing the TPM's sysfs cancel file
-# for cancellation of TPM commands while they are executing
+# @cancel-path: string showing the TPM's sysfs cancel file for
+# cancellation of TPM commands while they are executing
#
# Since: 1.5
##
{ 'struct': 'TPMPassthroughOptions',
'data': { '*path': 'str',
- '*cancel-path': 'str' } }
+ '*cancel-path': 'str' },
+ 'if': 'CONFIG_TPM' }
##
# @TPMEmulatorOptions:
#
# Since: 2.11
##
-{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' } }
+{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
+ 'if': 'CONFIG_TPM' }
+
+##
+# @TPMPassthroughOptionsWrapper:
+#
+# Since: 1.5
+##
+{ 'struct': 'TPMPassthroughOptionsWrapper',
+ 'data': { 'data': 'TPMPassthroughOptions' },
+ 'if': 'CONFIG_TPM' }
+
+##
+# @TPMEmulatorOptionsWrapper:
+#
+# Since: 2.11
+##
+{ 'struct': 'TPMEmulatorOptionsWrapper',
+ 'data': { 'data': 'TPMEmulatorOptions' },
+ 'if': 'CONFIG_TPM' }
##
# @TpmTypeOptions:
#
-# A union referencing different TPM backend types' configuration options
+# A union referencing different TPM backend types' configuration
+# options
#
-# @type: - 'passthrough' The configuration options for the TPM passthrough type
-# - 'emulator' The configuration options for TPM emulator backend type
+# @type:
+# - 'passthrough' The configuration options for the TPM
+# passthrough type
+# - 'emulator' The configuration options for TPM emulator backend
+# type
#
# Since: 1.5
##
{ 'union': 'TpmTypeOptions',
- 'data': { 'passthrough' : 'TPMPassthroughOptions',
- 'emulator': 'TPMEmulatorOptions' } }
+ 'base': { 'type': 'TpmType' },
+ 'discriminator': 'type',
+ 'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
+ 'emulator': 'TPMEmulatorOptionsWrapper' },
+ 'if': 'CONFIG_TPM' }
##
# @TPMInfo:
{ 'struct': 'TPMInfo',
'data': {'id': 'str',
'model': 'TpmModel',
- 'options': 'TpmTypeOptions' } }
+ 'options': 'TpmTypeOptions' },
+ 'if': 'CONFIG_TPM' }
##
# @query-tpm:
# }
# ]
# }
-#
##
-{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
+{ 'command': 'query-tpm', 'returns': ['TPMInfo'],
+ 'if': 'CONFIG_TPM' }