#include <linux/module.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <xen/xenbus.h>
#include <xen/events.h>
#include <xen/grant_table.h>
#include <xen/page.h>
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <linux/msi.h>
#include <xen/interface/io/pciif.h>
#include <asm/xen/pci.h>
#include <linux/interrupt.h>
#include <linux/atomic.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <linux/time.h>
#include <linux/ktime.h>
#include <xen/platform_pci.h>
#include <asm/xen/swiotlb-xen.h>
#define INVALID_EVTCHN …
struct pci_bus_entry { … };
#define _PDEVB_op_active …
#define PDEVB_op_active …
struct pcifront_device { … };
struct pcifront_sd { … };
static inline struct pcifront_device *
pcifront_get_pdev(struct pcifront_sd *sd)
{ … }
static inline void pcifront_init_sd(struct pcifront_sd *sd,
unsigned int domain, unsigned int bus,
struct pcifront_device *pdev)
{ … }
static DEFINE_SPINLOCK(pcifront_dev_lock);
static struct pcifront_device *pcifront_dev;
static int errno_to_pcibios_err(int errno)
{ … }
static inline void schedule_pcifront_aer_op(struct pcifront_device *pdev)
{ … }
static int do_pci_op(struct pcifront_device *pdev, struct xen_pci_op *op)
{ … }
static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 *val)
{ … }
static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
{ … }
static struct pci_ops pcifront_bus_ops = …;
#ifdef CONFIG_PCI_MSI
static int pci_frontend_enable_msix(struct pci_dev *dev,
int vector[], int nvec)
{ … }
static void pci_frontend_disable_msix(struct pci_dev *dev)
{ … }
static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])
{ … }
static void pci_frontend_disable_msi(struct pci_dev *dev)
{ … }
static struct xen_pci_frontend_ops pci_frontend_ops = …;
static void pci_frontend_registrar(int enable)
{
if (enable)
xen_pci_frontend = &pci_frontend_ops;
else
xen_pci_frontend = NULL;
};
#else
static inline void pci_frontend_registrar(int enable) { };
#endif
static int pcifront_claim_resource(struct pci_dev *dev, void *data)
{ … }
static int pcifront_scan_bus(struct pcifront_device *pdev,
unsigned int domain, unsigned int bus,
struct pci_bus *b)
{ … }
static int pcifront_scan_root(struct pcifront_device *pdev,
unsigned int domain, unsigned int bus)
{ … }
static int pcifront_rescan_root(struct pcifront_device *pdev,
unsigned int domain, unsigned int bus)
{ … }
static void free_root_bus_devs(struct pci_bus *bus)
{ … }
static void pcifront_free_roots(struct pcifront_device *pdev)
{ … }
static pci_ers_result_t pcifront_common_process(int cmd,
struct pcifront_device *pdev,
pci_channel_state_t state)
{ … }
static void pcifront_do_aer(struct work_struct *data)
{ … }
static irqreturn_t pcifront_handler_aer(int irq, void *dev)
{ … }
static int pcifront_connect_and_init_dma(struct pcifront_device *pdev)
{ … }
static void pcifront_disconnect(struct pcifront_device *pdev)
{ … }
static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev)
{ … }
static void free_pdev(struct pcifront_device *pdev)
{ … }
static int pcifront_publish_info(struct pcifront_device *pdev)
{ … }
static void pcifront_connect(struct pcifront_device *pdev)
{ … }
static void pcifront_try_connect(struct pcifront_device *pdev)
{ … }
static int pcifront_try_disconnect(struct pcifront_device *pdev)
{ … }
static void pcifront_attach_devices(struct pcifront_device *pdev)
{ … }
static int pcifront_detach_devices(struct pcifront_device *pdev)
{ … }
static void pcifront_backend_changed(struct xenbus_device *xdev,
enum xenbus_state be_state)
{ … }
static int pcifront_xenbus_probe(struct xenbus_device *xdev,
const struct xenbus_device_id *id)
{ … }
static void pcifront_xenbus_remove(struct xenbus_device *xdev)
{ … }
static const struct xenbus_device_id xenpci_ids[] = …;
static struct xenbus_driver xenpci_driver = …;
static int __init pcifront_init(void)
{ … }
static void __exit pcifront_cleanup(void)
{ … }
module_init(…) …;
module_exit(pcifront_cleanup);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;