X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Ftpm-utils.h;h=d680d140884371e36d292395747bf4b7a7330804;hb=e731af4893f7741c66254161ad9b6f5280369895;hp=bc98d1ef8f75d3a8916bda6940c3a81a4d5e26d6;hpb=d677bfe2f7914367d1caa6146b34e86d0df1c75d;p=oweals%2Fu-boot.git diff --git a/lib/tpm-utils.h b/lib/tpm-utils.h index bc98d1ef8f..d680d14088 100644 --- a/lib/tpm-utils.h +++ b/lib/tpm-utils.h @@ -12,23 +12,11 @@ /* Internal error of TPM command library */ #define TPM_LIB_ERROR ((u32)~0u) -/** - * tpm_open() - Request access to locality 0 for the caller - * - * After all commands have been completed the caller is supposed to - * call tpm_close(). - * - * Returns 0 on success, -ve on failure. - */ -int tpm_open(struct udevice *dev); - -/** - * tpm_close() - Close the current session - * - * Releasing the locked locality. Returns 0 on success, -ve 1 on - * failure (in case lock removal did not succeed). - */ -int tpm_close(struct udevice *dev); +/* To make strings of commands more easily */ +#define __MSB(x) ((x) >> 8) +#define __LSB(x) ((x) & 0xFF) +#define tpm_u16(x) __MSB(x), __LSB(x) +#define tpm_u32(x) tpm_u16((x) >> 16), tpm_u16((x) & 0xFFFF) /** * Pack data into a byte string. The data types are specified in @@ -90,6 +78,7 @@ u32 tpm_return_code(const void *response); * is a bidirectional * @return return code of the TPM response */ -u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr); +u32 tpm_sendrecv_command(struct udevice *dev, const void *command, + void *response, size_t *size_ptr); #endif /* __TPM_UTILS_H */