tpm-dev.h 739 B

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