WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 04/13] Removed MSI capability in the pci-back driver.

Currently the tree does not have the Xen MSI capability. Will re-introduce
when the capability exists.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/pciback/Makefile                    |    1 -
 drivers/xen/pciback/conf_space_capability_msi.c |   79 -----------------------
 drivers/xen/pciback/pci_stub.c                  |   18 -----
 drivers/xen/pciback/pciback.h                   |   14 ----
 drivers/xen/pciback/pciback_ops.c               |   14 ----
 5 files changed, 0 insertions(+), 126 deletions(-)
 delete mode 100644 drivers/xen/pciback/conf_space_capability_msi.c

diff --git a/drivers/xen/pciback/Makefile b/drivers/xen/pciback/Makefile
index 106dae7..a99bdaa 100644
--- a/drivers/xen/pciback/Makefile
+++ b/drivers/xen/pciback/Makefile
@@ -6,7 +6,6 @@ pciback-y += conf_space.o conf_space_header.o \
             conf_space_capability_vpd.o \
             conf_space_capability_pm.o \
              conf_space_quirks.o
-pciback-$(CONFIG_PCI_MSI) += conf_space_capability_msi.o
 pciback-$(CONFIG_XEN_PCIDEV_BACKEND_VPCI) += vpci.o
 pciback-$(CONFIG_XEN_PCIDEV_BACKEND_SLOT) += slot.o
 pciback-$(CONFIG_XEN_PCIDEV_BACKEND_PASS) += passthrough.o
diff --git a/drivers/xen/pciback/conf_space_capability_msi.c 
b/drivers/xen/pciback/conf_space_capability_msi.c
deleted file mode 100644
index 762e396..0000000
--- a/drivers/xen/pciback/conf_space_capability_msi.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * PCI Backend -- Configuration overlay for MSI capability
- */
-#include <linux/pci.h>
-#include <linux/slab.h>
-#include "conf_space.h"
-#include "conf_space_capability.h"
-#include <xen/interface/io/pciif.h>
-#include "pciback.h"
-
-int pciback_enable_msi(struct pciback_device *pdev,
-               struct pci_dev *dev, struct xen_pci_op *op)
-{
-       int otherend = pdev->xdev->otherend_id;
-       int status;
-
-       status = pci_enable_msi(dev);
-
-       if (status) {
-               printk("error enable msi for guest %x status %x\n", otherend, 
status);
-               op->value = 0;
-               return XEN_PCI_ERR_op_failed;
-       }
-
-       op->value = dev->irq;
-       return 0;
-}
-
-int pciback_disable_msi(struct pciback_device *pdev,
-               struct pci_dev *dev, struct xen_pci_op *op)
-{
-       pci_disable_msi(dev);
-
-       op->value = dev->irq;
-       return 0;
-}
-
-int pciback_enable_msix(struct pciback_device *pdev,
-               struct pci_dev *dev, struct xen_pci_op *op)
-{
-       int i, result;
-       struct msix_entry *entries;
-
-       if (op->value > SH_INFO_MAX_VEC)
-               return -EINVAL;
-
-       entries = kmalloc(op->value * sizeof(*entries), GFP_KERNEL);
-       if (entries == NULL)
-               return -ENOMEM;
-
-       for (i = 0; i < op->value; i++) {
-               entries[i].entry = op->msix_entries[i].entry;
-               entries[i].vector = op->msix_entries[i].vector;
-       }
-
-       result = pci_enable_msix(dev, entries, op->value);
-
-       for (i = 0; i < op->value; i++) {
-               op->msix_entries[i].entry = entries[i].entry;
-               op->msix_entries[i].vector = entries[i].vector;
-       }
-
-       kfree(entries);
-
-       op->value = result;
-
-       return result;
-}
-
-int pciback_disable_msix(struct pciback_device *pdev,
-               struct pci_dev *dev, struct xen_pci_op *op)
-{
-
-       pci_disable_msix(dev);
-
-       op->value = dev->irq;
-       return 0;
-}
-
diff --git a/drivers/xen/pciback/pci_stub.c b/drivers/xen/pciback/pci_stub.c
index c02f21f..036d7bb 100644
--- a/drivers/xen/pciback/pci_stub.c
+++ b/drivers/xen/pciback/pci_stub.c
@@ -1173,21 +1173,6 @@ static ssize_t permissive_show(struct device_driver 
*drv, char *buf)
 
 DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
 
