hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/tpm/tpm-dev.h
....@@ -2,27 +2,32 @@
22 #ifndef _TPM_DEV_H
33 #define _TPM_DEV_H
44
5
+#include <linux/poll.h>
56 #include "tpm.h"
67
78 struct file_priv {
89 struct tpm_chip *chip;
10
+ struct tpm_space *space;
911
10
- /* Data passed to and from the tpm via the read/write calls */
11
- size_t data_pending;
1212 struct mutex buffer_mutex;
13
-
1413 struct timer_list user_read_timer; /* user needs to claim result */
15
- struct work_struct work;
14
+ struct work_struct timeout_work;
15
+ struct work_struct async_work;
16
+ wait_queue_head_t async_wait;
17
+ ssize_t response_length;
18
+ bool response_read;
19
+ bool command_enqueued;
1620
1721 u8 data_buffer[TPM_BUFSIZE];
1822 };
1923
2024 void tpm_common_open(struct file *file, struct tpm_chip *chip,
21
- struct file_priv *priv);
25
+ struct file_priv *priv, struct tpm_space *space);
2226 ssize_t tpm_common_read(struct file *file, char __user *buf,
2327 size_t size, loff_t *off);
2428 ssize_t tpm_common_write(struct file *file, const char __user *buf,
25
- size_t size, loff_t *off, struct tpm_space *space);
26
-void tpm_common_release(struct file *file, struct file_priv *priv);
29
+ size_t size, loff_t *off);
30
+__poll_t tpm_common_poll(struct file *file, poll_table *wait);
2731
32
+void tpm_common_release(struct file *file, struct file_priv *priv);
2833 #endif