aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tpm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tpm.h')
-rw-r--r--include/linux/tpm.h26
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
32struct tpm_chip; 32struct tpm_chip;
33struct trusted_key_payload;
34struct trusted_key_options;
33 35
34struct tpm_class_ops { 36struct 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
51extern int tpm_is_tpm2(u32 chip_num);
49extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 52extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
50extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); 53extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
51extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); 54extern int tpm_send(u32 chip_num, void *cmd, size_t buflen);
52extern int tpm_get_random(u32 chip_num, u8 *data, size_t max); 55extern int tpm_get_random(u32 chip_num, u8 *data, size_t max);
56extern int tpm_seal_trusted(u32 chip_num,
57 struct trusted_key_payload *payload,
58 struct trusted_key_options *options);
59extern int tpm_unseal_trusted(u32 chip_num,
60 struct trusted_key_payload *payload,
61 struct trusted_key_options *options);
53#else 62#else
63static inline int tpm_is_tpm2(u32 chip_num)
64{
65 return -ENODEV;
66}
54static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { 67static 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) {
63static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) { 76static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) {
64 return -ENODEV; 77 return -ENODEV;
65} 78}
79
80static 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}
86static 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