summaryrefslogtreecommitdiffstats
path: root/src/security/tpm/tis.h
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2022-10-29 20:42:28 +0300
committerFelix Held <felix-coreboot@felixheld.de>2023-11-13 14:17:38 +0000
commit963f7b9e5ec4713eb45dfb656659d2c9cf5d9f83 (patch)
tree514b17f5c5395dac6e9030d518459bf363bcebc6 /src/security/tpm/tis.h
parentbf0b06d9bd71b9e188e2a1c509f7b90ca395e164 (diff)
downloadcoreboot-963f7b9e5ec4713eb45dfb656659d2c9cf5d9f83.tar.gz
coreboot-963f7b9e5ec4713eb45dfb656659d2c9cf5d9f83.tar.bz2
coreboot-963f7b9e5ec4713eb45dfb656659d2c9cf5d9f83.zip
security/tpm/: turn tis_{init,open} into tis_probe
init() was always followed by open() and after successful initialization we only need send-receive function which is now returned by tis_probe() on success, thus further reducing number of functions to export from drivers. This also removes check for opening TIS twice that seems to have no value. Change-Id: I52ad8d69d50d449f031c36b15bf70ef07986946c Ticket: https://ticket.coreboot.org/issues/433 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76954 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/tpm/tis.h')
-rw-r--r--src/security/tpm/tis.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h
index 34dc8e8bd786..ac07bfb5c619 100644
--- a/src/security/tpm/tis.h
+++ b/src/security/tpm/tis.h
@@ -33,23 +33,6 @@ enum tis_status {
};
/*
- * tis_init()
- *
- * Initialize the TPM device.
- * Returns TSS Return Code from TCG TPM Structures. See tss_errors.h
- */
-tpm_result_t tis_init(void);
-
-/*
- * tis_open()
- *
- * Requests access to locality 0 for the caller.
- *
- * Returns TSS Return Code from TCG TPM Structures. See tss_errors.h
- */
-tpm_result_t tis_open(void);
-
-/*
* tis_sendrecv()
*
* Send the requested data to the TPM and then try to get its response
@@ -61,8 +44,19 @@ tpm_result_t tis_open(void);
*
* Returns TSS Return Code from TCG TPM Structures. See tss_errors.h
*/
-tpm_result_t tis_sendrecv(const u8 *sendbuf, size_t send_size, u8 *recvbuf,
- size_t *recv_len);
+typedef tpm_result_t (*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);
/*
* tis_vendor_write()