summaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-pciback/passthrough.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xen-pciback/passthrough.c')
-rw-r--r--drivers/xen/xen-pciback/passthrough.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/drivers/xen/xen-pciback/passthrough.c b/drivers/xen/xen-pciback/passthrough.c
index b451cb8dd2ff..1d32a9a42c01 100644
--- a/drivers/xen/xen-pciback/passthrough.c
+++ b/drivers/xen/xen-pciback/passthrough.c
@@ -16,9 +16,10 @@ struct passthrough_dev_data {
spinlock_t lock;
};
-struct pci_dev *xen_pcibk_get_pci_dev(struct xen_pcibk_device *pdev,
- unsigned int domain, unsigned int bus,
- unsigned int devfn)
+static struct pci_dev *__xen_pcibk_get_pci_dev(struct xen_pcibk_device *pdev,
+ unsigned int domain,
+ unsigned int bus,
+ unsigned int devfn)
{
struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
struct pci_dev_entry *dev_entry;
@@ -41,8 +42,9 @@ struct pci_dev *xen_pcibk_get_pci_dev(struct xen_pcibk_device *pdev,
return dev;
}
-int xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, struct pci_dev *dev,
- int devid, publish_pci_dev_cb publish_cb)
+static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
+ struct pci_dev *dev,
+ int devid, publish_pci_dev_cb publish_cb)
{
struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
struct pci_dev_entry *dev_entry;
@@ -68,8 +70,8 @@ int xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, struct pci_dev *dev,
return err;
}
-void xen_pcibk_release_pci_dev(struct xen_pcibk_device *pdev,
- struct pci_dev *dev)
+static void __xen_pcibk_release_pci_dev(struct xen_pcibk_device *pdev,
+ struct pci_dev *dev)
{
struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
struct pci_dev_entry *dev_entry, *t;
@@ -92,7 +94,7 @@ void xen_pcibk_release_pci_dev(struct xen_pcibk_device *pdev,
pcistub_put_pci_dev(found_dev);
}
-int xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
+static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
{
struct passthrough_dev_data *dev_data;
@@ -109,8 +111,8 @@ int xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
return 0;
}
-int xen_pcibk_publish_pci_roots(struct xen_pcibk_device *pdev,
- publish_pci_root_cb publish_root_cb)
+static int __xen_pcibk_publish_pci_roots(struct xen_pcibk_device *pdev,
+ publish_pci_root_cb publish_root_cb)
{
int err = 0;
struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
@@ -154,7 +156,7 @@ int xen_pcibk_publish_pci_roots(struct xen_pcibk_device *pdev,
return err;
}
-void xen_pcibk_release_devices(struct xen_pcibk_device *pdev)
+static void __xen_pcibk_release_devices(struct xen_pcibk_device *pdev)
{
struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
struct pci_dev_entry *dev_entry, *t;
@@ -169,13 +171,24 @@ void xen_pcibk_release_devices(struct xen_pcibk_device *pdev)
pdev->pci_dev_data = NULL;
}
-int xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev,
- struct xen_pcibk_device *pdev,
- unsigned int *domain, unsigned int *bus,
- unsigned int *devfn)
+static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev,
+ struct xen_pcibk_device *pdev,
+ unsigned int *domain, unsigned int *bus,
+ unsigned int *devfn)
{
*domain = pci_domain_nr(pcidev->bus);
*bus = pcidev->bus->number;
*devfn = pcidev->devfn;
return 1;
}
+
+struct xen_pcibk_backend xen_pcibk_passthrough_backend = {
+ .name = "passthrough",
+ .init = __xen_pcibk_init_devices,
+ .free = __xen_pcibk_release_devices,
+ .find = __xen_pcibk_get_pcifront_dev,
+ .publish = __xen_pcibk_publish_pci_roots,
+ .release = __xen_pcibk_release_pci_dev,
+ .add = __xen_pcibk_add_pci_dev,
+ .get = __xen_pcibk_get_pci_dev,
+};