[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] pciif: do not depend on linux' msix_entries



pciif: do not depend on linux' msix_entries, and use a conversion loop
instead (already done in the frontend).

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 3643a33de277 drivers/xen/pciback/conf_space_capability_msi.c
--- a/drivers/xen/pciback/conf_space_capability_msi.c   Mon Jun 30 16:14:04 
2008 +0100
+++ b/drivers/xen/pciback/conf_space_capability_msi.c   Wed Jul 02 12:46:30 
2008 +0100
@@ -39,9 +39,21 @@
 {
        int result;
 
-       result = pci_enable_msix(dev, op->msix_entries, op->value);
+       if (op->value > SH_INFO_MAX_VEC)
+               return -EINVAL;
+       else {
+               struct msix_entry entries[op->value];
+               int i;
 
-       op->value = result;
+               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);
+               op->value = result;
+       }
+
        return result;
 }
 
diff -r 3643a33de277 include/xen/interface/io/pciif.h
--- a/include/xen/interface/io/pciif.h  Mon Jun 30 16:14:04 2008 +0100
+++ b/include/xen/interface/io/pciif.h  Wed Jul 02 12:46:30 2008 +0100
@@ -54,6 +54,11 @@
  */
 #define SH_INFO_MAX_VEC     128
 
+struct xen_msix_entry {
+    uint16_t vector;
+    uint16_t entry;
+};
+
 struct xen_pci_op {
     /* IN: what action to perform: XEN_PCI_OP_* */
     uint32_t cmd;
@@ -75,7 +80,7 @@
     /* IN: Contains extra infor for this operation */
     uint32_t info;
     /*IN:  param for msi-x */
-    struct msix_entry msix_entries[SH_INFO_MAX_VEC];
+    struct xen_msix_entry xen_msix_entries[SH_INFO_MAX_VEC];
 };
 
 struct xen_pci_sharedinfo {

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.