diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-10-10 00:55:55 +0200 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2017-10-19 11:42:28 -0400 |
commit | 0e43b7e61ce677e154584523943c1651779baccf (patch) | |
tree | eeabafb7cfd3f4329350731663ad9ffca20b0c55 /include/sysemu | |
parent | d1fd6b563d44a1132f8a5758f8f7bafba548502c (diff) | |
download | qemu-0e43b7e61ce677e154584523943c1651779baccf.zip |
tpm: add TPMBackendCmd to hold the request state
This simplifies a bit locality handling, and argument passing, and
could pave the way to queuing requests (if that makes sense).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r-- | include/sysemu/tpm_backend.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 9c83a512e1..3bb90be3de 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -30,7 +30,16 @@ typedef struct TPMBackendClass TPMBackendClass; typedef struct TPMBackend TPMBackend; -typedef void (TPMRecvDataCB)(TPMState *, bool selftest_done); +typedef void (TPMRecvDataCB)(TPMState *); + +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 { Object parent; @@ -76,7 +85,7 @@ struct TPMBackendClass { void (*opened)(TPMBackend *s, Error **errp); - void (*handle_request)(TPMBackend *s); + void (*handle_request)(TPMBackend *s, TPMBackendCmd *cmd); }; /** @@ -121,11 +130,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: |