xref: /openbmc/linux/drivers/char/tpm/tpm-dev.h (revision fcc8487d)
1 #ifndef _TPM_DEV_H
2 #define _TPM_DEV_H
3 
4 #include "tpm.h"
5 
6 struct file_priv {
7 	struct tpm_chip *chip;
8 
9 	/* Data passed to and from the tpm via the read/write calls */
10 	atomic_t data_pending;
11 	struct mutex buffer_mutex;
12 
13 	struct timer_list user_read_timer;      /* user needs to claim result */
14 	struct work_struct work;
15 
16 	u8 data_buffer[TPM_BUFSIZE];
17 };
18 
19 void tpm_common_open(struct file *file, struct tpm_chip *chip,
20 		     struct file_priv *priv);
21 ssize_t tpm_common_read(struct file *file, char __user *buf,
22 			size_t size, loff_t *off);
23 ssize_t tpm_common_write(struct file *file, const char __user *buf,
24 			 size_t size, loff_t *off, struct tpm_space *space);
25 void tpm_common_release(struct file *file, struct file_priv *priv);
26 
27 #endif
28