ia64/xen-unstable

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