]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/pci/pci.h
7f9fd93270eda3a7863bc9ca8d3a3e62ba4a8082
[linux.git] / drivers / pci / pci.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef DRIVERS_PCI_H
3 #define DRIVERS_PCI_H
4
5 #include <linux/pci.h>
6
7 #define PCI_FIND_CAP_TTL        48
8
9 #define PCI_VSEC_ID_INTEL_TBT   0x1234  /* Thunderbolt */
10
11 extern const unsigned char pcie_link_speed[];
12 extern bool pci_early_dump;
13
14 bool pcie_cap_has_lnkctl(const struct pci_dev *dev);
15
16 /* Functions internal to the PCI core code */
17
18 int pci_create_sysfs_dev_files(struct pci_dev *pdev);
19 void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
20 #if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
21 static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
22 { return; }
23 static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
24 { return; }
25 #else
26 void pci_create_firmware_label_files(struct pci_dev *pdev);
27 void pci_remove_firmware_label_files(struct pci_dev *pdev);
28 #endif
29 void pci_cleanup_rom(struct pci_dev *dev);
30
31 enum pci_mmap_api {
32         PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */
33         PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */
34 };
35 int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vmai,
36                   enum pci_mmap_api mmap_api);
37
38 int pci_probe_reset_function(struct pci_dev *dev);
39 int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
40 int pci_bus_error_reset(struct pci_dev *dev);
41
42 /**
43  * struct pci_platform_pm_ops - Firmware PM callbacks
44  *
45  * @bridge_d3: Does the bridge allow entering into D3
46  *
47  * @is_manageable: returns 'true' if given device is power manageable by the
48  *                 platform firmware
49  *
50  * @set_state: invokes the platform firmware to set the device's power state
51  *
52  * @get_state: queries the platform firmware for a device's current power state
53  *
54  * @choose_state: returns PCI power state of given device preferred by the
55  *                platform; to be used during system-wide transitions from a
56  *                sleeping state to the working state and vice versa
57  *
58  * @set_wakeup: enables/disables wakeup capability for the device
59  *
60  * @need_resume: returns 'true' if the given device (which is currently
61  *               suspended) needs to be resumed to be configured for system
62  *               wakeup.
63  *
64  * If given platform is generally capable of power managing PCI devices, all of
65  * these callbacks are mandatory.
66  */
67 struct pci_platform_pm_ops {
68         bool (*bridge_d3)(struct pci_dev *dev);
69         bool (*is_manageable)(struct pci_dev *dev);
70         int (*set_state)(struct pci_dev *dev, pci_power_t state);
71         pci_power_t (*get_state)(struct pci_dev *dev);
72         pci_power_t (*choose_state)(struct pci_dev *dev);
73         int (*set_wakeup)(struct pci_dev *dev, bool enable);
74         bool (*need_resume)(struct pci_dev *dev);
75 };
76
77 int pci_set_platform_pm(const struct pci_platform_pm_ops *ops);
78 void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
79 void pci_power_up(struct pci_dev *dev);
80 void pci_disable_enabled_device(struct pci_dev *dev);
81 int pci_finish_runtime_suspend(struct pci_dev *dev);
82 void pcie_clear_root_pme_status(struct pci_dev *dev);
83 int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
84 void pci_pme_restore(struct pci_dev *dev);
85 bool pci_dev_need_resume(struct pci_dev *dev);
86 void pci_dev_adjust_pme(struct pci_dev *dev);
87 void pci_dev_complete_resume(struct pci_dev *pci_dev);
88 void pci_config_pm_runtime_get(struct pci_dev *dev);
89 void pci_config_pm_runtime_put(struct pci_dev *dev);
90 void pci_pm_init(struct pci_dev *dev);
91 void pci_ea_init(struct pci_dev *dev);
92 void pci_allocate_cap_save_buffers(struct pci_dev *dev);
93 void pci_free_cap_save_buffers(struct pci_dev *dev);
94 bool pci_bridge_d3_possible(struct pci_dev *dev);
95 void pci_bridge_d3_update(struct pci_dev *dev);
96
97 static inline void pci_wakeup_event(struct pci_dev *dev)
98 {
99         /* Wait 100 ms before the system can be put into a sleep state. */
100         pm_wakeup_event(&dev->dev, 100);
101 }
102
103 static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
104 {
105         return !!(pci_dev->subordinate);
106 }
107
108 static inline bool pci_power_manageable(struct pci_dev *pci_dev)
109 {
110         /*
111          * Currently we allow normal PCI devices and PCI bridges transition
112          * into D3 if their bridge_d3 is set.
113          */
114         return !pci_has_subordinate(pci_dev) || pci_dev->bridge_d3;
115 }
116
117 int pci_vpd_init(struct pci_dev *dev);
118 void pci_vpd_release(struct pci_dev *dev);
119 void pcie_vpd_create_sysfs_dev_files(struct pci_dev *dev);
120 void pcie_vpd_remove_sysfs_dev_files(struct pci_dev *dev);
121
122 /* PCI /proc functions */
123 #ifdef CONFIG_PROC_FS
124 int pci_proc_attach_device(struct pci_dev *dev);
125 int pci_proc_detach_device(struct pci_dev *dev);
126 int pci_proc_detach_bus(struct pci_bus *bus);
127 #else
128 static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; }
129 static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; }
130 static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
131 #endif
132
133 /* Functions for PCI Hotplug drivers to use */
134 int pci_hp_add_bridge(struct pci_dev *dev);
135
136 #ifdef HAVE_PCI_LEGACY
137 void pci_create_legacy_files(struct pci_bus *bus);
138 void pci_remove_legacy_files(struct pci_bus *bus);
139 #else
140 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }
141 static inline void pci_remove_legacy_files(struct pci_bus *bus) { return; }
142 #endif
143
144 /* Lock for read/write access to pci device and bus lists */
145 extern struct rw_semaphore pci_bus_sem;
146 extern struct mutex pci_slot_mutex;
147
148 extern raw_spinlock_t pci_lock;
149
150 extern unsigned int pci_pm_d3_delay;
151
152 #ifdef CONFIG_PCI_MSI
153 void pci_no_msi(void);
154 #else
155 static inline void pci_no_msi(void) { }
156 #endif
157
158 static inline void pci_msi_set_enable(struct pci_dev *dev, int enable)
159 {
160         u16 control;
161
162         pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
163         control &= ~PCI_MSI_FLAGS_ENABLE;
164         if (enable)
165                 control |= PCI_MSI_FLAGS_ENABLE;
166         pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
167 }
168
169 static inline void pci_msix_clear_and_set_ctrl(struct pci_dev *dev, u16 clear, u16 set)
170 {
171         u16 ctrl;
172
173         pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &ctrl);
174         ctrl &= ~clear;
175         ctrl |= set;
176         pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, ctrl);
177 }
178
179 void pci_realloc_get_opt(char *);
180
181 static inline int pci_no_d1d2(struct pci_dev *dev)
182 {
183         unsigned int parent_dstates = 0;
184
185         if (dev->bus->self)
186                 parent_dstates = dev->bus->self->no_d1d2;
187         return (dev->no_d1d2 || parent_dstates);
188
189 }
190 extern const struct attribute_group *pci_dev_groups[];
191 extern const struct attribute_group *pcibus_groups[];
192 extern const struct device_type pci_dev_type;
193 extern const struct attribute_group *pci_bus_groups[];
194
195
196 /**
197  * pci_match_one_device - Tell if a PCI device structure has a matching
198  *                        PCI device id structure
199  * @id: single PCI device id structure to match
200  * @dev: the PCI device structure to match against
201  *
202  * Returns the matching pci_device_id structure or %NULL if there is no match.
203  */
204 static inline const struct pci_device_id *
205 pci_match_one_device(const struct pci_device_id *id, const struct pci_dev *dev)
206 {
207         if ((id->vendor == PCI_ANY_ID || id->vendor == dev->vendor) &&
208             (id->device == PCI_ANY_ID || id->device == dev->device) &&
209             (id->subvendor == PCI_ANY_ID || id->subvendor == dev->subsystem_vendor) &&
210             (id->subdevice == PCI_ANY_ID || id->subdevice == dev->subsystem_device) &&
211             !((id->class ^ dev->class) & id->class_mask))
212                 return id;
213         return NULL;
214 }
215
216 /* PCI slot sysfs helper code */
217 #define to_pci_slot(s) container_of(s, struct pci_slot, kobj)
218
219 extern struct kset *pci_slots_kset;
220
221 struct pci_slot_attribute {
222         struct attribute attr;
223         ssize_t (*show)(struct pci_slot *, char *);
224         ssize_t (*store)(struct pci_slot *, const char *, size_t);
225 };
226 #define to_pci_slot_attr(s) container_of(s, struct pci_slot_attribute, attr)
227
228 enum pci_bar_type {
229         pci_bar_unknown,        /* Standard PCI BAR probe */
230         pci_bar_io,             /* An I/O port BAR */
231         pci_bar_mem32,          /* A 32-bit memory BAR */
232         pci_bar_mem64,          /* A 64-bit memory BAR */
233 };
234
235 int pci_configure_extended_tags(struct pci_dev *dev, void *ign);
236 bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
237                                 int crs_timeout);
238 bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
239                                         int crs_timeout);
240 int pci_idt_bus_quirk(struct pci_bus *bus, int devfn, u32 *pl, int crs_timeout);
241
242 int pci_setup_device(struct pci_dev *dev);
243 int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
244                     struct resource *res, unsigned int reg);
245 void pci_configure_ari(struct pci_dev *dev);
246 void __pci_bus_size_bridges(struct pci_bus *bus,
247                         struct list_head *realloc_head);
248 void __pci_bus_assign_resources(const struct pci_bus *bus,
249                                 struct list_head *realloc_head,
250                                 struct list_head *fail_head);
251 bool pci_bus_clip_resource(struct pci_dev *dev, int idx);
252
253 void pci_reassigndev_resource_alignment(struct pci_dev *dev);
254 void pci_disable_bridge_window(struct pci_dev *dev);
255
256 /* PCIe link information */
257 #define PCIE_SPEED2STR(speed) \
258         ((speed) == PCIE_SPEED_16_0GT ? "16 GT/s" : \
259          (speed) == PCIE_SPEED_8_0GT ? "8 GT/s" : \
260          (speed) == PCIE_SPEED_5_0GT ? "5 GT/s" : \
261          (speed) == PCIE_SPEED_2_5GT ? "2.5 GT/s" : \
262          "Unknown speed")
263
264 /* PCIe speed to Mb/s reduced by encoding overhead */
265 #define PCIE_SPEED2MBS_ENC(speed) \
266         ((speed) == PCIE_SPEED_16_0GT ? 16000*128/130 : \
267          (speed) == PCIE_SPEED_8_0GT  ?  8000*128/130 : \
268          (speed) == PCIE_SPEED_5_0GT  ?  5000*8/10 : \
269          (speed) == PCIE_SPEED_2_5GT  ?  2500*8/10 : \
270          0)
271
272 enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev);
273 enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev);
274 u32 pcie_bandwidth_capable(struct pci_dev *dev, enum pci_bus_speed *speed,
275                            enum pcie_link_width *width);
276 void __pcie_print_link_status(struct pci_dev *dev, bool verbose);
277 void pcie_report_downtraining(struct pci_dev *dev);
278
279 /* Single Root I/O Virtualization */
280 struct pci_sriov {
281         int             pos;            /* Capability position */
282         int             nres;           /* Number of resources */
283         u32             cap;            /* SR-IOV Capabilities */
284         u16             ctrl;           /* SR-IOV Control */
285         u16             total_VFs;      /* Total VFs associated with the PF */
286         u16             initial_VFs;    /* Initial VFs associated with the PF */
287         u16             num_VFs;        /* Number of VFs available */
288         u16             offset;         /* First VF Routing ID offset */
289         u16             stride;         /* Following VF stride */
290         u16             vf_device;      /* VF device ID */
291         u32             pgsz;           /* Page size for BAR alignment */
292         u8              link;           /* Function Dependency Link */
293         u8              max_VF_buses;   /* Max buses consumed by VFs */
294         u16             driver_max_VFs; /* Max num VFs driver supports */
295         struct pci_dev  *dev;           /* Lowest numbered PF */
296         struct pci_dev  *self;          /* This PF */
297         u32             cfg_size;       /* VF config space size */
298         u32             class;          /* VF device */
299         u8              hdr_type;       /* VF header type */
300         u16             subsystem_vendor; /* VF subsystem vendor */
301         u16             subsystem_device; /* VF subsystem device */
302         resource_size_t barsz[PCI_SRIOV_NUM_BARS];      /* VF BAR size */
303         bool            drivers_autoprobe; /* Auto probing of VFs by driver */
304 };
305
306 /**
307  * pci_dev_set_io_state - Set the new error state if possible.
308  *
309  * @dev - pci device to set new error_state
310  * @new - the state we want dev to be in
311  *
312  * Must be called with device_lock held.
313  *
314  * Returns true if state has been changed to the requested state.
315  */
316 static inline bool pci_dev_set_io_state(struct pci_dev *dev,
317                                         pci_channel_state_t new)
318 {
319         bool changed = false;
320
321         device_lock_assert(&dev->dev);
322         switch (new) {
323         case pci_channel_io_perm_failure:
324                 switch (dev->error_state) {
325                 case pci_channel_io_frozen:
326                 case pci_channel_io_normal:
327                 case pci_channel_io_perm_failure:
328                         changed = true;
329                         break;
330                 }
331                 break;
332         case pci_channel_io_frozen:
333                 switch (dev->error_state) {
334                 case pci_channel_io_frozen:
335                 case pci_channel_io_normal:
336                         changed = true;
337                         break;
338                 }
339                 break;
340         case pci_channel_io_normal:
341                 switch (dev->error_state) {
342                 case pci_channel_io_frozen:
343                 case pci_channel_io_normal:
344                         changed = true;
345                         break;
346                 }
347                 break;
348         }
349         if (changed)
350                 dev->error_state = new;
351         return changed;
352 }
353
354 static inline int pci_dev_set_disconnected(struct pci_dev *dev, void *unused)
355 {
356         device_lock(&dev->dev);
357         pci_dev_set_io_state(dev, pci_channel_io_perm_failure);
358         device_unlock(&dev->dev);
359
360         return 0;
361 }
362
363 static inline bool pci_dev_is_disconnected(const struct pci_dev *dev)
364 {
365         return dev->error_state == pci_channel_io_perm_failure;
366 }
367
368 /* pci_dev priv_flags */
369 #define PCI_DEV_ADDED 0
370
371 static inline void pci_dev_assign_added(struct pci_dev *dev, bool added)
372 {
373         assign_bit(PCI_DEV_ADDED, &dev->priv_flags, added);
374 }
375
376 static inline bool pci_dev_is_added(const struct pci_dev *dev)
377 {
378         return test_bit(PCI_DEV_ADDED, &dev->priv_flags);
379 }
380
381 #ifdef CONFIG_PCIEAER
382 #include <linux/aer.h>
383
384 #define AER_MAX_MULTI_ERR_DEVICES       5       /* Not likely to have more */
385
386 struct aer_err_info {
387         struct pci_dev *dev[AER_MAX_MULTI_ERR_DEVICES];
388         int error_dev_num;
389
390         unsigned int id:16;
391
392         unsigned int severity:2;        /* 0:NONFATAL | 1:FATAL | 2:COR */
393         unsigned int __pad1:5;
394         unsigned int multi_error_valid:1;
395
396         unsigned int first_error:5;
397         unsigned int __pad2:2;
398         unsigned int tlp_header_valid:1;
399
400         unsigned int status;            /* COR/UNCOR Error Status */
401         unsigned int mask;              /* COR/UNCOR Error Mask */
402         struct aer_header_log_regs tlp; /* TLP Header */
403 };
404
405 int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info);
406 void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
407 #endif  /* CONFIG_PCIEAER */
408
409 #ifdef CONFIG_PCIE_DPC
410 void pci_save_dpc_state(struct pci_dev *dev);
411 void pci_restore_dpc_state(struct pci_dev *dev);
412 #else
413 static inline void pci_save_dpc_state(struct pci_dev *dev) {}
414 static inline void pci_restore_dpc_state(struct pci_dev *dev) {}
415 #endif
416
417 #ifdef CONFIG_PCI_ATS
418 void pci_restore_ats_state(struct pci_dev *dev);
419 #else
420 static inline void pci_restore_ats_state(struct pci_dev *dev)
421 {
422 }
423 #endif /* CONFIG_PCI_ATS */
424
425 #ifdef CONFIG_PCI_IOV
426 int pci_iov_init(struct pci_dev *dev);
427 void pci_iov_release(struct pci_dev *dev);
428 void pci_iov_remove(struct pci_dev *dev);
429 void pci_iov_update_resource(struct pci_dev *dev, int resno);
430 resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
431 void pci_restore_iov_state(struct pci_dev *dev);
432 int pci_iov_bus_range(struct pci_bus *bus);
433
434 #else
435 static inline int pci_iov_init(struct pci_dev *dev)
436 {
437         return -ENODEV;
438 }
439 static inline void pci_iov_release(struct pci_dev *dev)
440
441 {
442 }
443 static inline void pci_iov_remove(struct pci_dev *dev)
444 {
445 }
446 static inline void pci_restore_iov_state(struct pci_dev *dev)
447 {
448 }
449 static inline int pci_iov_bus_range(struct pci_bus *bus)
450 {
451         return 0;
452 }
453
454 #endif /* CONFIG_PCI_IOV */
455
456 unsigned long pci_cardbus_resource_alignment(struct resource *);
457
458 static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
459                                                      struct resource *res)
460 {
461 #ifdef CONFIG_PCI_IOV
462         int resno = res - dev->resource;
463
464         if (resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END)
465                 return pci_sriov_resource_alignment(dev, resno);
466 #endif
467         if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS)
468                 return pci_cardbus_resource_alignment(res);
469         return resource_alignment(res);
470 }
471
472 void pci_enable_acs(struct pci_dev *dev);
473 #ifdef CONFIG_PCI_QUIRKS
474 int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
475 int pci_dev_specific_enable_acs(struct pci_dev *dev);
476 int pci_dev_specific_disable_acs_redir(struct pci_dev *dev);
477 #else
478 static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev,
479                                                u16 acs_flags)
480 {
481         return -ENOTTY;
482 }
483 static inline int pci_dev_specific_enable_acs(struct pci_dev *dev)
484 {
485         return -ENOTTY;
486 }
487 static inline int pci_dev_specific_disable_acs_redir(struct pci_dev *dev)
488 {
489         return -ENOTTY;
490 }
491 #endif
492
493 /* PCI error reporting and recovery */
494 void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,
495                       u32 service);
496
497 bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay);
498 bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
499 #ifdef CONFIG_PCIEASPM
500 void pcie_aspm_init_link_state(struct pci_dev *pdev);
501 void pcie_aspm_exit_link_state(struct pci_dev *pdev);
502 void pcie_aspm_pm_state_change(struct pci_dev *pdev);
503 void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
504 #else
505 static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }
506 static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { }
507 static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
508 static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
509 #endif
510
511 #ifdef CONFIG_PCIEASPM_DEBUG
512 void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
513 void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
514 #else
515 static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) { }
516 static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) { }
517 #endif
518
519 #ifdef CONFIG_PCIE_PTM
520 void pci_ptm_init(struct pci_dev *dev);
521 #else
522 static inline void pci_ptm_init(struct pci_dev *dev) { }
523 #endif
524
525 struct pci_dev_reset_methods {
526         u16 vendor;
527         u16 device;
528         int (*reset)(struct pci_dev *dev, int probe);
529 };
530
531 #ifdef CONFIG_PCI_QUIRKS
532 int pci_dev_specific_reset(struct pci_dev *dev, int probe);
533 #else
534 static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe)
535 {
536         return -ENOTTY;
537 }
538 #endif
539
540 #if defined(CONFIG_PCI_QUIRKS) && defined(CONFIG_ARM64)
541 int acpi_get_rc_resources(struct device *dev, const char *hid, u16 segment,
542                           struct resource *res);
543 #endif
544
545 u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar);
546 int pci_rebar_get_current_size(struct pci_dev *pdev, int bar);
547 int pci_rebar_set_size(struct pci_dev *pdev, int bar, int size);
548 static inline u64 pci_rebar_size_to_bytes(int size)
549 {
550         return 1ULL << (size + 20);
551 }
552
553 struct device_node;
554
555 #ifdef CONFIG_OF
556 int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
557 int of_get_pci_domain_nr(struct device_node *node);
558 int of_pci_get_max_link_speed(struct device_node *node);
559
560 #else
561 static inline int
562 of_pci_parse_bus_range(struct device_node *node, struct resource *res)
563 {
564         return -EINVAL;
565 }
566
567 static inline int
568 of_get_pci_domain_nr(struct device_node *node)
569 {
570         return -1;
571 }
572
573 static inline int
574 of_pci_get_max_link_speed(struct device_node *node)
575 {
576         return -EINVAL;
577 }
578 #endif /* CONFIG_OF */
579
580 #if defined(CONFIG_OF_ADDRESS)
581 int devm_of_pci_get_host_bridge_resources(struct device *dev,
582                         unsigned char busno, unsigned char bus_max,
583                         struct list_head *resources, resource_size_t *io_base);
584 #else
585 static inline int devm_of_pci_get_host_bridge_resources(struct device *dev,
586                         unsigned char busno, unsigned char bus_max,
587                         struct list_head *resources, resource_size_t *io_base)
588 {
589         return -EINVAL;
590 }
591 #endif
592
593 #ifdef CONFIG_PCIEAER
594 void pci_no_aer(void);
595 void pci_aer_init(struct pci_dev *dev);
596 void pci_aer_exit(struct pci_dev *dev);
597 extern const struct attribute_group aer_stats_attr_group;
598 void pci_aer_clear_fatal_status(struct pci_dev *dev);
599 void pci_aer_clear_device_status(struct pci_dev *dev);
600 #else
601 static inline void pci_no_aer(void) { }
602 static inline void pci_aer_init(struct pci_dev *d) { }
603 static inline void pci_aer_exit(struct pci_dev *d) { }
604 static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
605 static inline void pci_aer_clear_device_status(struct pci_dev *dev) { }
606 #endif
607
608 #endif /* DRIVERS_PCI_H */