aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-04-17 12:31:34 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-17 12:31:34 -0400
commit723ec4d06cb2eed481436cfe008f5f63c45e88fd (patch)
treee59112af8616e8fbc0cc6c2219b49fd2f05bfc41 /include/linux/pci.h
parenta3b6bbd5774c13dab89d72f79976ba762913b2f2 (diff)
parentf39d5b72913e2a9ff00ba5ab145ee05a888b1286 (diff)
Merge branch 'pci/cleanup' into next
* pci/cleanup: PCI: Remove "extern" from function declarations PCI: Warn about failures instead of "must_check" functions PCI: Remove __must_check from definitions PCI: Remove unused variables PCI: Move cpci_hotplug_init() proto to header file PCI: Make local functions/structs static PCI: Fix missing prototype for pcie_port_acpi_setup() Conflicts: drivers/pci/hotplug/acpiphp.h include/linux/pci.h
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h95
1 files changed, 47 insertions, 48 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4a6ee631a0c5..8aaca26a2b32 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -363,7 +363,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
363 return dev; 363 return dev;
364} 364}
365 365
366extern struct pci_dev *alloc_pci_dev(void); 366struct pci_dev *alloc_pci_dev(void);
367 367
368#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 368#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
369#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 369#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -519,10 +519,10 @@ struct pci_ops {
519 * ACPI needs to be able to access PCI config space before we've done a 519 * ACPI needs to be able to access PCI config space before we've done a
520 * PCI bus scan and created pci_bus structures. 520 * PCI bus scan and created pci_bus structures.
521 */ 521 */
522extern int raw_pci_read(unsigned int domain, unsigned int bus, 522int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
523 unsigned int devfn, int reg, int len, u32 *val); 523 int reg, int len, u32 *val);
524extern int raw_pci_write(unsigned int domain, unsigned int bus, 524int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
525 unsigned int devfn, int reg, int len, u32 val); 525 int reg, int len, u32 val);
526 526
527struct pci_bus_region { 527struct pci_bus_region {
528 resource_size_t start; 528 resource_size_t start;
@@ -673,7 +673,7 @@ struct pci_driver {
673/* these external functions are only available when PCI support is enabled */ 673/* these external functions are only available when PCI support is enabled */
674#ifdef CONFIG_PCI 674#ifdef CONFIG_PCI
675 675
676extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 676void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
677 677
678enum pcie_bus_config_types { 678enum pcie_bus_config_types {
679 PCIE_BUS_TUNE_OFF, 679 PCIE_BUS_TUNE_OFF,
@@ -690,7 +690,7 @@ extern struct bus_type pci_bus_type;
690 * code, or pci core code. */ 690 * code, or pci core code. */
691extern struct list_head pci_root_buses; /* list of all known PCI buses */ 691extern struct list_head pci_root_buses; /* list of all known PCI buses */
692/* Some device drivers need know if pci is initiated */ 692/* Some device drivers need know if pci is initiated */
693extern int no_pci_devices(void); 693int no_pci_devices(void);
694 694
695void pcibios_resource_survey_bus(struct pci_bus *bus); 695void pcibios_resource_survey_bus(struct pci_bus *bus);
696void pcibios_add_bus(struct pci_bus *bus); 696void pcibios_add_bus(struct pci_bus *bus);
@@ -716,7 +716,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
716void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 716void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
717 struct pci_bus_region *region); 717 struct pci_bus_region *region);
718void pcibios_scan_specific_bus(int busn); 718void pcibios_scan_specific_bus(int busn);
719extern struct pci_bus *pci_find_bus(int domain, int busnr); 719struct pci_bus *pci_find_bus(int domain, int busnr);
720void pci_bus_add_devices(const struct pci_bus *bus); 720void pci_bus_add_devices(const struct pci_bus *bus);
721struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 721struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
722 struct pci_ops *ops, void *sysdata); 722 struct pci_ops *ops, void *sysdata);
@@ -749,14 +749,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,
749u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); 749u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
750int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 750int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
751u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); 751u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
752extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 752struct pci_dev *pci_dev_get(struct pci_dev *dev);
753extern void pci_dev_put(struct pci_dev *dev); 753void pci_dev_put(struct pci_dev *dev);
754extern void pci_remove_bus(struct pci_bus *b); 754void pci_remove_bus(struct pci_bus *b);
755extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 755void pci_stop_and_remove_bus_device(struct pci_dev *dev);
756void pci_stop_root_bus(struct pci_bus *bus); 756void pci_stop_root_bus(struct pci_bus *bus);
757void pci_remove_root_bus(struct pci_bus *bus); 757void pci_remove_root_bus(struct pci_bus *bus);
758void pci_setup_cardbus(struct pci_bus *bus); 758void pci_setup_cardbus(struct pci_bus *bus);
759extern void pci_sort_breadthfirst(void); 759void pci_sort_breadthfirst(void);
760#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 760#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
761#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) 761#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
762#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) 762#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
@@ -1158,18 +1158,17 @@ static inline int pci_msi_enabled(void)
1158 return 0; 1158 return 0;
1159} 1159}
1160#else 1160#else
1161extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); 1161int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1162extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); 1162int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1163extern void pci_msi_shutdown(struct pci_dev *dev); 1163void pci_msi_shutdown(struct pci_dev *dev);
1164extern void pci_disable_msi(struct pci_dev *dev); 1164void pci_disable_msi(struct pci_dev *dev);
1165extern int pci_msix_table_size(struct pci_dev *dev); 1165int pci_msix_table_size(struct pci_dev *dev);
1166extern int pci_enable_msix(struct pci_dev *dev, 1166int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1167 struct msix_entry *entries, int nvec); 1167void pci_msix_shutdown(struct pci_dev *dev);
1168extern void pci_msix_shutdown(struct pci_dev *dev); 1168void pci_disable_msix(struct pci_dev *dev);
1169extern void pci_disable_msix(struct pci_dev *dev); 1169void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1170extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1170void pci_restore_msi_state(struct pci_dev *dev);
1171extern void pci_restore_msi_state(struct pci_dev *dev); 1171int pci_msi_enabled(void);
1172extern int pci_msi_enabled(void);
1173#endif 1172#endif
1174 1173
1175#ifdef CONFIG_PCIEPORTBUS 1174#ifdef CONFIG_PCIEPORTBUS
@@ -1184,8 +1183,8 @@ extern bool pcie_ports_auto;
1184static inline int pcie_aspm_enabled(void) { return 0; } 1183static inline int pcie_aspm_enabled(void) { return 0; }
1185static inline bool pcie_aspm_support_enabled(void) { return false; } 1184static inline bool pcie_aspm_support_enabled(void) { return false; }
1186#else 1185#else
1187extern int pcie_aspm_enabled(void); 1186int pcie_aspm_enabled(void);
1188extern bool pcie_aspm_support_enabled(void); 1187bool pcie_aspm_support_enabled(void);
1189#endif 1188#endif
1190 1189
1191#ifdef CONFIG_PCIEAER 1190#ifdef CONFIG_PCIEAER
@@ -1203,8 +1202,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1203} 1202}
1204static inline void pcie_ecrc_get_policy(char *str) {}; 1203static inline void pcie_ecrc_get_policy(char *str) {};
1205#else 1204#else
1206extern void pcie_set_ecrc_checking(struct pci_dev *dev); 1205void pcie_set_ecrc_checking(struct pci_dev *dev);
1207extern void pcie_ecrc_get_policy(char *str); 1206void pcie_ecrc_get_policy(char *str);
1208#endif 1207#endif
1209 1208
1210#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1209#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1215,9 +1214,9 @@ int ht_create_irq(struct pci_dev *dev, int idx);
1215void ht_destroy_irq(unsigned int irq); 1214void ht_destroy_irq(unsigned int irq);
1216#endif /* CONFIG_HT_IRQ */ 1215#endif /* CONFIG_HT_IRQ */
1217 1216
1218extern void pci_cfg_access_lock(struct pci_dev *dev); 1217void pci_cfg_access_lock(struct pci_dev *dev);
1219extern bool pci_cfg_access_trylock(struct pci_dev *dev); 1218bool pci_cfg_access_trylock(struct pci_dev *dev);
1220extern void pci_cfg_access_unlock(struct pci_dev *dev); 1219void pci_cfg_access_unlock(struct pci_dev *dev);
1221 1220
1222/* 1221/*
1223 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1222 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
@@ -1242,7 +1241,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
1242/* some architectures require additional setup to direct VGA traffic */ 1241/* some architectures require additional setup to direct VGA traffic */
1243typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1242typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1244 unsigned int command_bits, u32 flags); 1243 unsigned int command_bits, u32 flags);
1245extern void pci_register_set_vga_state(arch_set_vga_state_t func); 1244void pci_register_set_vga_state(arch_set_vga_state_t func);
1246 1245
1247#else /* CONFIG_PCI is not enabled */ 1246#else /* CONFIG_PCI is not enabled */
1248 1247
@@ -1644,8 +1643,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1644int pcibios_add_device(struct pci_dev *dev); 1643int pcibios_add_device(struct pci_dev *dev);
1645 1644
1646#ifdef CONFIG_PCI_MMCONFIG 1645#ifdef CONFIG_PCI_MMCONFIG
1647extern void __init pci_mmcfg_early_init(void); 1646void __init pci_mmcfg_early_init(void);
1648extern void __init pci_mmcfg_late_init(void); 1647void __init pci_mmcfg_late_init(void);
1649#else 1648#else
1650static inline void pci_mmcfg_early_init(void) { } 1649static inline void pci_mmcfg_early_init(void) { }
1651static inline void pci_mmcfg_late_init(void) { } 1650static inline void pci_mmcfg_late_init(void) { }
@@ -1656,12 +1655,12 @@ int pci_ext_cfg_avail(void);
1656void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1655void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1657 1656
1658#ifdef CONFIG_PCI_IOV 1657#ifdef CONFIG_PCI_IOV
1659extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1658int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1660extern void pci_disable_sriov(struct pci_dev *dev); 1659void pci_disable_sriov(struct pci_dev *dev);
1661extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1660irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1662extern int pci_num_vf(struct pci_dev *dev); 1661int pci_num_vf(struct pci_dev *dev);
1663extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1662int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1664extern int pci_sriov_get_totalvfs(struct pci_dev *dev); 1663int pci_sriov_get_totalvfs(struct pci_dev *dev);
1665#else 1664#else
1666static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1665static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1667{ 1666{
@@ -1689,8 +1688,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1689#endif 1688#endif
1690 1689
1691#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1690#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1692extern void pci_hp_create_module_link(struct pci_slot *pci_slot); 1691void pci_hp_create_module_link(struct pci_slot *pci_slot);
1693extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1692void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1694#endif 1693#endif
1695 1694
1696/** 1695/**
@@ -1834,13 +1833,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1834/* PCI <-> OF binding helpers */ 1833/* PCI <-> OF binding helpers */
1835#ifdef CONFIG_OF 1834#ifdef CONFIG_OF
1836struct device_node; 1835struct device_node;
1837extern void pci_set_of_node(struct pci_dev *dev); 1836void pci_set_of_node(struct pci_dev *dev);
1838extern void pci_release_of_node(struct pci_dev *dev); 1837void pci_release_of_node(struct pci_dev *dev);
1839extern void pci_set_bus_of_node(struct pci_bus *bus); 1838void pci_set_bus_of_node(struct pci_bus *bus);
1840extern void pci_release_bus_of_node(struct pci_bus *bus); 1839void pci_release_bus_of_node(struct pci_bus *bus);
1841 1840
1842/* Arch may override this (weak) */ 1841/* Arch may override this (weak) */
1843extern struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); 1842struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
1844 1843
1845static inline struct device_node * 1844static inline struct device_node *
1846pci_device_to_OF_node(const struct pci_dev *pdev) 1845pci_device_to_OF_node(const struct pci_dev *pdev)