xref: /netbsd-src/crypto/external/cpl/trousers/dist/src/include/linux/tpm.h (revision 6a35549fad5b2fd1c761e207ab425b8626ee6251)
1 
2 /*
3  * Licensed Materials - Property of IBM
4  *
5  * trousers - An open source TCG Software Stack
6  *
7  * (C) Copyright International Business Machines Corp. 2004
8  *
9  */
10 
11 /*
12  * include/linux/tpm.h
13  *
14  * Device driver for TCPA TPM (trusted platform module).
15  */
16 #ifndef _TPM_H_
17 #define _TPM_H_
18 
19 #if (defined (__linux) || defined (linux))
20 #include <linux/ioctl.h>
21 #elif (defined (__OpenBSD__) || defined (__FreeBSD__) || defined(__NetBSD__))
22 #include <sys/ioctl.h>
23 #endif
24 
25 /* ioctl commands */
26 #define	TPMIOC_CANCEL		_IO('T', 0x00)
27 #define	TPMIOC_TRANSMIT		_IO('T', 0x01)
28 
29 #if defined(__KERNEL__)
30 extern ssize_t tpm_transmit(const char *buf, size_t bufsiz);
31 extern ssize_t tpm_extend(int index, u8 *digest);
32 extern ssize_t tpm_pcrread(int index, u8 *hash);
33 extern ssize_t tpm_dirread(int index, u8 *hash);
34 extern ssize_t tpm_cap_version(int *maj, int *min, int *ver, int *rev);
35 extern ssize_t tpm_cap_pcr(int *pcrs);
36 extern ssize_t tpm_cap_dir(int *dirs);
37 extern ssize_t tpm_cap_manufacturer(int *manufacturer);
38 extern ssize_t tpm_cap_slot(int *slots);
39 #endif /* __KERNEL__ */
40 
41 #endif
42