Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / char / tpm / tpm_ftpm_tee.h
blobf98daa7bf68cf6c78e3249cd391cfc15bf3c9963
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) Microsoft Corporation
4 */
6 #ifndef __TPM_FTPM_TEE_H__
7 #define __TPM_FTPM_TEE_H__
9 #include <linux/tee_drv.h>
10 #include <linux/tpm.h>
11 #include <linux/uuid.h>
13 /* The TAFs ID implemented in this TA */
14 #define FTPM_OPTEE_TA_SUBMIT_COMMAND (0)
15 #define FTPM_OPTEE_TA_EMULATE_PPI (1)
17 /* max. buffer size supported by fTPM */
18 #define MAX_COMMAND_SIZE 4096
19 #define MAX_RESPONSE_SIZE 4096
21 /**
22 * struct ftpm_tee_private - fTPM's private data
23 * @chip: struct tpm_chip instance registered with tpm framework.
24 * @state: internal state
25 * @session: fTPM TA session identifier.
26 * @resp_len: cached response buffer length.
27 * @resp_buf: cached response buffer.
28 * @ctx: TEE context handler.
29 * @shm: Memory pool shared with fTPM TA in TEE.
31 struct ftpm_tee_private {
32 struct tpm_chip *chip;
33 u32 session;
34 size_t resp_len;
35 u8 resp_buf[MAX_RESPONSE_SIZE];
36 struct tee_context *ctx;
37 struct tee_shm *shm;
40 #endif /* __TPM_FTPM_TEE_H__ */