nfsd4: typo logical vs bitwise negate for want_mask
[linux-btrfs-devel.git] / arch / x86 / include / asm / xen / pci.h
blob968d57dd54c9d19ed0a93cb3be6633d3328dc4e7
1 #ifndef _ASM_X86_XEN_PCI_H
2 #define _ASM_X86_XEN_PCI_H
4 #if defined(CONFIG_PCI_XEN)
5 extern int __init pci_xen_init(void);
6 extern int __init pci_xen_hvm_init(void);
7 #define pci_xen 1
8 #else
9 #define pci_xen 0
10 #define pci_xen_init (0)
11 static inline int pci_xen_hvm_init(void)
13 return -1;
15 #endif
16 #if defined(CONFIG_XEN_DOM0)
17 int __init pci_xen_initial_domain(void);
18 int xen_find_device_domain_owner(struct pci_dev *dev);
19 int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
20 int xen_unregister_device_domain_owner(struct pci_dev *dev);
21 #else
22 static inline int __init pci_xen_initial_domain(void)
24 return -1;
26 static inline int xen_find_device_domain_owner(struct pci_dev *dev)
28 return -1;
30 static inline int xen_register_device_domain_owner(struct pci_dev *dev,
31 uint16_t domain)
33 return -1;
35 static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
37 return -1;
39 #endif
41 #if defined(CONFIG_PCI_MSI)
42 #if defined(CONFIG_PCI_XEN)
43 /* The drivers/pci/xen-pcifront.c sets this structure to
44 * its own functions.
46 struct xen_pci_frontend_ops {
47 int (*enable_msi)(struct pci_dev *dev, int vectors[]);
48 void (*disable_msi)(struct pci_dev *dev);
49 int (*enable_msix)(struct pci_dev *dev, int vectors[], int nvec);
50 void (*disable_msix)(struct pci_dev *dev);
53 extern struct xen_pci_frontend_ops *xen_pci_frontend;
55 static inline int xen_pci_frontend_enable_msi(struct pci_dev *dev,
56 int vectors[])
58 if (xen_pci_frontend && xen_pci_frontend->enable_msi)
59 return xen_pci_frontend->enable_msi(dev, vectors);
60 return -ENODEV;
62 static inline void xen_pci_frontend_disable_msi(struct pci_dev *dev)
64 if (xen_pci_frontend && xen_pci_frontend->disable_msi)
65 xen_pci_frontend->disable_msi(dev);
67 static inline int xen_pci_frontend_enable_msix(struct pci_dev *dev,
68 int vectors[], int nvec)
70 if (xen_pci_frontend && xen_pci_frontend->enable_msix)
71 return xen_pci_frontend->enable_msix(dev, vectors, nvec);
72 return -ENODEV;
74 static inline void xen_pci_frontend_disable_msix(struct pci_dev *dev)
76 if (xen_pci_frontend && xen_pci_frontend->disable_msix)
77 xen_pci_frontend->disable_msix(dev);
79 #endif /* CONFIG_PCI_XEN */
80 #endif /* CONFIG_PCI_MSI */
82 #endif /* _ASM_X86_XEN_PCI_H */