diff options
Diffstat (limited to 'src/security/tpm/tis.h')
-rw-r--r-- | src/security/tpm/tis.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h index 04a137f12e..b6a258f491 100644 --- a/src/security/tpm/tis.h +++ b/src/security/tpm/tis.h @@ -34,25 +34,6 @@ enum tis_status { }; /* - * tis_init() - * - * Initialize the TPM device. Returns 0 on success or -1 on - * failure (in case device probing did not succeed). - */ -int tis_init(void); - -/* - * tis_open() - * - * Requests access to locality 0 for the caller. - * - * Returns 0 on success, -1 on failure. - */ -int tis_open(void); - -/* - * tis_sendrecv() - * * Send the requested data to the TPM and then try to get its response * * @sendbuf - buffer of the data to send @@ -63,8 +44,19 @@ int tis_open(void); * Returns 0 on success (and places the number of response bytes at recv_len) * or -1 on failure. */ -int tis_sendrecv(const u8 *sendbuf, size_t send_size, u8 *recvbuf, - size_t *recv_len); +typedef int (*tis_sendrecv_fn)(const u8 *sendbuf, size_t send_size, u8 *recvbuf, + size_t *recv_len); + +/* + * tis_probe() + * + * Probe for the TPM device and set it up for use within locality 0. Returns + * pointer to send-receive function on success or NULL on failure. + * + * Do not call this explicitly, it's meant to be used exclusively by TSS + * implementation (tlcl_lib_init() function to be specific). + */ +tis_sendrecv_fn tis_probe(void); /* TODO: This is supposed to be used only for Google TPM. Consider moving this to drivers/tpm/cr50.h. */ |