aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci-aspm.h20
-rw-r--r--include/linux/pci-ats.h26
-rw-r--r--include/linux/pci.h95
-rw-r--r--include/linux/pci_hotplug.h12
-rw-r--r--include/linux/pcieport_if.h4
5 files changed, 78 insertions, 79 deletions
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
index c8320144fe79..8af4610c2e41 100644
--- a/include/linux/pci-aspm.h
+++ b/include/linux/pci-aspm.h
@@ -23,14 +23,14 @@
23#define PCIE_LINK_STATE_CLKPM 4 23#define PCIE_LINK_STATE_CLKPM 4
24 24
25#ifdef CONFIG_PCIEASPM 25#ifdef CONFIG_PCIEASPM
26extern void pcie_aspm_init_link_state(struct pci_dev *pdev); 26void pcie_aspm_init_link_state(struct pci_dev *pdev);
27extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); 27void pcie_aspm_exit_link_state(struct pci_dev *pdev);
28extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); 28void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); 29void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
30extern void pci_disable_link_state(struct pci_dev *pdev, int state); 30void pci_disable_link_state(struct pci_dev *pdev, int state);
31extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); 31void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
32extern void pcie_clear_aspm(struct pci_bus *bus); 32void pcie_clear_aspm(struct pci_bus *bus);
33extern void pcie_no_aspm(void); 33void pcie_no_aspm(void);
34#else 34#else
35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) 35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
36{ 36{
@@ -56,8 +56,8 @@ static inline void pcie_no_aspm(void)
56#endif 56#endif
57 57
58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ 58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
59extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); 59void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
60extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); 60void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
61#else 61#else
62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) 62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
63{ 63{
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 7ef68724f0f0..68bcefd7fca0 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -14,9 +14,9 @@ struct pci_ats {
14 14
15#ifdef CONFIG_PCI_ATS 15#ifdef CONFIG_PCI_ATS
16 16
17extern int pci_enable_ats(struct pci_dev *dev, int ps); 17int pci_enable_ats(struct pci_dev *dev, int ps);
18extern void pci_disable_ats(struct pci_dev *dev); 18void pci_disable_ats(struct pci_dev *dev);
19extern int pci_ats_queue_depth(struct pci_dev *dev); 19int pci_ats_queue_depth(struct pci_dev *dev);
20 20
21/** 21/**
22 * pci_ats_enabled - query the ATS status 22 * pci_ats_enabled - query the ATS status
@@ -54,12 +54,12 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
54 54
55#ifdef CONFIG_PCI_PRI 55#ifdef CONFIG_PCI_PRI
56 56
57extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 57int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58extern void pci_disable_pri(struct pci_dev *pdev); 58void pci_disable_pri(struct pci_dev *pdev);
59extern bool pci_pri_enabled(struct pci_dev *pdev); 59bool pci_pri_enabled(struct pci_dev *pdev);
60extern int pci_reset_pri(struct pci_dev *pdev); 60int pci_reset_pri(struct pci_dev *pdev);
61extern bool pci_pri_stopped(struct pci_dev *pdev); 61bool pci_pri_stopped(struct pci_dev *pdev);
62extern int pci_pri_status(struct pci_dev *pdev); 62int pci_pri_status(struct pci_dev *pdev);
63 63
64#else /* CONFIG_PCI_PRI */ 64#else /* CONFIG_PCI_PRI */
65 65
@@ -95,10 +95,10 @@ static inline int pci_pri_status(struct pci_dev *pdev)
95 95
96#ifdef CONFIG_PCI_PASID 96#ifdef CONFIG_PCI_PASID
97 97
98extern int pci_enable_pasid(struct pci_dev *pdev, int features); 98int pci_enable_pasid(struct pci_dev *pdev, int features);
99extern void pci_disable_pasid(struct pci_dev *pdev); 99void pci_disable_pasid(struct pci_dev *pdev);
100extern int pci_pasid_features(struct pci_dev *pdev); 100int pci_pasid_features(struct pci_dev *pdev);
101extern int pci_max_pasids(struct pci_dev *pdev); 101int pci_max_pasids(struct pci_dev *pdev);
102 102
103#else /* CONFIG_PCI_PASID */ 103#else /* CONFIG_PCI_PASID */
104 104
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2461033a7987..614512bed7b0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -348,7 +348,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
348 return dev; 348 return dev;
349} 349}
350 350
351extern struct pci_dev *alloc_pci_dev(void); 351struct pci_dev *alloc_pci_dev(void);
352 352
353#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 353#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
354#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 354#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -504,10 +504,10 @@ struct pci_ops {
504 * ACPI needs to be able to access PCI config space before we've done a 504 * ACPI needs to be able to access PCI config space before we've done a
505 * PCI bus scan and created pci_bus structures. 505 * PCI bus scan and created pci_bus structures.
506 */ 506 */
507extern int raw_pci_read(unsigned int domain, unsigned int bus, 507int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
508 unsigned int devfn, int reg, int len, u32 *val); 508 int reg, int len, u32 *val);
509extern int raw_pci_write(unsigned int domain, unsigned int bus, 509int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
510 unsigned int devfn, int reg, int len, u32 val); 510 int reg, int len, u32 val);
511 511
512struct pci_bus_region { 512struct pci_bus_region {
513 resource_size_t start; 513 resource_size_t start;
@@ -658,7 +658,7 @@ struct pci_driver {
658/* these external functions are only available when PCI support is enabled */ 658/* these external functions are only available when PCI support is enabled */
659#ifdef CONFIG_PCI 659#ifdef CONFIG_PCI
660 660
661extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 661void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
662 662
663enum pcie_bus_config_types { 663enum pcie_bus_config_types {
664 PCIE_BUS_TUNE_OFF, 664 PCIE_BUS_TUNE_OFF,
@@ -675,7 +675,7 @@ extern struct bus_type pci_bus_type;
675 * code, or pci core code. */ 675 * code, or pci core code. */
676extern struct list_head pci_root_buses; /* list of all known PCI buses */ 676extern struct list_head pci_root_buses; /* list of all known PCI buses */
677/* Some device drivers need know if pci is initiated */ 677/* Some device drivers need know if pci is initiated */
678extern int no_pci_devices(void); 678int no_pci_devices(void);
679 679
680void pcibios_resource_survey_bus(struct pci_bus *bus); 680void pcibios_resource_survey_bus(struct pci_bus *bus);
681void pcibios_fixup_bus(struct pci_bus *); 681void pcibios_fixup_bus(struct pci_bus *);
@@ -699,7 +699,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
699void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 699void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
700 struct pci_bus_region *region); 700 struct pci_bus_region *region);
701void pcibios_scan_specific_bus(int busn); 701void pcibios_scan_specific_bus(int busn);
702extern struct pci_bus *pci_find_bus(int domain, int busnr); 702struct pci_bus *pci_find_bus(int domain, int busnr);
703void pci_bus_add_devices(const struct pci_bus *bus); 703void pci_bus_add_devices(const struct pci_bus *bus);
704struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 704struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
705 struct pci_ops *ops, void *sysdata); 705 struct pci_ops *ops, void *sysdata);
@@ -732,14 +732,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,
732u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); 732u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
733int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 733int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
734u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); 734u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
735extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 735struct pci_dev *pci_dev_get(struct pci_dev *dev);
736extern void pci_dev_put(struct pci_dev *dev); 736void pci_dev_put(struct pci_dev *dev);
737extern void pci_remove_bus(struct pci_bus *b); 737void pci_remove_bus(struct pci_bus *b);
738extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 738void pci_stop_and_remove_bus_device(struct pci_dev *dev);
739void pci_stop_root_bus(struct pci_bus *bus); 739void pci_stop_root_bus(struct pci_bus *bus);
740void pci_remove_root_bus(struct pci_bus *bus); 740void pci_remove_root_bus(struct pci_bus *bus);
741void pci_setup_cardbus(struct pci_bus *bus); 741void pci_setup_cardbus(struct pci_bus *bus);
742extern void pci_sort_breadthfirst(void); 742void pci_sort_breadthfirst(void);
743#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 743#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
744#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) 744#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
745#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) 745#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
@@ -1141,18 +1141,17 @@ static inline int pci_msi_enabled(void)
1141 return 0; 1141 return 0;
1142} 1142}
1143#else 1143#else
1144extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); 1144int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1145extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); 1145int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1146extern void pci_msi_shutdown(struct pci_dev *dev); 1146void pci_msi_shutdown(struct pci_dev *dev);
1147extern void pci_disable_msi(struct pci_dev *dev); 1147void pci_disable_msi(struct pci_dev *dev);
1148extern int pci_msix_table_size(struct pci_dev *dev); 1148int pci_msix_table_size(struct pci_dev *dev);
1149extern int pci_enable_msix(struct pci_dev *dev, 1149int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1150 struct msix_entry *entries, int nvec); 1150void pci_msix_shutdown(struct pci_dev *dev);
1151extern void pci_msix_shutdown(struct pci_dev *dev); 1151void pci_disable_msix(struct pci_dev *dev);
1152extern void pci_disable_msix(struct pci_dev *dev); 1152void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1153extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1153void pci_restore_msi_state(struct pci_dev *dev);
1154extern void pci_restore_msi_state(struct pci_dev *dev); 1154int pci_msi_enabled(void);
1155extern int pci_msi_enabled(void);
1156#endif 1155#endif
1157 1156
1158#ifdef CONFIG_PCIEPORTBUS 1157#ifdef CONFIG_PCIEPORTBUS
@@ -1167,8 +1166,8 @@ extern bool pcie_ports_auto;
1167static inline int pcie_aspm_enabled(void) { return 0; } 1166static inline int pcie_aspm_enabled(void) { return 0; }
1168static inline bool pcie_aspm_support_enabled(void) { return false; } 1167static inline bool pcie_aspm_support_enabled(void) { return false; }
1169#else 1168#else
1170extern int pcie_aspm_enabled(void); 1169int pcie_aspm_enabled(void);
1171extern bool pcie_aspm_support_enabled(void); 1170bool pcie_aspm_support_enabled(void);
1172#endif 1171#endif
1173 1172
1174#ifdef CONFIG_PCIEAER 1173#ifdef CONFIG_PCIEAER
@@ -1186,8 +1185,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1186} 1185}
1187static inline void pcie_ecrc_get_policy(char *str) {}; 1186static inline void pcie_ecrc_get_policy(char *str) {};
1188#else 1187#else
1189extern void pcie_set_ecrc_checking(struct pci_dev *dev); 1188void pcie_set_ecrc_checking(struct pci_dev *dev);
1190extern void pcie_ecrc_get_policy(char *str); 1189void pcie_ecrc_get_policy(char *str);
1191#endif 1190#endif
1192 1191
1193#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1192#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1198,9 +1197,9 @@ int ht_create_irq(struct pci_dev *dev, int idx);
1198void ht_destroy_irq(unsigned int irq); 1197void ht_destroy_irq(unsigned int irq);
1199#endif /* CONFIG_HT_IRQ */ 1198#endif /* CONFIG_HT_IRQ */
1200 1199
1201extern void pci_cfg_access_lock(struct pci_dev *dev); 1200void pci_cfg_access_lock(struct pci_dev *dev);
1202extern bool pci_cfg_access_trylock(struct pci_dev *dev); 1201bool pci_cfg_access_trylock(struct pci_dev *dev);
1203extern void pci_cfg_access_unlock(struct pci_dev *dev); 1202void pci_cfg_access_unlock(struct pci_dev *dev);
1204 1203
1205/* 1204/*
1206 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1205 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
@@ -1225,7 +1224,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
1225/* some architectures require additional setup to direct VGA traffic */ 1224/* some architectures require additional setup to direct VGA traffic */
1226typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1225typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1227 unsigned int command_bits, u32 flags); 1226 unsigned int command_bits, u32 flags);
1228extern void pci_register_set_vga_state(arch_set_vga_state_t func); 1227void pci_register_set_vga_state(arch_set_vga_state_t func);
1229 1228
1230#else /* CONFIG_PCI is not enabled */ 1229#else /* CONFIG_PCI is not enabled */
1231 1230
@@ -1627,8 +1626,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1627int pcibios_add_device(struct pci_dev *dev); 1626int pcibios_add_device(struct pci_dev *dev);
1628 1627
1629#ifdef CONFIG_PCI_MMCONFIG 1628#ifdef CONFIG_PCI_MMCONFIG
1630extern void __init pci_mmcfg_early_init(void); 1629void __init pci_mmcfg_early_init(void);
1631extern void __init pci_mmcfg_late_init(void); 1630void __init pci_mmcfg_late_init(void);
1632#else 1631#else
1633static inline void pci_mmcfg_early_init(void) { } 1632static inline void pci_mmcfg_early_init(void) { }
1634static inline void pci_mmcfg_late_init(void) { } 1633static inline void pci_mmcfg_late_init(void) { }
@@ -1639,12 +1638,12 @@ int pci_ext_cfg_avail(void);
1639void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1638void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1640 1639
1641#ifdef CONFIG_PCI_IOV 1640#ifdef CONFIG_PCI_IOV
1642extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1641int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1643extern void pci_disable_sriov(struct pci_dev *dev); 1642void pci_disable_sriov(struct pci_dev *dev);
1644extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1643irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1645extern int pci_num_vf(struct pci_dev *dev); 1644int pci_num_vf(struct pci_dev *dev);
1646extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1645int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1647extern int pci_sriov_get_totalvfs(struct pci_dev *dev); 1646int pci_sriov_get_totalvfs(struct pci_dev *dev);
1648#else 1647#else
1649static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1648static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1650{ 1649{
@@ -1672,8 +1671,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1672#endif 1671#endif
1673 1672
1674#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1673#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1675extern void pci_hp_create_module_link(struct pci_slot *pci_slot); 1674void pci_hp_create_module_link(struct pci_slot *pci_slot);
1676extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1675void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1677#endif 1676#endif
1678 1677
1679/** 1678/**
@@ -1817,13 +1816,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1817/* PCI <-> OF binding helpers */ 1816/* PCI <-> OF binding helpers */
1818#ifdef CONFIG_OF 1817#ifdef CONFIG_OF
1819struct device_node; 1818struct device_node;
1820extern void pci_set_of_node(struct pci_dev *dev); 1819void pci_set_of_node(struct pci_dev *dev);
1821extern void pci_release_of_node(struct pci_dev *dev); 1820void pci_release_of_node(struct pci_dev *dev);
1822extern void pci_set_bus_of_node(struct pci_bus *bus); 1821void pci_set_bus_of_node(struct pci_bus *bus);
1823extern void pci_release_bus_of_node(struct pci_bus *bus); 1822void pci_release_bus_of_node(struct pci_bus *bus);
1824 1823
1825/* Arch may override this (weak) */ 1824/* Arch may override this (weak) */
1826extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); 1825struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1827 1826
1828static inline struct device_node * 1827static inline struct device_node *
1829pci_device_to_OF_node(const struct pci_dev *pdev) 1828pci_device_to_OF_node(const struct pci_dev *pdev)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 45fc162cbdc0..8db71dcd6337 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -125,12 +125,12 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
125 return pci_slot_name(slot->pci_slot); 125 return pci_slot_name(slot->pci_slot);
126} 126}
127 127
128extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, 128int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr,
129 int nr, const char *name, 129 const char *name, struct module *owner,
130 struct module *owner, const char *mod_name); 130 const char *mod_name);
131extern int pci_hp_deregister(struct hotplug_slot *slot); 131int pci_hp_deregister(struct hotplug_slot *slot);
132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 132int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
133 struct hotplug_slot_info *info); 133 struct hotplug_slot_info *info);
134 134
135/* use a define to avoid include chaining to get THIS_MODULE & friends */ 135/* use a define to avoid include chaining to get THIS_MODULE & friends */
136#define pci_hp_register(slot, pbus, devnr, name) \ 136#define pci_hp_register(slot, pbus, devnr, name) \
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h
index e6f91b1406d8..9572669eea97 100644
--- a/include/linux/pcieport_if.h
+++ b/include/linux/pcieport_if.h
@@ -62,7 +62,7 @@ struct pcie_port_service_driver {
62#define to_service_driver(d) \ 62#define to_service_driver(d) \
63 container_of(d, struct pcie_port_service_driver, driver) 63 container_of(d, struct pcie_port_service_driver, driver)
64 64
65extern int pcie_port_service_register(struct pcie_port_service_driver *new); 65int pcie_port_service_register(struct pcie_port_service_driver *new);
66extern void pcie_port_service_unregister(struct pcie_port_service_driver *new); 66void pcie_port_service_unregister(struct pcie_port_service_driver *new);
67 67
68#endif /* _PCIEPORT_IF_H_ */ 68#endif /* _PCIEPORT_IF_H_ */