tpm-dev.h 776 B

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