diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2013-11-26 15:30:43 -0500 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2014-01-06 08:37:25 -0500 |
commit | 01ad1fa75dd243909d62dba25a93254b20d5fe81 (patch) | |
tree | f7a09e61ead8f9e0a1002dde7e53d0376b8b3c19 /include/linux/tpm.h | |
parent | 1e3b73a95793555860512008035f6822406a2a79 (diff) |
tpm: Create a tpm_class_ops structure and use it in the drivers
This replaces the static initialization of a tpm_vendor_specific
structure in the drivers with the standard Linux idiom of providing
a const structure of function pointers.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
Reviewed-by: Ashley Lai <adlai@linux.vnet.ibm.com>
[phuewe: did apply manually due to commit
191ffc6bde3 tpm/tpm_i2c_atmel: fix coccinelle warnings]
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'include/linux/tpm.h')
-rw-r--r-- | include/linux/tpm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 9a9051bb1a03..fff1d0976f80 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -29,6 +29,18 @@ | |||
29 | */ | 29 | */ |
30 | #define TPM_ANY_NUM 0xFFFF | 30 | #define TPM_ANY_NUM 0xFFFF |
31 | 31 | ||
32 | struct tpm_chip; | ||
33 | |||
34 | struct tpm_class_ops { | ||
35 | const u8 req_complete_mask; | ||
36 | const u8 req_complete_val; | ||
37 | bool (*req_canceled)(struct tpm_chip *chip, u8 status); | ||
38 | int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
39 | int (*send) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
40 | void (*cancel) (struct tpm_chip *chip); | ||
41 | u8 (*status) (struct tpm_chip *chip); | ||
42 | }; | ||
43 | |||
32 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 44 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
33 | 45 | ||
34 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 46 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |