tpm: Move getting TPM buffer size to backends

Rather than setting the size of the TPM buffer in the front-end,
query the backend for the size of the buffer. In this patch we
just move the hard-coded buffer size of 4096 to the backends.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Stefan Berger 2017-11-03 18:10:01 -04:00
parent d3fd953f06
commit b21e6aaf4a
5 changed files with 38 additions and 5 deletions

View file

@ -81,6 +81,8 @@ struct TPMBackendClass {
TPMVersion (*get_tpm_version)(TPMBackend *t);
size_t (*get_buffer_size)(TPMBackend *t);
TpmTypeOptions *(*get_tpm_options)(TPMBackend *t);
void (*handle_request)(TPMBackend *s, TPMBackendCmd *cmd);
@ -182,6 +184,16 @@ int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty);
*/
TPMVersion tpm_backend_get_tpm_version(TPMBackend *s);
/**
* tpm_backend_get_buffer_size:
* @s: the backend to call into
*
* Get the TPM's buffer size.
*
* Returns buffer size.
*/
size_t tpm_backend_get_buffer_size(TPMBackend *s);
/**
* tpm_backend_query_tpm:
* @s: the backend