mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 21:24:00 +08:00
54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
|
#ifndef _ASM_X86_XEN_PCI_H
|
||
|
#define _ASM_X86_XEN_PCI_H
|
||
|
|
||
|
#if defined(CONFIG_PCI_XEN)
|
||
|
extern int __init pci_xen_init(void);
|
||
|
#define pci_xen 1
|
||
|
#else
|
||
|
#define pci_xen 0
|
||
|
#define pci_xen_init (0)
|
||
|
#endif
|
||
|
|
||
|
#if defined(CONFIG_PCI_MSI)
|
||
|
#if defined(CONFIG_PCI_XEN)
|
||
|
/* The drivers/pci/xen-pcifront.c sets this structure to
|
||
|
* its own functions.
|
||
|
*/
|
||
|
struct xen_pci_frontend_ops {
|
||
|
int (*enable_msi)(struct pci_dev *dev, int **vectors);
|
||
|
void (*disable_msi)(struct pci_dev *dev);
|
||
|
int (*enable_msix)(struct pci_dev *dev, int **vectors, int nvec);
|
||
|
void (*disable_msix)(struct pci_dev *dev);
|
||
|
};
|
||
|
|
||
|
extern struct xen_pci_frontend_ops *xen_pci_frontend;
|
||
|
|
||
|
static inline int xen_pci_frontend_enable_msi(struct pci_dev *dev,
|
||
|
int **vectors)
|
||
|
{
|
||
|
if (xen_pci_frontend && xen_pci_frontend->enable_msi)
|
||
|
return xen_pci_frontend->enable_msi(dev, vectors);
|
||
|
return -ENODEV;
|
||
|
}
|
||
|
static inline void xen_pci_frontend_disable_msi(struct pci_dev *dev)
|
||
|
{
|
||
|
if (xen_pci_frontend && xen_pci_frontend->disable_msi)
|
||
|
xen_pci_frontend->disable_msi(dev);
|
||
|
}
|
||
|
static inline int xen_pci_frontend_enable_msix(struct pci_dev *dev,
|
||
|
int **vectors, int nvec)
|
||
|
{
|
||
|
if (xen_pci_frontend && xen_pci_frontend->enable_msix)
|
||
|
return xen_pci_frontend->enable_msix(dev, vectors, nvec);
|
||
|
return -ENODEV;
|
||
|
}
|
||
|
static inline void xen_pci_frontend_disable_msix(struct pci_dev *dev)
|
||
|
{
|
||
|
if (xen_pci_frontend && xen_pci_frontend->disable_msix)
|
||
|
xen_pci_frontend->disable_msix(dev);
|
||
|
}
|
||
|
#endif /* CONFIG_PCI_XEN */
|
||
|
#endif /* CONFIG_PCI_MSI */
|
||
|
|
||
|
#endif /* _ASM_X86_XEN_PCI_H */
|