[PATCH] riotty.c cleanups and warning fix
[powerpc.git] / drivers / char / tpm / tpm.h
index 1a94a8c..373b41f 100644 (file)
@@ -31,22 +31,32 @@ enum tpm_timeout {
 
 /* TPM addresses */
 enum tpm_addr {
+       TPM_SUPERIO_ADDR = 0x2E,
        TPM_ADDR = 0x4E,
-       TPM_DATA = 0x4F
 };
 
+extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr,
+                               char *);
+extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr,
+                               char *);
+extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr,
+                               char *);
+extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr,
+                               const char *, size_t);
 
 struct tpm_chip;
 
 struct tpm_vendor_specific {
        u8 req_complete_mask;
        u8 req_complete_val;
+       u8 req_canceled;
        u16 base;               /* TPM base address */
 
        int (*recv) (struct tpm_chip *, u8 *, size_t);
        int (*send) (struct tpm_chip *, u8 *, size_t);
        void (*cancel) (struct tpm_chip *);
        struct miscdevice miscdev;
+       struct attribute_group *attr_group;
 };
 
 struct tpm_chip {
@@ -63,28 +73,24 @@ struct tpm_chip {
 
        struct timer_list user_read_timer;      /* user needs to claim result */
        struct semaphore tpm_mutex;     /* tpm is processing */
-       struct timer_list device_timer; /* tpm is processing */
-       struct semaphore timer_manipulation_mutex;
 
        struct tpm_vendor_specific *vendor;
 
        struct list_head list;
 };
 
-static inline int tpm_read_index(int index)
+static inline int tpm_read_index(int base, int index)
 {
-       outb(index, TPM_ADDR);
-       return inb(TPM_DATA) & 0xFF;
+       outb(index, base);
+       return inb(base+1) & 0xFF;
 }
 
-static inline void tpm_write_index(int index, int value)
+static inline void tpm_write_index(int base, int index, int value)
 {
-       outb(index, TPM_ADDR);
-       outb(value & 0xFF, TPM_DATA);
+       outb(index, base);
+       outb(value & 0xFF, base+1);
 }
 
-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
-
 extern int tpm_register_hardware(struct pci_dev *,
                                 struct tpm_vendor_specific *);
 extern int tpm_open(struct inode *, struct file *);