ia64/xen-unstable

view linux-2.6-xen-sparse/drivers/xen/pciback/pciback.h @ 10843:4f6d858ea570

[PCI] Per-device permissive flag (replaces global permissive flag).
Signed-off-by: Chris Bookholt <hap10@tycho.ncsc.mil>
author kfraser@localhost.localdomain
date Fri Jul 28 12:56:10 2006 +0100 (2006-07-28)
parents 4c97599398fe
children
line source
1 /*
2 * PCI Backend Common Data Structures & Function Declarations
3 *
4 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
5 */
6 #ifndef __XEN_PCIBACK_H__
7 #define __XEN_PCIBACK_H__
9 #include <linux/pci.h>
10 #include <linux/interrupt.h>
11 #include <xen/xenbus.h>
12 #include <linux/list.h>
13 #include <linux/spinlock.h>
14 #include <linux/workqueue.h>
15 #include <asm/atomic.h>
16 #include <xen/interface/io/pciif.h>
18 struct pci_dev_entry {
19 struct list_head list;
20 struct pci_dev *dev;
21 };
23 #define _PDEVF_op_active (0)
24 #define PDEVF_op_active (1<<(_PDEVF_op_active))
26 struct pciback_device {
27 void *pci_dev_data;
28 spinlock_t dev_lock;
30 struct xenbus_device *xdev;
32 struct xenbus_watch be_watch;
33 u8 be_watching;
35 int evtchn_irq;
37 struct vm_struct *sh_area;
38 struct xen_pci_sharedinfo *sh_info;
40 unsigned long flags;
42 struct work_struct op_work;
43 };
45 struct pciback_dev_data {
46 struct list_head config_fields;
47 int permissive;
48 int warned_on_write;
49 };
51 /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
52 struct pci_dev *pcistub_get_pci_dev_by_slot(struct pciback_device *pdev,
53 int domain, int bus,
54 int slot, int func);
55 struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
56 struct pci_dev *dev);
57 void pcistub_put_pci_dev(struct pci_dev *dev);
59 /* Ensure a device is turned off or reset */
60 void pciback_reset_device(struct pci_dev *pdev);
62 /* Access a virtual configuration space for a PCI device */
63 int pciback_config_init(void);
64 int pciback_config_init_dev(struct pci_dev *dev);
65 void pciback_config_free_dyn_fields(struct pci_dev *dev);
66 void pciback_config_reset_dev(struct pci_dev *dev);
67 void pciback_config_free_dev(struct pci_dev *dev);
68 int pciback_config_read(struct pci_dev *dev, int offset, int size,
69 u32 * ret_val);
70 int pciback_config_write(struct pci_dev *dev, int offset, int size, u32 value);
72 /* Handle requests for specific devices from the frontend */
73 typedef int (*publish_pci_root_cb) (struct pciback_device * pdev,
74 unsigned int domain, unsigned int bus);
75 int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev);
76 void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev);
77 struct pci_dev *pciback_get_pci_dev(struct pciback_device *pdev,
78 unsigned int domain, unsigned int bus,
79 unsigned int devfn);
80 int pciback_init_devices(struct pciback_device *pdev);
81 int pciback_publish_pci_roots(struct pciback_device *pdev,
82 publish_pci_root_cb cb);
83 void pciback_release_devices(struct pciback_device *pdev);
85 /* Handles events from front-end */
86 irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
87 void pciback_do_op(void *data);
89 int pciback_xenbus_register(void);
90 void pciback_xenbus_unregister(void);
92 extern int verbose_request;
93 #endif