-#ifdef CONFIG_PCI_MSI
-
-int pciback_get_owner(struct pci_dev *dev)
-{
-       struct pcistub_device *psdev;
-
-       psdev = pcistub_device_find(pci_domain_nr(dev->bus), dev->bus->number,
-                       PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-
-       if (!psdev || !psdev->pdev)
-               return -1;
-
-       return psdev->pdev->xdev->otherend_id;
-}
-#endif
 
 static void pcistub_exit(void)
 {
@@ -1199,7 +1184,6 @@ static void pcistub_exit(void)
        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
 
        pci_unregister_driver(&pciback_pci_driver);
-       WARN_ON(unregister_msi_get_owner(pciback_get_owner));
 }
 
 static int __init pcistub_init(void)
@@ -1257,8 +1241,6 @@ static int __init pcistub_init(void)
                err = driver_create_file(&pciback_pci_driver.driver,
                                         &driver_attr_permissive);
 
-       if (!err)
-               err = register_msi_get_owner(pciback_get_owner);
        if (err)
                pcistub_exit();
 
diff --git a/drivers/xen/pciback/pciback.h b/drivers/xen/pciback/pciback.h
index 6744f45..27d0b2f 100644
--- a/drivers/xen/pciback/pciback.h
+++ b/drivers/xen/pciback/pciback.h
@@ -105,20 +105,6 @@ void pciback_do_op(void *data);
 int pciback_xenbus_register(void);
 void pciback_xenbus_unregister(void);
 
-#ifdef CONFIG_PCI_MSI
-int pciback_enable_msi(struct pciback_device *pdev,
-                       struct pci_dev *dev, struct xen_pci_op *op);
-
-int pciback_disable_msi(struct pciback_device *pdev,
-                         struct pci_dev *dev, struct xen_pci_op *op);
-
-
-int pciback_enable_msix(struct pciback_device *pdev,
-                        struct pci_dev *dev, struct xen_pci_op *op);
-
-int pciback_disable_msix(struct pciback_device *pdev,
-                        struct pci_dev *dev, struct xen_pci_op *op);
-#endif
 extern int verbose_request;
 
 void test_and_schedule_op(struct pciback_device *pdev);
diff --git a/drivers/xen/pciback/pciback_ops.c 
b/drivers/xen/pciback/pciback_ops.c
index 58d09eb..a937564 100644
--- a/drivers/xen/pciback/pciback_ops.c
+++ b/drivers/xen/pciback/pciback_ops.c
@@ -89,20 +89,6 @@ void pciback_do_op(void *data)
                                op->err = pciback_config_write(dev,
                                          op->offset, op->size, op->value);
                                break;
-#ifdef CONFIG_PCI_MSI
-                       case XEN_PCI_OP_enable_msi:
-                               op->err = pciback_enable_msi(pdev, dev, op);
-                               break;
-                       case XEN_PCI_OP_disable_msi:
-                               op->err = pciback_disable_msi(pdev, dev, op);
-                               break;
-                       case XEN_PCI_OP_enable_msix:
-                               op->err = pciback_enable_msix(pdev, dev, op);
-                               break;
-                       case XEN_PCI_OP_disable_msix:
-                               op->err = pciback_disable_msix(pdev, dev, op);
-                               break;
-#endif
                        default:
                                op->err = XEN_PCI_ERR_not_implemented;
                                break;
-- 
1.6.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>