diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-06-03 08:48:45 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-06-03 08:48:45 -0700 |
| commit | e1a2f13ec577a24d9b2b6c2f42235c7602f71e19 (patch) | |
| tree | 81e1f8b89cf1b4ae78304e3c26b5affc2b79a337 | |
| parent | 629453109b5972a55a9385b00d6ec98d864ee737 (diff) | |
[PATCH] PCI: Remove a lot of PCI core only functions from include/linux/pci.h
| -rw-r--r-- | drivers/pci/bus.c | 1 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 1 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_pci.c | 1 | ||||
| -rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_pci.c | 1 | ||||
| -rw-r--r-- | drivers/pci/hotplug/cpqphp_pci.c | 1 | ||||
| -rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 1 | ||||
| -rw-r--r-- | drivers/pci/pci.h | 44 | ||||
| -rw-r--r-- | drivers/pci/setup-res.c | 2 | ||||
| -rw-r--r-- | include/linux/pci.h | 51 |
9 files changed, 50 insertions, 53 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 9f176d9a6b1c..dda1e005bb08 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -129,6 +129,5 @@ void pci_enable_bridges(struct pci_bus *bus) } } -EXPORT_SYMBOL(pci_bus_alloc_resource); EXPORT_SYMBOL(pci_bus_add_devices); EXPORT_SYMBOL(pci_enable_bridges); diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 42cf2749cf89..9ab2cda79548 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -34,6 +34,7 @@ #include <linux/init.h> #include <asm/semaphore.h> +#include "../pci.h" #include "pci_hotplug.h" #include "acpiphp.h" diff --git a/drivers/pci/hotplug/acpiphp_pci.c b/drivers/pci/hotplug/acpiphp_pci.c index 5a5d24cc064f..6ebbb975d6f7 100644 --- a/drivers/pci/hotplug/acpiphp_pci.c +++ b/drivers/pci/hotplug/acpiphp_pci.c @@ -35,6 +35,7 @@ #include <linux/pci.h> #include <linux/init.h> #include <linux/acpi.h> +#include "../pci.h" #include "pci_hotplug.h" #include "acpiphp.h" diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c index b11615d7529a..9834f9357520 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c @@ -28,6 +28,7 @@ #include <linux/kernel.h> #include <linux/pci.h> #include <linux/proc_fs.h> +#include "../pci.h" #include "pci_hotplug.h" #include "cpci_hotplug.h" diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 9b3a3c4b387d..a30c5c42f8b2 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c @@ -34,6 +34,7 @@ #include <linux/workqueue.h> #include <linux/proc_fs.h> #include <linux/pci.h> +#include "../pci.h" #include "cpqphp.h" #include "cpqphp_nvram.h" #include "../../../arch/i386/pci/pci.h" /* horrible hack showing how processor dependent we are... */ diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index cff6a27a1679..aebcddcbefd5 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -35,6 +35,7 @@ #include <linux/delay.h> #include <linux/wait.h> #include <linux/smp_lock.h> +#include "../pci.h" #include "../../../arch/i386/pci/pci.h" /* for struct irq_routing_table */ #include "ibmphp.h" diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index b6bffd1aefb8..ef631358a13c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -3,3 +3,47 @@ extern int pci_hotplug (struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); extern void pci_create_sysfs_dev_files(struct pci_dev *pdev); +extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, + unsigned long size, unsigned long align, + unsigned long min, unsigned int type_mask, + void (*alignf)(void *, struct resource *, + unsigned long, unsigned long), + void *alignf_data); +extern int pci_proc_attach_device(struct pci_dev *dev); +extern int pci_proc_detach_device(struct pci_dev *dev); +extern int pci_proc_attach_bus(struct pci_bus *bus); +extern int pci_proc_detach_bus(struct pci_bus *bus); + +/* Functions for PCI Hotplug drivers to use */ +extern struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); +extern unsigned int pci_do_scan_bus(struct pci_bus *bus); +extern void pci_remove_bus_device(struct pci_dev *dev); +extern int pci_remove_device_safe(struct pci_dev *dev); + +struct pci_dev_wrapped { + struct pci_dev *dev; + void *data; +}; + +struct pci_bus_wrapped { + struct pci_bus *bus; + void *data; +}; + +struct pci_visit { + int (* pre_visit_pci_bus) (struct pci_bus_wrapped *, + struct pci_dev_wrapped *); + int (* post_visit_pci_bus) (struct pci_bus_wrapped *, + struct pci_dev_wrapped *); + + int (* pre_visit_pci_dev) (struct pci_dev_wrapped *, + struct pci_bus_wrapped *); + int (* visit_pci_dev) (struct pci_dev_wrapped *, + struct pci_bus_wrapped *); + int (* post_visit_pci_dev) (struct pci_dev_wrapped *, + struct pci_bus_wrapped *); +}; + +extern int pci_visit_dev(struct pci_visit *fn, + struct pci_dev_wrapped *wrapped_dev, + struct pci_bus_wrapped *wrapped_parent); diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 64343bc4833c..93238208b822 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -23,7 +23,7 @@ #include <linux/ioport.h> #include <linux/cache.h> #include <linux/slab.h> - +#include "pci.h" #define DEBUG_CONFIG 0 #if DEBUG_CONFIG diff --git a/include/linux/pci.h b/include/linux/pci.h index 442e1da02dca..9ef6bcb13d1a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -548,10 +548,6 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s } int pci_scan_slot(struct pci_bus *bus, int devfn); void pci_bus_add_devices(struct pci_bus *bus); -int pci_proc_attach_device(struct pci_dev *dev); -int pci_proc_detach_device(struct pci_dev *dev); -int pci_proc_attach_bus(struct pci_bus *bus); -int pci_proc_detach_bus(struct pci_bus *bus); void pci_name_device(struct pci_dev *dev); char *pci_class_name(u32 class); void pci_read_bridge_bases(struct pci_bus *child); @@ -640,24 +636,14 @@ int pci_request_region(struct pci_dev *, int, char *); void pci_release_region(struct pci_dev *, int); /* drivers/pci/bus.c */ - -int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, - unsigned long size, unsigned long align, - unsigned long min, unsigned int type_mask, - void (*alignf)(void *, struct resource *, - unsigned long, unsigned long), - void *alignf_data); void pci_enable_bridges(struct pci_bus *bus); /* New-style probing supporting hot-pluggable devices */ int pci_register_driver(struct pci_driver *); void pci_unregister_driver(struct pci_driver *); -void pci_remove_bus_device(struct pci_dev *); void pci_remove_behind_bridge(struct pci_dev *); struct pci_driver *pci_dev_driver(const struct pci_dev *); const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); -unsigned int pci_do_scan_bus(struct pci_bus *bus); -struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); /* kmem_cache style wrapper around pci_alloc_consistent() */ @@ -672,42 +658,6 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr); extern struct pci_dev *isa_bridge; #endif -/* Some worker functions that PCI Hotplug drivers find useful */ -struct pci_dev_wrapped { - struct pci_dev *dev; - void *data; -}; - -struct pci_bus_wrapped { - struct pci_bus *bus; - void *data; -}; - -struct pci_visit { - int (* pre_visit_pci_bus) (struct pci_bus_wrapped *, - struct pci_dev_wrapped *); - int (* post_visit_pci_bus) (struct pci_bus_wrapped *, - struct pci_dev_wrapped *); - - int (* pre_visit_pci_dev) (struct pci_dev_wrapped *, - struct pci_bus_wrapped *); - int (* visit_pci_dev) (struct pci_dev_wrapped *, - struct pci_bus_wrapped *); - int (* post_visit_pci_dev) (struct pci_dev_wrapped *, - struct pci_bus_wrapped *); -}; - -extern int pci_visit_dev(struct pci_visit *fn, - struct pci_dev_wrapped *wrapped_dev, - struct pci_bus_wrapped *wrapped_parent); -extern int pci_remove_device_safe(struct pci_dev *dev); - -static inline void -pci_dynids_set_use_driver_data(struct pci_driver *pdrv, int val) -{ - pdrv->dynids.use_driver_data = val; -} - #endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */ @@ -756,7 +706,6 @@ static inline void pci_unregister_driver(struct pci_driver *drv) { } static inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; } static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } -static inline void pci_dynids_set_use_driver_data(struct pci_driver *pdrv, int val) { } /* Power management related routines */ static inline int pci_save_state(struct pci_dev *dev, u32 *buffer) { return 0; } |
