2 * PCI Backend -- Configuration overlay for MSI capability
5 #include <linux/slab.h>
6 #include "conf_space.h"
7 #include "conf_space_capability.h"
8 #include <xen/interface/io/pciif.h>
11 int pciback_enable_msi(struct pciback_device *pdev,
12 struct pci_dev *dev, struct xen_pci_op *op)
14 int otherend = pdev->xdev->otherend_id;
17 status = pci_enable_msi(dev);
20 printk("error enable msi for guest %x status %x\n", otherend, status);
22 return XEN_PCI_ERR_op_failed;
29 int pciback_disable_msi(struct pciback_device *pdev,
30 struct pci_dev *dev, struct xen_pci_op *op)
38 int pciback_enable_msix(struct pciback_device *pdev,
39 struct pci_dev *dev, struct xen_pci_op *op)
42 struct msix_entry *entries;
44 if (op->value > SH_INFO_MAX_VEC)
47 entries = kmalloc(op->value * sizeof(*entries), GFP_KERNEL);
51 for (i = 0; i < op->value; i++) {
52 entries[i].entry = op->msix_entries[i].entry;
53 entries[i].vector = op->msix_entries[i].vector;
56 result = pci_enable_msix(dev, entries, op->value);
58 for (i = 0; i < op->value; i++) {
59 op->msix_entries[i].entry = entries[i].entry;
60 op->msix_entries[i].vector = entries[i].vector;
70 int pciback_disable_msix(struct pciback_device *pdev,
71 struct pci_dev *dev, struct xen_pci_op *op)
74 pci_disable_msix(dev);