diff options
author | Peter Maydell | 2017-10-20 11:49:55 +0200 |
---|---|---|
committer | Peter Maydell | 2017-10-20 11:49:55 +0200 |
commit | e67277f8f32d56c64c7993163f41bb4338aec566 (patch) | |
tree | 21467615f943e3bab7edc50fabe5e5626e135ed4 /include | |
parent | Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' int... (diff) | |
parent | tpm: move recv_data_callback to TPM interface (diff) | |
download | qemu-e67277f8f32d56c64c7993163f41bb4338aec566.tar.gz qemu-e67277f8f32d56c64c7993163f41bb4338aec566.tar.xz qemu-e67277f8f32d56c64c7993163f41bb4338aec566.zip |
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-19-1' into staging
Merge tpm 2017/10/19 v1
# gpg: Signature made Thu 19 Oct 2017 16:42:39 BST
# gpg: using RSA key 0x75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211
* remotes/stefanberger/tags/pull-tpm-2017-10-19-1: (21 commits)
tpm: move recv_data_callback to TPM interface
tpm: add a QOM TPM interface
tpm-tis: fold TPMTISEmuState in TPMState
tpm-tis: remove tpm_tis.h header
tpm-tis: move TPMState to TIS header
tpm: remove locty_data from TPMState
tpm-emulator: fix error handling
tpm: add TPMBackendCmd to hold the request state
tpm: remove locty argument from receive_cb
tpm: remove needless cast
tpm: remove unused TPMBackendCmd
tpm: remove configure_tpm() hop
tpm: remove init() class method
tpm: remove TPMDriverOps
tpm: move TPMSizedBuffer to tpm_tis.h
tpm: remove tpm_register_driver()
tpm: replace tpm_get_backend_driver() to drop be_drivers
tpm: lookup tpm backend class in tpm_driver_find_by_type()
tpm: make tpm_get_backend_driver() static
tpm-tis: remove RAISE_STS_IRQ
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/tpm_backend.h | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 2c798a1eb4..03ea5a3400 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -29,14 +29,14 @@ typedef struct TPMBackendClass TPMBackendClass; typedef struct TPMBackend TPMBackend; -typedef struct TPMDriverOps TPMDriverOps; -typedef void (TPMRecvDataCB)(TPMState *, uint8_t locty, bool selftest_done); - -typedef enum TPMBackendCmd { - TPM_BACKEND_CMD_INIT = 1, - TPM_BACKEND_CMD_PROCESS_CMD, - TPM_BACKEND_CMD_END, - TPM_BACKEND_CMD_TPM_RESET, + +typedef struct TPMBackendCmd { + uint8_t locty; + const uint8_t *in; + uint32_t in_len; + uint8_t *out; + uint32_t out_len; + bool selftest_done; } TPMBackendCmd; struct TPMBackend { @@ -46,7 +46,6 @@ struct TPMBackend { bool opened; TPMState *tpm_state; GThreadPool *thread_pool; - TPMRecvDataCB *recv_data_callback; bool had_startup_error; /* <public> */ @@ -59,19 +58,6 @@ struct TPMBackend { struct TPMBackendClass { ObjectClass parent_class; - const TPMDriverOps *ops; - - void (*opened)(TPMBackend *s, Error **errp); - - void (*handle_request)(TPMBackend *s, TPMBackendCmd cmd); -}; - -typedef struct TPMSizedBuffer { - uint32_t size; - uint8_t *buffer; -} TPMSizedBuffer; - -struct TPMDriverOps { enum TpmType type; const QemuOptDesc *opts; /* get a descriptive text of the backend to display to the user */ @@ -79,8 +65,6 @@ struct TPMDriverOps { TPMBackend *(*create)(QemuOpts *opts, const char *id); - /* initialize the backend */ - int (*init)(TPMBackend *t); /* start up the TPM on the backend */ int (*startup_tpm)(TPMBackend *t); @@ -95,8 +79,11 @@ struct TPMDriverOps { TPMVersion (*get_tpm_version)(TPMBackend *t); TpmTypeOptions *(*get_tpm_options)(TPMBackend *t); -}; + void (*opened)(TPMBackend *s, Error **errp); + + void (*handle_request)(TPMBackend *s, TPMBackendCmd *cmd); +}; /** * tpm_backend_get_type: @@ -116,8 +103,7 @@ enum TpmType tpm_backend_get_type(TPMBackend *s); * * Returns 0 on success. */ -int tpm_backend_init(TPMBackend *s, TPMState *state, - TPMRecvDataCB *datacb); +int tpm_backend_init(TPMBackend *s, TPMState *state); /** * tpm_backend_startup_tpm: @@ -140,11 +126,12 @@ bool tpm_backend_had_startup_error(TPMBackend *s); /** * tpm_backend_deliver_request: * @s: the backend to send the request to + * @cmd: the command to deliver * * Send a request to the backend. The backend will then send the request * to the TPM implementation. */ -void tpm_backend_deliver_request(TPMBackend *s); +void tpm_backend_deliver_request(TPMBackend *s, TPMBackendCmd *cmd); /** * tpm_backend_reset: @@ -215,8 +202,6 @@ TPMInfo *tpm_backend_query_tpm(TPMBackend *s); TPMBackend *qemu_find_tpm(const char *id); -const TPMDriverOps *tpm_get_backend_driver(const char *type); void tpm_register_model(enum TpmModel model); -void tpm_register_driver(const TPMDriverOps *tdo); #endif |