aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h89
1 files changed, 43 insertions, 46 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 7346ee68f47d..68678ed76b0d 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -8,26 +8,25 @@
8 8
9/* Functions internal to the PCI core code */ 9/* Functions internal to the PCI core code */
10 10
11extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); 11int pci_create_sysfs_dev_files(struct pci_dev *pdev);
12extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 12void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
13#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI) 13#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
14static inline void pci_create_firmware_label_files(struct pci_dev *pdev) 14static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
15{ return; } 15{ return; }
16static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) 16static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
17{ return; } 17{ return; }
18#else 18#else
19extern void pci_create_firmware_label_files(struct pci_dev *pdev); 19void pci_create_firmware_label_files(struct pci_dev *pdev);
20extern void pci_remove_firmware_label_files(struct pci_dev *pdev); 20void pci_remove_firmware_label_files(struct pci_dev *pdev);
21#endif 21#endif
22extern void pci_cleanup_rom(struct pci_dev *dev); 22void pci_cleanup_rom(struct pci_dev *dev);
23#ifdef HAVE_PCI_MMAP 23#ifdef HAVE_PCI_MMAP
24enum pci_mmap_api { 24enum pci_mmap_api {
25 PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ 25 PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */
26 PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ 26 PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */
27}; 27};
28extern int pci_mmap_fits(struct pci_dev *pdev, int resno, 28int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vmai,
29 struct vm_area_struct *vmai, 29 enum pci_mmap_api mmap_api);
30 enum pci_mmap_api mmap_api);
31#endif 30#endif
32int pci_probe_reset_function(struct pci_dev *dev); 31int pci_probe_reset_function(struct pci_dev *dev);
33 32
@@ -60,17 +59,17 @@ struct pci_platform_pm_ops {
60 int (*run_wake)(struct pci_dev *dev, bool enable); 59 int (*run_wake)(struct pci_dev *dev, bool enable);
61}; 60};
62 61
63extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 62int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
64extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); 63void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
65extern void pci_power_up(struct pci_dev *dev); 64void pci_power_up(struct pci_dev *dev);
66extern void pci_disable_enabled_device(struct pci_dev *dev); 65void pci_disable_enabled_device(struct pci_dev *dev);
67extern int pci_finish_runtime_suspend(struct pci_dev *dev); 66int pci_finish_runtime_suspend(struct pci_dev *dev);
68extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); 67int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
69extern void pci_wakeup_bus(struct pci_bus *bus); 68void pci_wakeup_bus(struct pci_bus *bus);
70extern void pci_config_pm_runtime_get(struct pci_dev *dev); 69void pci_config_pm_runtime_get(struct pci_dev *dev);
71extern void pci_config_pm_runtime_put(struct pci_dev *dev); 70void pci_config_pm_runtime_put(struct pci_dev *dev);
72extern void pci_pm_init(struct pci_dev *dev); 71void pci_pm_init(struct pci_dev *dev);
73extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); 72void pci_allocate_cap_save_buffers(struct pci_dev *dev);
74void pci_free_cap_save_buffers(struct pci_dev *dev); 73void pci_free_cap_save_buffers(struct pci_dev *dev);
75 74
76static inline void pci_wakeup_event(struct pci_dev *dev) 75static inline void pci_wakeup_event(struct pci_dev *dev)
@@ -96,7 +95,7 @@ struct pci_vpd {
96 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ 95 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */
97}; 96};
98 97
99extern int pci_vpd_pci22_init(struct pci_dev *dev); 98int pci_vpd_pci22_init(struct pci_dev *dev);
100static inline void pci_vpd_release(struct pci_dev *dev) 99static inline void pci_vpd_release(struct pci_dev *dev)
101{ 100{
102 if (dev->vpd) 101 if (dev->vpd)
@@ -105,9 +104,9 @@ static inline void pci_vpd_release(struct pci_dev *dev)
105 104
106/* PCI /proc functions */ 105/* PCI /proc functions */
107#ifdef CONFIG_PROC_FS 106#ifdef CONFIG_PROC_FS
108extern int pci_proc_attach_device(struct pci_dev *dev); 107int pci_proc_attach_device(struct pci_dev *dev);
109extern int pci_proc_detach_device(struct pci_dev *dev); 108int pci_proc_detach_device(struct pci_dev *dev);
110extern int pci_proc_detach_bus(struct pci_bus *bus); 109int pci_proc_detach_bus(struct pci_bus *bus);
111#else 110#else
112static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } 111static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; }
113static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; } 112static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; }
@@ -118,8 +117,8 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
118int pci_hp_add_bridge(struct pci_dev *dev); 117int pci_hp_add_bridge(struct pci_dev *dev);
119 118
120#ifdef HAVE_PCI_LEGACY 119#ifdef HAVE_PCI_LEGACY
121extern void pci_create_legacy_files(struct pci_bus *bus); 120void pci_create_legacy_files(struct pci_bus *bus);
122extern void pci_remove_legacy_files(struct pci_bus *bus); 121void pci_remove_legacy_files(struct pci_bus *bus);
123#else 122#else
124static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } 123static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }
125static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; } 124static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; }
@@ -134,7 +133,7 @@ extern unsigned int pci_pm_d3_delay;
134 133
135#ifdef CONFIG_PCI_MSI 134#ifdef CONFIG_PCI_MSI
136void pci_no_msi(void); 135void pci_no_msi(void);
137extern void pci_msi_init_pci_dev(struct pci_dev *dev); 136void pci_msi_init_pci_dev(struct pci_dev *dev);
138#else 137#else
139static inline void pci_no_msi(void) { } 138static inline void pci_no_msi(void) { }
140static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } 139static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
@@ -198,12 +197,11 @@ enum pci_bar_type {
198 197
199bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, 198bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
200 int crs_timeout); 199 int crs_timeout);
201extern int pci_setup_device(struct pci_dev *dev); 200int pci_setup_device(struct pci_dev *dev);
202extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, 201int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
203 struct resource *res, unsigned int reg); 202 struct resource *res, unsigned int reg);
204extern int pci_resource_bar(struct pci_dev *dev, int resno, 203int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type);
205 enum pci_bar_type *type); 204void pci_configure_ari(struct pci_dev *dev);
206extern void pci_configure_ari(struct pci_dev *dev);
207 205
208/** 206/**
209 * pci_ari_enabled - query ARI forwarding status 207 * pci_ari_enabled - query ARI forwarding status
@@ -217,7 +215,7 @@ static inline int pci_ari_enabled(struct pci_bus *bus)
217} 215}
218 216
219void pci_reassigndev_resource_alignment(struct pci_dev *dev); 217void pci_reassigndev_resource_alignment(struct pci_dev *dev);
220extern void pci_disable_bridge_window(struct pci_dev *dev); 218void pci_disable_bridge_window(struct pci_dev *dev);
221 219
222/* Single Root I/O Virtualization */ 220/* Single Root I/O Virtualization */
223struct pci_sriov { 221struct pci_sriov {
@@ -241,7 +239,7 @@ struct pci_sriov {
241}; 239};
242 240
243#ifdef CONFIG_PCI_ATS 241#ifdef CONFIG_PCI_ATS
244extern void pci_restore_ats_state(struct pci_dev *dev); 242void pci_restore_ats_state(struct pci_dev *dev);
245#else 243#else
246static inline void pci_restore_ats_state(struct pci_dev *dev) 244static inline void pci_restore_ats_state(struct pci_dev *dev)
247{ 245{
@@ -249,14 +247,13 @@ static inline void pci_restore_ats_state(struct pci_dev *dev)
249#endif /* CONFIG_PCI_ATS */ 247#endif /* CONFIG_PCI_ATS */
250 248
251#ifdef CONFIG_PCI_IOV 249#ifdef CONFIG_PCI_IOV
252extern int pci_iov_init(struct pci_dev *dev); 250int pci_iov_init(struct pci_dev *dev);
253extern void pci_iov_release(struct pci_dev *dev); 251void pci_iov_release(struct pci_dev *dev);
254extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, 252int pci_iov_resource_bar(struct pci_dev *dev, int resno,
255 enum pci_bar_type *type); 253 enum pci_bar_type *type);
256extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, 254resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
257 int resno); 255void pci_restore_iov_state(struct pci_dev *dev);
258extern void pci_restore_iov_state(struct pci_dev *dev); 256int pci_iov_bus_range(struct pci_bus *bus);
259extern int pci_iov_bus_range(struct pci_bus *bus);
260 257
261#else 258#else
262static inline int pci_iov_init(struct pci_dev *dev) 259static inline int pci_iov_init(struct pci_dev *dev)
@@ -282,10 +279,10 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
282 279
283#endif /* CONFIG_PCI_IOV */ 280#endif /* CONFIG_PCI_IOV */
284 281
285extern unsigned long pci_cardbus_resource_alignment(struct resource *); 282unsigned long pci_cardbus_resource_alignment(struct resource *);
286 283
287static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, 284static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
288 struct resource *res) 285 struct resource *res)
289{ 286{
290#ifdef CONFIG_PCI_IOV 287#ifdef CONFIG_PCI_IOV
291 int resno = res - dev->resource; 288 int resno = res - dev->resource;
@@ -298,7 +295,7 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
298 return resource_alignment(res); 295 return resource_alignment(res);
299} 296}
300 297
301extern void pci_enable_acs(struct pci_dev *dev); 298void pci_enable_acs(struct pci_dev *dev);
302 299
303struct pci_dev_reset_methods { 300struct pci_dev_reset_methods {
304 u16 vendor; 301 u16 vendor;
@@ -307,7 +304,7 @@ struct pci_dev_reset_methods {
307}; 304};
308 305
309#ifdef CONFIG_PCI_QUIRKS 306#ifdef CONFIG_PCI_QUIRKS
310extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); 307int pci_dev_specific_reset(struct pci_dev *dev, int probe);
311#else 308#else
312static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) 309static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe)
313{ 310{