diff options
Diffstat (limited to 'drivers/char/tpm/tpm.h')
-rw-r--r-- | drivers/char/tpm/tpm.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 373b41f6b460..159882ca69dd 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -19,11 +19,11 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/version.h> | ||
23 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
24 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
25 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
26 | #include <linux/miscdevice.h> | 25 | #include <linux/miscdevice.h> |
26 | #include <linux/platform_device.h> | ||
27 | 27 | ||
28 | enum tpm_timeout { | 28 | enum tpm_timeout { |
29 | TPM_TIMEOUT = 5, /* msecs */ | 29 | TPM_TIMEOUT = 5, /* msecs */ |
@@ -50,17 +50,22 @@ struct tpm_vendor_specific { | |||
50 | u8 req_complete_mask; | 50 | u8 req_complete_mask; |
51 | u8 req_complete_val; | 51 | u8 req_complete_val; |
52 | u8 req_canceled; | 52 | u8 req_canceled; |
53 | u16 base; /* TPM base address */ | 53 | void __iomem *iobase; /* ioremapped address */ |
54 | unsigned long base; /* TPM base address */ | ||
55 | |||
56 | int region_size; | ||
57 | int have_region; | ||
54 | 58 | ||
55 | int (*recv) (struct tpm_chip *, u8 *, size_t); | 59 | int (*recv) (struct tpm_chip *, u8 *, size_t); |
56 | int (*send) (struct tpm_chip *, u8 *, size_t); | 60 | int (*send) (struct tpm_chip *, u8 *, size_t); |
57 | void (*cancel) (struct tpm_chip *); | 61 | void (*cancel) (struct tpm_chip *); |
62 | u8 (*status) (struct tpm_chip *); | ||
58 | struct miscdevice miscdev; | 63 | struct miscdevice miscdev; |
59 | struct attribute_group *attr_group; | 64 | struct attribute_group *attr_group; |
60 | }; | 65 | }; |
61 | 66 | ||
62 | struct tpm_chip { | 67 | struct tpm_chip { |
63 | struct pci_dev *pci_dev; /* PCI device stuff */ | 68 | struct device *dev; /* Device stuff */ |
64 | 69 | ||
65 | int dev_num; /* /dev/tpm# */ | 70 | int dev_num; /* /dev/tpm# */ |
66 | int num_opens; /* only one allowed */ | 71 | int num_opens; /* only one allowed */ |
@@ -72,6 +77,7 @@ struct tpm_chip { | |||
72 | struct semaphore buffer_mutex; | 77 | struct semaphore buffer_mutex; |
73 | 78 | ||
74 | struct timer_list user_read_timer; /* user needs to claim result */ | 79 | struct timer_list user_read_timer; /* user needs to claim result */ |
80 | struct work_struct work; | ||
75 | struct semaphore tpm_mutex; /* tpm is processing */ | 81 | struct semaphore tpm_mutex; /* tpm is processing */ |
76 | 82 | ||
77 | struct tpm_vendor_specific *vendor; | 83 | struct tpm_vendor_specific *vendor; |
@@ -91,13 +97,13 @@ static inline void tpm_write_index(int base, int index, int value) | |||
91 | outb(value & 0xFF, base+1); | 97 | outb(value & 0xFF, base+1); |
92 | } | 98 | } |
93 | 99 | ||
94 | extern int tpm_register_hardware(struct pci_dev *, | 100 | extern int tpm_register_hardware(struct device *, |
95 | struct tpm_vendor_specific *); | 101 | struct tpm_vendor_specific *); |
96 | extern int tpm_open(struct inode *, struct file *); | 102 | extern int tpm_open(struct inode *, struct file *); |
97 | extern int tpm_release(struct inode *, struct file *); | 103 | extern int tpm_release(struct inode *, struct file *); |
98 | extern ssize_t tpm_write(struct file *, const char __user *, size_t, | 104 | extern ssize_t tpm_write(struct file *, const char __user *, size_t, |
99 | loff_t *); | 105 | loff_t *); |
100 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); | 106 | extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); |
101 | extern void __devexit tpm_remove(struct pci_dev *); | 107 | extern void tpm_remove_hardware(struct device *); |
102 | extern int tpm_pm_suspend(struct pci_dev *, pm_message_t); | 108 | extern int tpm_pm_suspend(struct device *, pm_message_t); |
103 | extern int tpm_pm_resume(struct pci_dev *); | 109 | extern int tpm_pm_resume(struct device *); |