aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm
diff options
context:
space:
mode:
authorAmarnath Valluri <amarnath.valluri@intel.com>2017-09-29 14:10:16 +0300
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-10-13 07:34:33 -0400
commit93330cf542b920b6ea5fea8120a08b76bb353113 (patch)
tree8450f62f15427f279ea4257877d6ce91a062fcab /hw/tpm
parentf35fe5cb97bbdaa6a6967f2fefc3fc1f79680601 (diff)
tpm-backend: Made few interface methods optional
This allows backend implementations left optional interface methods. For mandatory methods assertion checks added. Took the opportunity to remove unused methods: - tpm_backend_get_desc() - TPMDriverOps->handle_startup_error Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-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 'hw/tpm')
-rw-r--r--hw/tpm/tpm_passthrough.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 815a72ef9a..4c21e52b7c 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -54,7 +54,6 @@ struct TPMPassthruState {
bool tpm_executing;
bool tpm_op_canceled;
int cancel_fd;
- bool had_startup_error;
TPMVersion tpm_version;
};
@@ -227,29 +226,11 @@ static void tpm_passthrough_handle_request(TPMBackend *tb, TPMBackendCmd cmd)
}
}
-/*
- * Start the TPM (thread). If it had been started before, then terminate
- * and start it again.
- */
-static int tpm_passthrough_startup_tpm(TPMBackend *tb)
-{
- return 0;
-}
-
static void tpm_passthrough_reset(TPMBackend *tb)
{
- TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
-
DPRINTF("tpm_passthrough: CALL TO TPM_RESET!\n");
tpm_passthrough_cancel_cmd(tb);
-
- tpm_pt->had_startup_error = false;
-}
-
-static int tpm_passthrough_init(TPMBackend *tb)
-{
- return 0;
}
static bool tpm_passthrough_get_tpm_established_flag(TPMBackend *tb)
@@ -264,13 +245,6 @@ static int tpm_passthrough_reset_tpm_established_flag(TPMBackend *tb,
return 0;
}
-static bool tpm_passthrough_get_startup_error(TPMBackend *tb)
-{
- TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
-
- return tpm_pt->had_startup_error;
-}
-
static size_t tpm_passthrough_realloc_buffer(TPMSizedBuffer *sb)
{
size_t wanted_size = 4096; /* Linux tpm.c buffer size */
@@ -309,11 +283,6 @@ static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
}
}
-static const char *tpm_passthrough_create_desc(void)
-{
- return "Passthrough TPM backend driver";
-}
-
static TPMVersion tpm_passthrough_get_tpm_version(TPMBackend *tb)
{
TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
@@ -453,13 +422,10 @@ static const QemuOptDesc tpm_passthrough_cmdline_opts[] = {
static const TPMDriverOps tpm_passthrough_driver = {
.type = TPM_TYPE_PASSTHROUGH,
.opts = tpm_passthrough_cmdline_opts,
- .desc = tpm_passthrough_create_desc,
+ .desc = "Passthrough TPM backend driver",
.create = tpm_passthrough_create,
- .init = tpm_passthrough_init,
- .startup_tpm = tpm_passthrough_startup_tpm,
.realloc_buffer = tpm_passthrough_realloc_buffer,
.reset = tpm_passthrough_reset,
- .had_startup_error = tpm_passthrough_get_startup_error,
.cancel_cmd = tpm_passthrough_cancel_cmd,
.get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag,
.reset_tpm_established_flag = tpm_passthrough_reset_tpm_established_flag,