Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 1 | # -*- Mode: Python -*- |
Andrea Bolognani | f7160f3 | 2020-07-29 20:50:24 +0200 | [diff] [blame] | 2 | # vim: filetype=python |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 3 | # |
| 4 | |
| 5 | ## |
| 6 | # = TPM (trusted platform module) devices |
| 7 | ## |
| 8 | |
| 9 | ## |
| 10 | # @TpmModel: |
| 11 | # |
| 12 | # An enumeration of TPM models |
| 13 | # |
| 14 | # @tpm-tis: TPM TIS model |
Marc-André Lureau | 4ab6cb4 | 2018-01-29 19:33:07 +0100 | [diff] [blame] | 15 | # @tpm-crb: TPM CRB model (since 2.12) |
Stefan Berger | 3676bc6 | 2020-01-21 10:29:32 -0500 | [diff] [blame] | 16 | # @tpm-spapr: TPM SPAPR model (since 5.0) |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 17 | # |
| 18 | # Since: 1.5 |
| 19 | ## |
Stefan Berger | 3676bc6 | 2020-01-21 10:29:32 -0500 | [diff] [blame] | 20 | { 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ] } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 21 | ## |
| 22 | # @query-tpm-models: |
| 23 | # |
| 24 | # Return a list of supported TPM models |
| 25 | # |
| 26 | # Returns: a list of TpmModel |
| 27 | # |
| 28 | # Since: 1.5 |
| 29 | # |
| 30 | # Example: |
| 31 | # |
| 32 | # -> { "execute": "query-tpm-models" } |
Stefan Berger | 3676bc6 | 2020-01-21 10:29:32 -0500 | [diff] [blame] | 33 | # <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 34 | # |
| 35 | ## |
| 36 | { 'command': 'query-tpm-models', 'returns': ['TpmModel'] } |
| 37 | |
| 38 | ## |
| 39 | # @TpmType: |
| 40 | # |
| 41 | # An enumeration of TPM types |
| 42 | # |
| 43 | # @passthrough: TPM passthrough type |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 44 | # @emulator: Software Emulator TPM type |
| 45 | # Since: 2.11 |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 46 | # |
| 47 | # Since: 1.5 |
| 48 | ## |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 49 | { 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 50 | |
| 51 | ## |
| 52 | # @query-tpm-types: |
| 53 | # |
| 54 | # Return a list of supported TPM types |
| 55 | # |
| 56 | # Returns: a list of TpmType |
| 57 | # |
| 58 | # Since: 1.5 |
| 59 | # |
| 60 | # Example: |
| 61 | # |
| 62 | # -> { "execute": "query-tpm-types" } |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 63 | # <- { "return": [ "passthrough", "emulator" ] } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 64 | # |
| 65 | ## |
| 66 | { 'command': 'query-tpm-types', 'returns': ['TpmType'] } |
| 67 | |
| 68 | ## |
| 69 | # @TPMPassthroughOptions: |
| 70 | # |
| 71 | # Information about the TPM passthrough type |
| 72 | # |
| 73 | # @path: string describing the path used for accessing the TPM device |
| 74 | # |
| 75 | # @cancel-path: string showing the TPM's sysfs cancel file |
| 76 | # for cancellation of TPM commands while they are executing |
| 77 | # |
| 78 | # Since: 1.5 |
| 79 | ## |
Marc-André Lureau | b0ddeba | 2018-12-08 15:16:04 +0400 | [diff] [blame] | 80 | { 'struct': 'TPMPassthroughOptions', |
| 81 | 'data': { '*path': 'str', |
| 82 | '*cancel-path': 'str' } } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 83 | |
| 84 | ## |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 85 | # @TPMEmulatorOptions: |
| 86 | # |
| 87 | # Information about the TPM emulator type |
| 88 | # |
| 89 | # @chardev: Name of a unix socket chardev |
| 90 | # |
| 91 | # Since: 2.11 |
| 92 | ## |
| 93 | { 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' } } |
| 94 | |
| 95 | ## |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 96 | # @TpmTypeOptions: |
| 97 | # |
| 98 | # A union referencing different TPM backend types' configuration options |
| 99 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 100 | # @type: - 'passthrough' The configuration options for the TPM passthrough type |
| 101 | # - 'emulator' The configuration options for TPM emulator backend type |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 102 | # |
| 103 | # Since: 1.5 |
| 104 | ## |
| 105 | { 'union': 'TpmTypeOptions', |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 106 | 'data': { 'passthrough' : 'TPMPassthroughOptions', |
| 107 | 'emulator': 'TPMEmulatorOptions' } } |
Markus Armbruster | 3859b6c | 2017-08-24 21:14:03 +0200 | [diff] [blame] | 108 | |
| 109 | ## |
| 110 | # @TPMInfo: |
| 111 | # |
| 112 | # Information about the TPM |
| 113 | # |
| 114 | # @id: The Id of the TPM |
| 115 | # |
| 116 | # @model: The TPM frontend model |
| 117 | # |
| 118 | # @options: The TPM (backend) type configuration options |
| 119 | # |
| 120 | # Since: 1.5 |
| 121 | ## |
| 122 | { 'struct': 'TPMInfo', |
| 123 | 'data': {'id': 'str', |
| 124 | 'model': 'TpmModel', |
| 125 | 'options': 'TpmTypeOptions' } } |
| 126 | |
| 127 | ## |
| 128 | # @query-tpm: |
| 129 | # |
| 130 | # Return information about the TPM device |
| 131 | # |
| 132 | # Returns: @TPMInfo on success |
| 133 | # |
| 134 | # Since: 1.5 |
| 135 | # |
| 136 | # Example: |
| 137 | # |
| 138 | # -> { "execute": "query-tpm" } |
| 139 | # <- { "return": |
| 140 | # [ |
| 141 | # { "model": "tpm-tis", |
| 142 | # "options": |
| 143 | # { "type": "passthrough", |
| 144 | # "data": |
| 145 | # { "cancel-path": "/sys/class/misc/tpm0/device/cancel", |
| 146 | # "path": "/dev/tpm0" |
| 147 | # } |
| 148 | # }, |
| 149 | # "id": "tpm0" |
| 150 | # } |
| 151 | # ] |
| 152 | # } |
| 153 | # |
| 154 | ## |
| 155 | { 'command': 'query-tpm', 'returns': ['TPMInfo'] } |