1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __LINUX_TPM_H__
23#define __LINUX_TPM_H__
24
25
26
27
28#define TPM_ANY_NUM 0xFFFF
29
30#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
31
32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
34extern int tpm_send(u32 chip_num, void *cmd, size_t buflen);
35#else
36static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
37 return -ENODEV;
38}
39static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
40 return -ENODEV;
41}
42static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) {
43 return -ENODEV;
44}
45#endif
46#endif
47