diff options
Diffstat (limited to 'include/linux/tpm.h')
-rw-r--r-- | include/linux/tpm.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 8350c538b486..706e63eea080 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #define TPM_ANY_NUM 0xFFFF | 30 | #define TPM_ANY_NUM 0xFFFF |
31 | 31 | ||
32 | struct tpm_chip; | 32 | struct tpm_chip; |
33 | struct trusted_key_payload; | ||
34 | struct trusted_key_options; | ||
33 | 35 | ||
34 | struct tpm_class_ops { | 36 | struct tpm_class_ops { |
35 | const u8 req_complete_mask; | 37 | const u8 req_complete_mask; |
@@ -46,11 +48,22 @@ struct tpm_class_ops { | |||
46 | 48 | ||
47 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 49 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
48 | 50 | ||
51 | extern int tpm_is_tpm2(u32 chip_num); | ||
49 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 52 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
50 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 53 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
51 | extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); | 54 | extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); |
52 | extern int tpm_get_random(u32 chip_num, u8 *data, size_t max); | 55 | extern int tpm_get_random(u32 chip_num, u8 *data, size_t max); |
56 | extern int tpm_seal_trusted(u32 chip_num, | ||
57 | struct trusted_key_payload *payload, | ||
58 | struct trusted_key_options *options); | ||
59 | extern int tpm_unseal_trusted(u32 chip_num, | ||
60 | struct trusted_key_payload *payload, | ||
61 | struct trusted_key_options *options); | ||
53 | #else | 62 | #else |
63 | static inline int tpm_is_tpm2(u32 chip_num) | ||
64 | { | ||
65 | return -ENODEV; | ||
66 | } | ||
54 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | 67 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { |
55 | return -ENODEV; | 68 | return -ENODEV; |
56 | } | 69 | } |
@@ -63,5 +76,18 @@ static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) { | |||
63 | static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) { | 76 | static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) { |
64 | return -ENODEV; | 77 | return -ENODEV; |
65 | } | 78 | } |
79 | |||
80 | static inline int tpm_seal_trusted(u32 chip_num, | ||
81 | struct trusted_key_payload *payload, | ||
82 | struct trusted_key_options *options) | ||
83 | { | ||
84 | return -ENODEV; | ||
85 | } | ||
86 | static inline int tpm_unseal_trusted(u32 chip_num, | ||
87 | struct trusted_key_payload *payload, | ||
88 | struct trusted_key_options *options) | ||
89 | { | ||
90 | return -ENODEV; | ||
91 | } | ||
66 | #endif | 92 | #endif |
67 | #endif | 93 | #endif |