#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/msi.h>
#include <linux/of_pci.h>
#include <linux/pci_hotplug.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/cpumask.h>
#include <linux/aer.h>
#include <linux/acpi.h>
#include <linux/hypervisor.h>
#include <linux/irqdomain.h>
#include <linux/pm_runtime.h>
#include <linux/bitfield.h>
#include "pci.h"
#define CARDBUS_LATENCY_TIMER …
#define CARDBUS_RESERVE_BUSNR …
static struct resource busn_resource = …;
LIST_HEAD(…);
EXPORT_SYMBOL(…);
static LIST_HEAD(pci_domain_busn_res_list);
struct pci_domain_busn_res { … };
static struct resource *get_pci_domain_busn_res(int domain_nr)
{ … }
int no_pci_devices(void)
{ … }
EXPORT_SYMBOL(…);
static void release_pcibus_dev(struct device *dev)
{ … }
static const struct class pcibus_class = …;
static int __init pcibus_class_init(void)
{ … }
postcore_initcall(pcibus_class_init);
static u64 pci_size(u64 base, u64 maxbase, u64 mask)
{ … }
static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar)
{ … }
#define PCI_COMMAND_DECODE_ENABLE …
int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
struct resource *res, unsigned int pos)
{ … }
static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
{ … }
static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res,
bool log)
{ … }
static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res,
bool log)
{ … }
static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res,
bool log)
{ … }
static void pci_read_bridge_windows(struct pci_dev *bridge)
{ … }
void pci_read_bridge_bases(struct pci_bus *child)
{ … }
static struct pci_bus *pci_alloc_bus(struct pci_bus *parent)
{ … }
static void pci_release_host_bridge_dev(struct device *dev)
{ … }
static void pci_init_host_bridge(struct pci_host_bridge *bridge)
{ … }
struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
{ … }
EXPORT_SYMBOL(…);
static void devm_pci_alloc_host_bridge_release(void *data)
{ … }
struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev,
size_t priv)
{ … }
EXPORT_SYMBOL(…);
void pci_free_host_bridge(struct pci_host_bridge *bridge)
{ … }
EXPORT_SYMBOL(…);
static const unsigned char pcix_bus_speed[] = …;
const unsigned char pcie_link_speed[] = …;
EXPORT_SYMBOL_GPL(…);
const char *pci_speed_string(enum pci_bus_speed speed)
{ … }
EXPORT_SYMBOL_GPL(…);
void pcie_update_link_speed(struct pci_bus *bus, u16 linksta)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned char agp_speeds[] = …;
static enum pci_bus_speed agp_speed(int agp3, int agpstat)
{ … }
static void pci_set_bus_speed(struct pci_bus *bus)
{ … }
static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
{ … }
static void pci_set_bus_msi_domain(struct pci_bus *bus)
{ … }
static bool pci_preserve_config(struct pci_host_bridge *host_bridge)
{ … }
static int pci_register_host_bridge(struct pci_host_bridge *bridge)
{ … }
static bool pci_bridge_child_ext_cfg_accessible(struct pci_dev *bridge)
{ … }
static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
struct pci_dev *bridge, int busnr)
{ … }
struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
int busnr)
{ … }
EXPORT_SYMBOL(…);
static void pci_enable_crs(struct pci_dev *pdev)
{ … }
static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus,
unsigned int available_buses);
static bool pci_ea_fixed_busnrs(struct pci_dev *dev, u8 *sec, u8 *sub)
{ … }
static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
int max, unsigned int available_buses,
int pass)
{ … }
int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
{ … }
EXPORT_SYMBOL(…);
static void pci_read_irq(struct pci_dev *dev)
{ … }
void set_pcie_port_type(struct pci_dev *pdev)
{ … }
void set_pcie_hotplug_bridge(struct pci_dev *pdev)
{ … }
static void set_pcie_thunderbolt(struct pci_dev *dev)
{ … }
static void set_pcie_untrusted(struct pci_dev *dev)
{ … }
static void pci_set_removable(struct pci_dev *dev)
{ … }
static bool pci_ext_cfg_is_aliased(struct pci_dev *dev)
{ … }
static int pci_cfg_space_size_ext(struct pci_dev *dev)
{ … }
int pci_cfg_space_size(struct pci_dev *dev)
{ … }
static u32 pci_class(struct pci_dev *dev)
{ … }
static void pci_subsystem_ids(struct pci_dev *dev, u16 *vendor, u16 *device)
{ … }
static u8 pci_hdr_type(struct pci_dev *dev)
{ … }
#define LEGACY_IO_RESOURCE …
static int pci_intx_mask_broken(struct pci_dev *dev)
{ … }
static void early_dump_pci_device(struct pci_dev *pdev)
{ … }
static const char *pci_type_str(struct pci_dev *dev)
{ … }
int pci_setup_device(struct pci_dev *dev)
{ … }
static void pci_configure_mps(struct pci_dev *dev)
{ … }
int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
{ … }
bool pcie_relaxed_ordering_enabled(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL(…);
static void pci_configure_relaxed_ordering(struct pci_dev *dev)
{ … }
static void pci_configure_eetlp_prefix(struct pci_dev *dev)
{ … }
static void pci_configure_serr(struct pci_dev *dev)
{ … }
static void pci_configure_device(struct pci_dev *dev)
{ … }
static void pci_release_capabilities(struct pci_dev *dev)
{ … }
static void pci_release_dev(struct device *dev)
{ … }
static const struct device_type pci_dev_type = …;
struct pci_dev *pci_alloc_dev(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL(…);
static bool pci_bus_crs_vendor_id(u32 l)
{ … }
static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
int timeout)
{ … }
bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
int timeout)
{ … }
bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
int timeout)
{ … }
EXPORT_SYMBOL(…);
static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
{ … }
void pcie_report_downtraining(struct pci_dev *dev)
{ … }
static void pci_init_capabilities(struct pci_dev *dev)
{ … }
static struct irq_domain *pci_dev_msi_domain(struct pci_dev *dev)
{ … }
static void pci_set_msi_domain(struct pci_dev *dev)
{ … }
void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
{ … }
struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
{ … }
EXPORT_SYMBOL(…);
static int next_ari_fn(struct pci_bus *bus, struct pci_dev *dev, int fn)
{ … }
static int next_fn(struct pci_bus *bus, struct pci_dev *dev, int fn)
{ … }
static int only_one_child(struct pci_bus *bus)
{ … }
int pci_scan_slot(struct pci_bus *bus, int devfn)
{ … }
EXPORT_SYMBOL(…);
static int pcie_find_smpss(struct pci_dev *dev, void *data)
{ … }
static void pcie_write_mps(struct pci_dev *dev, int mps)
{ … }
static void pcie_write_mrrs(struct pci_dev *dev)
{ … }
static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
{ … }
void pcie_bus_configure_settings(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL_GPL(…);
void __weak pcibios_fixup_bus(struct pci_bus *bus)
{ … }
static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus,
unsigned int available_buses)
{ … }
unsigned int pci_scan_child_bus(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL_GPL(…);
int __weak pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{ … }
void __weak pcibios_add_bus(struct pci_bus *bus)
{ … }
void __weak pcibios_remove_bus(struct pci_bus *bus)
{ … }
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata, struct list_head *resources)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_host_probe(struct pci_host_bridge *bridge)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int bus_max)
{ … }
int pci_bus_update_busn_res_end(struct pci_bus *b, int bus_max)
{ … }
void pci_bus_release_busn_res(struct pci_bus *b)
{ … }
int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge)
{ … }
EXPORT_SYMBOL(…);
struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata, struct list_head *resources)
{ … }
EXPORT_SYMBOL(…);
struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
void *sysdata)
{ … }
EXPORT_SYMBOL(…);
unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge)
{ … }
unsigned int pci_rescan_bus(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL_GPL(…);
static DEFINE_MUTEX(pci_rescan_remove_lock);
void pci_lock_rescan_remove(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void pci_unlock_rescan_remove(void)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init pci_sort_bf_cmp(const struct device *d_a,
const struct device *d_b)
{ … }
void __init pci_sort_breadthfirst(void)
{ … }
int pci_hp_add_bridge(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);