#include <linux/pci.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/mempolicy.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/sched/isolation.h>
#include <linux/cpu.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
#include <linux/kexec.h>
#include <linux/of_device.h>
#include <linux/acpi.h>
#include <linux/dma-map-ops.h>
#include <linux/iommu.h>
#include "pci.h"
#include "pcie/portdrv.h"
struct pci_dynid { … };
int pci_add_dynid(struct pci_driver *drv,
unsigned int vendor, unsigned int device,
unsigned int subvendor, unsigned int subdevice,
unsigned int class, unsigned int class_mask,
unsigned long driver_data)
{ … }
EXPORT_SYMBOL_GPL(…);
static void pci_free_dynids(struct pci_driver *drv)
{ … }
const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
struct pci_dev *dev)
{ … }
EXPORT_SYMBOL(…);
static const struct pci_device_id pci_device_id_any = …;
static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
struct pci_dev *dev)
{ … }
static ssize_t new_id_store(struct device_driver *driver, const char *buf,
size_t count)
{ … }
static DRIVER_ATTR_WO(new_id);
static ssize_t remove_id_store(struct device_driver *driver, const char *buf,
size_t count)
{ … }
static DRIVER_ATTR_WO(remove_id);
static struct attribute *pci_drv_attrs[] = …;
ATTRIBUTE_GROUPS(…);
struct drv_dev_and_id { … };
static long local_pci_probe(void *_ddi)
{ … }
static bool pci_physfn_is_probed(struct pci_dev *dev)
{ … }
static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
{ … }
#ifdef CONFIG_PCI_IOV
static inline bool pci_device_can_probe(struct pci_dev *pdev)
{ … }
#else
static inline bool pci_device_can_probe(struct pci_dev *pdev)
{
return true;
}
#endif
static int pci_device_probe(struct device *dev)
{ … }
static void pci_device_remove(struct device *dev)
{ … }
static void pci_device_shutdown(struct device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int pci_restore_standard_config(struct pci_dev *pci_dev)
{ … }
#endif
#ifdef CONFIG_PM
static void pci_pm_default_resume(struct pci_dev *pci_dev)
{ … }
static void pci_pm_power_up_and_verify_state(struct pci_dev *pci_dev)
{ … }
static void pci_pm_default_resume_early(struct pci_dev *pci_dev)
{ … }
static void pci_pm_bridge_power_up_actions(struct pci_dev *pci_dev)
{ … }
#endif
#ifdef CONFIG_PM_SLEEP
static void pci_pm_set_unknown_state(struct pci_dev *pci_dev)
{ … }
static int pci_pm_reenable_device(struct pci_dev *pci_dev)
{ … }
static int pci_legacy_suspend(struct device *dev, pm_message_t state)
{ … }
static int pci_legacy_suspend_late(struct device *dev)
{ … }
static int pci_legacy_resume(struct device *dev)
{ … }
static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{ … }
static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev)
{ … }
static int pci_pm_prepare(struct device *dev)
{ … }
static void pci_pm_complete(struct device *dev)
{ … }
#else
#define pci_pm_prepare …
#define pci_pm_complete …
#endif
#ifdef CONFIG_SUSPEND
static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev)
{ … }
static int pci_pm_suspend(struct device *dev)
{ … }
static int pci_pm_suspend_late(struct device *dev)
{ … }
static int pci_pm_suspend_noirq(struct device *dev)
{ … }
static int pci_pm_resume_noirq(struct device *dev)
{ … }
static int pci_pm_resume_early(struct device *dev)
{ … }
static int pci_pm_resume(struct device *dev)
{ … }
#else
#define pci_pm_suspend …
#define pci_pm_suspend_late …
#define pci_pm_suspend_noirq …
#define pci_pm_resume …
#define pci_pm_resume_early …
#define pci_pm_resume_noirq …
#endif
#ifdef CONFIG_HIBERNATE_CALLBACKS
static int pci_pm_freeze(struct device *dev)
{ … }
static int pci_pm_freeze_noirq(struct device *dev)
{ … }
static int pci_pm_thaw_noirq(struct device *dev)
{ … }
static int pci_pm_thaw(struct device *dev)
{ … }
static int pci_pm_poweroff(struct device *dev)
{ … }
static int pci_pm_poweroff_late(struct device *dev)
{ … }
static int pci_pm_poweroff_noirq(struct device *dev)
{ … }
static int pci_pm_restore_noirq(struct device *dev)
{ … }
static int pci_pm_restore(struct device *dev)
{ … }
#else
#define pci_pm_freeze …
#define pci_pm_freeze_noirq …
#define pci_pm_thaw …
#define pci_pm_thaw_noirq …
#define pci_pm_poweroff …
#define pci_pm_poweroff_late …
#define pci_pm_poweroff_noirq …
#define pci_pm_restore …
#define pci_pm_restore_noirq …
#endif
#ifdef CONFIG_PM
static int pci_pm_runtime_suspend(struct device *dev)
{ … }
static int pci_pm_runtime_resume(struct device *dev)
{ … }
static int pci_pm_runtime_idle(struct device *dev)
{ … }
static const struct dev_pm_ops pci_dev_pm_ops = …;
#define PCI_PM_OPS_PTR …
#else
#define pci_pm_runtime_suspend …
#define pci_pm_runtime_resume …
#define pci_pm_runtime_idle …
#define PCI_PM_OPS_PTR …
#endif
int __pci_register_driver(struct pci_driver *drv, struct module *owner,
const char *mod_name)
{ … }
EXPORT_SYMBOL(…);
void pci_unregister_driver(struct pci_driver *drv)
{ … }
EXPORT_SYMBOL(…);
static struct pci_driver pci_compat_driver = …;
struct pci_driver *pci_dev_driver(const struct pci_dev *dev)
{ … }
EXPORT_SYMBOL(…);
static int pci_bus_match(struct device *dev, const struct device_driver *drv)
{ … }
struct pci_dev *pci_dev_get(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL(…);
void pci_dev_put(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL(…);
static int pci_uevent(const struct device *dev, struct kobj_uevent_env *env)
{ … }
#if defined(CONFIG_PCIEAER) || defined(CONFIG_EEH)
void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type)
{ … }
#endif
static int pci_bus_num_vf(struct device *dev)
{ … }
static int pci_dma_configure(struct device *dev)
{ … }
static void pci_dma_cleanup(struct device *dev)
{ … }
struct bus_type pci_bus_type = …;
EXPORT_SYMBOL(…);
#ifdef CONFIG_PCIEPORTBUS
static int pcie_port_bus_match(struct device *dev, const struct device_driver *drv)
{ … }
const struct bus_type pcie_port_bus_type = …;
#endif
static int __init pci_driver_init(void)
{ … }
postcore_initcall(pci_driver_init);