- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / pcifront / pcifront.h
1 /*
2  * PCI Frontend - Common data structures & function declarations
3  *
4  *   Author: Ryan Wilson <hap9@epoch.ncsc.mil>
5  */
6 #ifndef __XEN_PCIFRONT_H__
7 #define __XEN_PCIFRONT_H__
8
9 #include <linux/slab.h>
10 #include <linux/spinlock.h>
11 #include <linux/pci.h>
12 #include <xen/xenbus.h>
13 #include <xen/interface/io/pciif.h>
14 #include <linux/interrupt.h>
15 #include <xen/pcifront.h>
16 #include <linux/atomic.h>
17 #include <linux/workqueue.h>
18
19 struct pci_bus_entry {
20         struct list_head list;
21         struct pci_bus *bus;
22 };
23
24 #define _PDEVB_op_active                (0)
25 #define PDEVB_op_active                 (1 << (_PDEVB_op_active))
26
27 struct pcifront_device {
28         struct xenbus_device *xdev;
29         struct list_head root_buses;
30         spinlock_t dev_lock;
31
32         int evtchn;
33         int gnt_ref;
34         int irq;
35
36         /* Lock this when doing any operations in sh_info */
37         spinlock_t sh_info_lock;
38         struct xen_pci_sharedinfo *sh_info;
39         struct work_struct op_work;
40         unsigned long flags;
41
42 };
43
44 int pcifront_connect(struct pcifront_device *pdev);
45 void pcifront_disconnect(struct pcifront_device *pdev);
46
47 int pcifront_scan_root(struct pcifront_device *pdev,
48                        unsigned int domain, unsigned int bus);
49 int pcifront_rescan_root(struct pcifront_device *pdev,
50                          unsigned int domain, unsigned int bus);
51 void pcifront_free_roots(struct pcifront_device *pdev);
52
53 void pcifront_do_aer(struct work_struct *data);
54
55 irqreturn_t pcifront_handler_aer(int irq, void *dev);
56
57 #endif  /* __XEN_PCIFRONT_H__ */