20 #include <linux/pci.h>
26 #include <asm/xen/hypervisor.h>
27 #include <asm/xen/hypercall.h>
28 #include "../pci/pci.h"
32 static int xen_add_device(
struct device *
dev)
37 struct pci_dev *physfn = pci_dev->physfn;
40 if (pci_seg_supported) {
43 .bus = pci_dev->
bus->number,
44 .devfn = pci_dev->
devfn
61 handle = DEVICE_ACPI_HANDLE(&pci_dev->
dev);
62 if (!handle && pci_dev->
bus->bridge)
63 handle = DEVICE_ACPI_HANDLE(pci_dev->
bus->bridge);
66 handle = DEVICE_ACPI_HANDLE(physfn->
bus->bridge);
72 unsigned long long pxm;
89 pci_seg_supported =
false;
97 .
bus = pci_dev->
bus->number,
98 .devfn = pci_dev->
devfn,
100 .physfn.bus = physfn->
bus->number,
101 .physfn.devfn = physfn->
devfn,
110 .
bus = pci_dev->
bus->number,
111 .devfn = pci_dev->
devfn,
119 .
bus = pci_dev->
bus->number,
120 .devfn = pci_dev->
devfn,
130 static int xen_remove_device(
struct device *dev)
135 if (pci_seg_supported) {
138 .bus = pci_dev->
bus->number,
139 .devfn = pci_dev->
devfn
148 .
bus = pci_dev->
bus->number,
149 .devfn = pci_dev->
devfn
167 r = xen_add_device(dev);
170 r = xen_remove_device(dev);
176 dev_err(dev,
"Failed to %s - passthrough or MSI/MSI-X might fail!\n",
183 .notifier_call = xen_pci_notifier,
186 static int __init register_xen_pci_notifier(
void)