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

[Xen-changelog] [linux-2.6.18-xen] pcifront/MSI: clean up interface


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Mon, 15 Apr 2013 08:44:02 +0000
  • Delivery-date: Mon, 15 Apr 2013 08:44:13 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1366015043 -7200
# Node ID 874725c5afa10717a5307f5f1c6bdc4baa655c9d
# Parent  93fcadedde4884ead8b206563eba34b780e61db3
pcifront/MSI: clean up interface

- declare functions in a header included by both producer and
  consumer(s)
- don't define private items in global header
- no need to (re-)declare pci_bus_sem

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 93fcadedde48 -r 874725c5afa1 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c     Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/pci/msi-xen.c     Mon Apr 15 10:37:23 2013 +0200
@@ -17,6 +17,7 @@
 
 #include <xen/interface/physdev.h>
 #include <xen/evtchn.h>
+#include <xen/pcifront.h>
 
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -605,7 +606,6 @@ static int msix_capability_init(struct p
  * indicates the successful setup of an entry zero with the new MSI
  * vector or non-zero for otherwise.
  **/
-extern int pci_frontend_enable_msi(struct pci_dev *dev);
 int pci_enable_msi(struct pci_dev* dev)
 {
        struct pci_bus *bus;
@@ -669,7 +669,6 @@ int pci_enable_msi(struct pci_dev* dev)
        return status;
 }
 
-extern void pci_frontend_disable_msi(struct pci_dev* dev);
 void pci_disable_msi(struct pci_dev* dev)
 {
        int pos;
@@ -730,8 +729,6 @@ void pci_disable_msi(struct pci_dev* dev
  * of vectors available. Driver should use the returned value to re-send
  * its request.
  **/
-extern int pci_frontend_enable_msix(struct pci_dev *dev,
-               struct msix_entry *entries, int nvec);
 int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
 {
        struct pci_bus *bus;
@@ -831,7 +828,6 @@ int pci_enable_msix(struct pci_dev* dev,
        return status;
 }
 
-extern void pci_frontend_disable_msix(struct pci_dev* dev);
 void pci_disable_msix(struct pci_dev* dev)
 {
        int pos;
diff -r 93fcadedde48 -r 874725c5afa1 drivers/xen/pcifront/pcifront.h
--- a/drivers/xen/pcifront/pcifront.h   Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/xen/pcifront/pcifront.h   Mon Apr 15 10:37:23 2013 +0200
@@ -7,7 +7,6 @@
 #define __XEN_PCIFRONT_H__
 
 #include <linux/spinlock.h>
-#include <linux/pci.h>
 #include <xen/xenbus.h>
 #include <xen/interface/io/pciif.h>
 #include <linux/interrupt.h>
@@ -53,4 +52,35 @@ void pcifront_do_aer( void *data);
 
 irqreturn_t pcifront_handler_aer(int irq, void *dev, struct pt_regs *regs);
 
+#ifndef __ia64__
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+       return sd->pdev;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+                                                struct pcifront_sd *sd)
+{
+}
+
+#else /* __ia64__ */
+
+#define pcifront_sd pci_controller
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+       return (struct pcifront_device *)sd->platform_data;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+                                                struct pcifront_sd *sd)
+{
+       xen_pcibios_setup_root_windows(bus, sd);
+}
+
+#endif /* __ia64__ */
+
 #endif /* __XEN_PCIFRONT_H__ */
diff -r 93fcadedde48 -r 874725c5afa1 include/xen/pcifront.h
--- a/include/xen/pcifront.h    Wed Mar 13 10:14:44 2013 +0100
+++ b/include/xen/pcifront.h    Mon Apr 15 10:37:23 2013 +0200
@@ -6,26 +6,22 @@
 #ifndef __XEN_ASM_PCIFRONT_H__
 #define __XEN_ASM_PCIFRONT_H__
 
-#include <linux/spinlock.h>
-
 #ifdef __KERNEL__
 
+#include <linux/pci.h>
+
+int pci_frontend_enable_msi(struct pci_dev *);
+void pci_frontend_disable_msi(struct pci_dev *);
+int pci_frontend_enable_msix(struct pci_dev *, struct msix_entry *, int nvec);
+void pci_frontend_disable_msix(struct pci_dev *);
+
 #ifndef __ia64__
 
-struct pcifront_device;
-struct pci_bus;
-
 struct pcifront_sd {
        int domain;
        struct pcifront_device *pdev;
 };
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-       return sd->pdev;
-}
-
 #if defined(CONFIG_PCI_DOMAINS)
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
@@ -38,38 +34,17 @@ static inline int pci_proc_domain(struct
 }
 #endif /* CONFIG_PCI_DOMAINS */
 
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-                                                struct pcifront_sd *sd)
-{
-}
-
 #else /* __ia64__ */
 
 #include <linux/acpi.h>
-#include <asm/pci.h>
-#define pcifront_sd pci_controller
 
 extern void xen_add_resource(struct pci_controller *, unsigned int,
                             unsigned int, struct acpi_resource *);
 extern void xen_pcibios_setup_root_windows(struct pci_bus *,
                                           struct pci_controller *);
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-       return (struct pcifront_device *)sd->platform_data;
-}
-
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-                                                struct pcifront_sd *sd)
-{
-       xen_pcibios_setup_root_windows(bus, sd);
-}
-
 #endif /* __ia64__ */
 
-extern struct rw_semaphore pci_bus_sem;
-
 #endif /* __KERNEL__ */
 
 #endif /* __XEN_ASM_PCIFRONT_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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