diff options
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 89 |
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 | ||
11 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); | 11 | int pci_create_sysfs_dev_files(struct pci_dev *pdev); |
12 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); | 12 | void 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) |
14 | static inline void pci_create_firmware_label_files(struct pci_dev *pdev) | 14 | static inline void pci_create_firmware_label_files(struct pci_dev *pdev) |
15 | { return; } | 15 | { return; } |
16 | static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) | 16 | static inline void pci_remove_firmware_label_files(struct pci_dev *pdev) |
17 | { return; } | 17 | { return; } |
18 | #else | 18 | #else |
19 | extern void pci_create_firmware_label_files(struct pci_dev *pdev); | 19 | void pci_create_firmware_label_files(struct pci_dev *pdev); |
20 | extern void pci_remove_firmware_label_files(struct pci_dev *pdev); | 20 | void pci_remove_firmware_label_files(struct pci_dev *pdev); |
21 | #endif | 21 | #endif |
22 | extern void pci_cleanup_rom(struct pci_dev *dev); | 22 | void pci_cleanup_rom(struct pci_dev *dev); |
23 | #ifdef HAVE_PCI_MMAP | 23 | #ifdef HAVE_PCI_MMAP |
24 | enum pci_mmap_api { | 24 | enum 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 | }; |
28 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, | 28 | int 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 |
32 | int pci_probe_reset_function(struct pci_dev *dev); | 31 | int 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 | ||
63 | extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); | 62 | int pci_set_platform_pm(struct pci_platform_pm_ops *ops); |
64 | extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); | 63 | void pci_update_current_state(struct pci_dev *dev, pci_power_t state); |
65 | extern void pci_power_up(struct pci_dev *dev); | 64 | void pci_power_up(struct pci_dev *dev); |
66 | extern void pci_disable_enabled_device(struct pci_dev *dev); | 65 | void pci_disable_enabled_device(struct pci_dev *dev); |
67 | extern int pci_finish_runtime_suspend(struct pci_dev *dev); | 66 | int pci_finish_runtime_suspend(struct pci_dev *dev); |
68 | extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); | 67 | int __pci_pme_wakeup(struct pci_dev *dev, void *ign); |
69 | extern void pci_wakeup_bus(struct pci_bus *bus); | 68 | void pci_wakeup_bus(struct pci_bus *bus); |
70 | extern void pci_config_pm_runtime_get(struct pci_dev *dev); | 69 | void pci_config_pm_runtime_get(struct pci_dev *dev); |
71 | extern void pci_config_pm_runtime_put(struct pci_dev *dev); | 70 | void pci_config_pm_runtime_put(struct pci_dev *dev); |
72 | extern void pci_pm_init(struct pci_dev *dev); | 71 | void pci_pm_init(struct pci_dev *dev); |
73 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | 72 | void pci_allocate_cap_save_buffers(struct pci_dev *dev); |
74 | void pci_free_cap_save_buffers(struct pci_dev *dev); | 73 | void pci_free_cap_save_buffers(struct pci_dev *dev); |
75 | 74 | ||
76 | static inline void pci_wakeup_event(struct pci_dev *dev) | 75 | static 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 | ||
99 | extern int pci_vpd_pci22_init(struct pci_dev *dev); | 98 | int pci_vpd_pci22_init(struct pci_dev *dev); |
100 | static inline void pci_vpd_release(struct pci_dev *dev) | 99 | static 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 |
108 | extern int pci_proc_attach_device(struct pci_dev *dev); | 107 | int pci_proc_attach_device(struct pci_dev *dev); |
109 | extern int pci_proc_detach_device(struct pci_dev *dev); | 108 | int pci_proc_detach_device(struct pci_dev *dev); |
110 | extern int pci_proc_detach_bus(struct pci_bus *bus); | 109 | int pci_proc_detach_bus(struct pci_bus *bus); |
111 | #else | 110 | #else |
112 | static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } | 111 | static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; } |
113 | static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; } | 112 | static 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; } | |||
118 | int pci_hp_add_bridge(struct pci_dev *dev); | 117 | int pci_hp_add_bridge(struct pci_dev *dev); |
119 | 118 | ||
120 | #ifdef HAVE_PCI_LEGACY | 119 | #ifdef HAVE_PCI_LEGACY |
121 | extern void pci_create_legacy_files(struct pci_bus *bus); | 120 | void pci_create_legacy_files(struct pci_bus *bus); |
122 | extern void pci_remove_legacy_files(struct pci_bus *bus); | 121 | void pci_remove_legacy_files(struct pci_bus *bus); |
123 | #else | 122 | #else |
124 | static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } | 123 | static inline void pci_create_legacy_files(struct pci_bus *bus) { return; } |
125 | static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; } | 124 | static 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 |
136 | void pci_no_msi(void); | 135 | void pci_no_msi(void); |
137 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); | 136 | void pci_msi_init_pci_dev(struct pci_dev *dev); |
138 | #else | 137 | #else |
139 | static inline void pci_no_msi(void) { } | 138 | static inline void pci_no_msi(void) { } |
140 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 139 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
@@ -198,12 +197,11 @@ enum pci_bar_type { | |||
198 | 197 | ||
199 | bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, | 198 | bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, |
200 | int crs_timeout); | 199 | int crs_timeout); |
201 | extern int pci_setup_device(struct pci_dev *dev); | 200 | int pci_setup_device(struct pci_dev *dev); |
202 | extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | 201 | int __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); |
204 | extern int pci_resource_bar(struct pci_dev *dev, int resno, | 203 | int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type); |
205 | enum pci_bar_type *type); | 204 | void pci_configure_ari(struct pci_dev *dev); |
206 | extern 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 | ||
219 | void pci_reassigndev_resource_alignment(struct pci_dev *dev); | 217 | void pci_reassigndev_resource_alignment(struct pci_dev *dev); |
220 | extern void pci_disable_bridge_window(struct pci_dev *dev); | 218 | void pci_disable_bridge_window(struct pci_dev *dev); |
221 | 219 | ||
222 | /* Single Root I/O Virtualization */ | 220 | /* Single Root I/O Virtualization */ |
223 | struct pci_sriov { | 221 | struct pci_sriov { |
@@ -241,7 +239,7 @@ struct pci_sriov { | |||
241 | }; | 239 | }; |
242 | 240 | ||
243 | #ifdef CONFIG_PCI_ATS | 241 | #ifdef CONFIG_PCI_ATS |
244 | extern void pci_restore_ats_state(struct pci_dev *dev); | 242 | void pci_restore_ats_state(struct pci_dev *dev); |
245 | #else | 243 | #else |
246 | static inline void pci_restore_ats_state(struct pci_dev *dev) | 244 | static 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 |
252 | extern int pci_iov_init(struct pci_dev *dev); | 250 | int pci_iov_init(struct pci_dev *dev); |
253 | extern void pci_iov_release(struct pci_dev *dev); | 251 | void pci_iov_release(struct pci_dev *dev); |
254 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, | 252 | int pci_iov_resource_bar(struct pci_dev *dev, int resno, |
255 | enum pci_bar_type *type); | 253 | enum pci_bar_type *type); |
256 | extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, | 254 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno); |
257 | int resno); | 255 | void pci_restore_iov_state(struct pci_dev *dev); |
258 | extern void pci_restore_iov_state(struct pci_dev *dev); | 256 | int pci_iov_bus_range(struct pci_bus *bus); |
259 | extern int pci_iov_bus_range(struct pci_bus *bus); | ||
260 | 257 | ||
261 | #else | 258 | #else |
262 | static inline int pci_iov_init(struct pci_dev *dev) | 259 | static 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 | ||
285 | extern unsigned long pci_cardbus_resource_alignment(struct resource *); | 282 | unsigned long pci_cardbus_resource_alignment(struct resource *); |
286 | 283 | ||
287 | static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, | 284 | static 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 | ||
301 | extern void pci_enable_acs(struct pci_dev *dev); | 298 | void pci_enable_acs(struct pci_dev *dev); |
302 | 299 | ||
303 | struct pci_dev_reset_methods { | 300 | struct 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 |
310 | extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); | 307 | int pci_dev_specific_reset(struct pci_dev *dev, int probe); |
311 | #else | 308 | #else |
312 | static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) | 309 | static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) |
313 | { | 310 | { |