ia64/xen-unstable

view linux-2.6-xen-sparse/drivers/xen/tpmback/common.h @ 14100:e47738923a05

[LINUX] Purge include <linux/config.h>. It has been obsolete for some time now.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Fri Feb 23 16:56:45 2007 +0000 (2007-02-23)
parents d275951acf10
children
line source
1 /******************************************************************************
2 * drivers/xen/tpmback/common.h
3 */
5 #ifndef __TPM__BACKEND__COMMON_H__
6 #define __TPM__BACKEND__COMMON_H__
8 #include <linux/version.h>
9 #include <linux/module.h>
10 #include <linux/interrupt.h>
11 #include <linux/slab.h>
12 #include <xen/evtchn.h>
13 #include <xen/driver_util.h>
14 #include <xen/interface/grant_table.h>
15 #include <xen/interface/io/tpmif.h>
16 #include <asm/io.h>
17 #include <asm/pgalloc.h>
19 #define DPRINTK(_f, _a...) \
20 pr_debug("(file=%s, line=%d) " _f, \
21 __FILE__ , __LINE__ , ## _a )
23 struct backend_info;
25 typedef struct tpmif_st {
26 struct list_head tpmif_list;
27 /* Unique identifier for this interface. */
28 domid_t domid;
29 unsigned int handle;
31 /* Physical parameters of the comms window. */
32 unsigned int irq;
34 /* The shared rings and indexes. */
35 tpmif_tx_interface_t *tx;
36 struct vm_struct *tx_area;
38 /* Miscellaneous private stuff. */
39 enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
40 int active;
42 struct tpmif_st *hash_next;
43 struct list_head list; /* scheduling list */
44 atomic_t refcnt;
46 struct backend_info *bi;
48 grant_handle_t shmem_handle;
49 grant_ref_t shmem_ref;
50 struct page **mmap_pages;
52 char devname[20];
53 } tpmif_t;
55 void tpmif_disconnect_complete(tpmif_t * tpmif);
56 tpmif_t *tpmif_find(domid_t domid, struct backend_info *bi);
57 void tpmif_interface_init(void);
58 void tpmif_interface_exit(void);
59 void tpmif_schedule_work(tpmif_t * tpmif);
60 void tpmif_deschedule_work(tpmif_t * tpmif);
61 void tpmif_xenbus_init(void);
62 void tpmif_xenbus_exit(void);
63 int tpmif_map(tpmif_t *tpmif, unsigned long shared_page, unsigned int evtchn);
64 irqreturn_t tpmif_be_int(int irq, void *dev_id, struct pt_regs *regs);
66 long int tpmback_get_instance(struct backend_info *bi);
68 int vtpm_release_packets(tpmif_t * tpmif, int send_msgs);
71 #define tpmif_get(_b) (atomic_inc(&(_b)->refcnt))
72 #define tpmif_put(_b) \
73 do { \
74 if (atomic_dec_and_test(&(_b)->refcnt)) \
75 tpmif_disconnect_complete(_b); \
76 } while (0)
78 extern int num_frontends;
80 static inline unsigned long idx_to_kaddr(tpmif_t *t, unsigned int idx)
81 {
82 return (unsigned long)pfn_to_kaddr(page_to_pfn(t->mmap_pages[idx]));
83 }
85 #endif /* __TPMIF__BACKEND__COMMON_H__ */