diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 19:39:28 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-22 19:39:28 -0500 |
| commit | e1ba84597c9012b9f9075aac283ac7537d7561ba (patch) | |
| tree | 41ab1a74c71ce55e72ef73424346e8e0a7f4616e /include | |
| parent | 60eaa0190f6b39dce18eb1975d9773ed8bc9a534 (diff) | |
| parent | cef09b808e584c13b7126b83dc37c80b00234137 (diff) | |
Merge tag 'pci-v3.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"PCI changes for the v3.14 merge window:
Resource management
- Change pci_bus_region addresses to dma_addr_t (Bjorn Helgaas)
- Support 64-bit AGP BARs (Bjorn Helgaas, Yinghai Lu)
- Add pci_bus_address() to get bus address of a BAR (Bjorn Helgaas)
- Use pci_resource_start() for CPU address of AGP BARs (Bjorn Helgaas)
- Enforce bus address limits in resource allocation (Yinghai Lu)
- Allocate 64-bit BARs above 4G when possible (Yinghai Lu)
- Convert pcibios_resource_to_bus() to take pci_bus, not pci_dev (Yinghai Lu)
PCI device hotplug
- Major rescan/remove locking update (Rafael J. Wysocki)
- Make ioapic builtin only (not modular) (Yinghai Lu)
- Fix release/free issues (Yinghai Lu)
- Clean up pciehp (Bjorn Helgaas)
- Announce pciehp slot info during enumeration (Bjorn Helgaas)
MSI
- Add pci_msi_vec_count(), pci_msix_vec_count() (Alexander Gordeev)
- Add pci_enable_msi_range(), pci_enable_msix_range() (Alexander Gordeev)
- Deprecate "tri-state" interfaces: fail/success/fail+info (Alexander Gordeev)
- Export MSI mode using attributes, not kobjects (Greg Kroah-Hartman)
- Drop "irq" param from *_restore_msi_irqs() (DuanZhenzhong)
SR-IOV
- Clear NumVFs when disabling SR-IOV in sriov_init() (ethan.zhao)
Virtualization
- Add support for save/restore of extended capabilities (Alex Williamson)
- Add Virtual Channel to save/restore support (Alex Williamson)
- Never treat a VF as a multifunction device (Alex Williamson)
- Add pci_try_reset_function(), et al (Alex Williamson)
AER
- Ignore non-PCIe error sources (Betty Dall)
- Support ACPI HEST error sources for domains other than 0 (Betty Dall)
- Consolidate HEST error source parsers (Bjorn Helgaas)
- Add a TLP header print helper (Borislav Petkov)
Freescale i.MX6
- Remove unnecessary code (Fabio Estevam)
- Make reset-gpio optional (Marek Vasut)
- Report "link up" only after link training completes (Marek Vasut)
- Start link in Gen1 before negotiating for Gen2 mode (Marek Vasut)
- Fix PCIe startup code (Richard Zhu)
Marvell MVEBU
- Remove duplicate of_clk_get_by_name() call (Andrew Lunn)
- Drop writes to bridge Secondary Status register (Jason Gunthorpe)
- Obey bridge PCI_COMMAND_MEM and PCI_COMMAND_IO bits (Jason Gunthorpe)
- Support a bridge with no IO port window (Jason Gunthorpe)
- Use max_t() instead of max(resource_size_t,) (Jingoo Han)
- Remove redundant of_match_ptr (Sachin Kamat)
- Call pci_ioremap_io() at startup instead of dynamically (Thomas Petazzoni)
NVIDIA Tegra
- Disable Gen2 for Tegra20 and Tegra30 (Eric Brower)
Renesas R-Car
- Add runtime PM support (Valentine Barshak)
- Fix rcar_pci_probe() return value check (Wei Yongjun)
Synopsys DesignWare
- Fix crash in dw_msi_teardown_irq() (Bjørn Erik Nilsen)
- Remove redundant call to pci_write_config_word() (Bjørn Erik Nilsen)
- Fix missing MSI IRQs (Harro Haan)
- Add dw_pcie prefix before cfg_read/write (Pratyush Anand)
- Fix I/O transfers by using CPU (not realio) address (Pratyush Anand)
- Whitespace cleanup (Jingoo Han)
EISA
- Call put_device() if device_register() fails (Levente Kurusa)
- Revert EISA initialization breakage ((Bjorn Helgaas)
Miscellaneous
- Remove unused code, including PCIe 3.0 interfaces (Stephen Hemminger)
- Prevent bus conflicts while checking for bridge apertures (Bjorn Helgaas)
- Stop clearing bridge Secondary Status when setting up I/O aperture (Bjorn Helgaas)
- Use dev_is_pci() to identify PCI devices (Yijing Wang)
- Deprecate DEFINE_PCI_DEVICE_TABLE (Joe Perches)
- Update documentation 00-INDEX (Erik Ekman)"
* tag 'pci-v3.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (119 commits)
Revert "EISA: Initialize device before its resources"
Revert "EISA: Log device resources in dmesg"
vfio-pci: Use pci "try" reset interface
PCI: Check parent kobject in pci_destroy_dev()
xen/pcifront: Use global PCI rescan-remove locking
powerpc/eeh: Use global PCI rescan-remove locking
PCI: Fix pci_check_and_unmask_intx() comment typos
PCI: Add pci_try_reset_function(), pci_try_reset_slot(), pci_try_reset_bus()
MPT / PCI: Use pci_stop_and_remove_bus_device_locked()
platform / x86: Use global PCI rescan-remove locking
PCI: hotplug: Use global PCI rescan-remove locking
pcmcia: Use global PCI rescan-remove locking
ACPI / hotplug / PCI: Use global PCI rescan-remove locking
ACPI / PCI: Use global PCI rescan-remove locking in PCI root hotplug
PCI: Add global pci_lock_rescan_remove()
PCI: Cleanup pci.h whitespace
PCI: Reorder so actual code comes before stubs
PCI/AER: Support ACPI HEST AER error sources for PCI domains other than 0
ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
PCI: Make local functions static
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/acpi/actbl1.h | 10 | ||||
| -rw-r--r-- | include/linux/msi.h | 4 | ||||
| -rw-r--r-- | include/linux/pci-ats.h | 17 | ||||
| -rw-r--r-- | include/linux/pci.h | 352 | ||||
| -rw-r--r-- | include/uapi/linux/pci_regs.h | 37 |
5 files changed, 149 insertions, 271 deletions
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 556c83ee6b42..4ec8c194bfe5 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
| @@ -457,7 +457,7 @@ struct acpi_hest_aer_common { | |||
| 457 | u8 enabled; | 457 | u8 enabled; |
| 458 | u32 records_to_preallocate; | 458 | u32 records_to_preallocate; |
| 459 | u32 max_sections_per_record; | 459 | u32 max_sections_per_record; |
| 460 | u32 bus; | 460 | u32 bus; /* Bus and Segment numbers */ |
| 461 | u16 device; | 461 | u16 device; |
| 462 | u16 function; | 462 | u16 function; |
| 463 | u16 device_control; | 463 | u16 device_control; |
| @@ -473,6 +473,14 @@ struct acpi_hest_aer_common { | |||
| 473 | #define ACPI_HEST_FIRMWARE_FIRST (1) | 473 | #define ACPI_HEST_FIRMWARE_FIRST (1) |
| 474 | #define ACPI_HEST_GLOBAL (1<<1) | 474 | #define ACPI_HEST_GLOBAL (1<<1) |
| 475 | 475 | ||
| 476 | /* | ||
| 477 | * Macros to access the bus/segment numbers in Bus field above: | ||
| 478 | * Bus number is encoded in bits 7:0 | ||
| 479 | * Segment number is encoded in bits 23:8 | ||
| 480 | */ | ||
| 481 | #define ACPI_HEST_BUS(bus) ((bus) & 0xFF) | ||
| 482 | #define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF) | ||
| 483 | |||
| 476 | /* Hardware Error Notification */ | 484 | /* Hardware Error Notification */ |
| 477 | 485 | ||
| 478 | struct acpi_hest_notify { | 486 | struct acpi_hest_notify { |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 009b02481436..92a2f991262a 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq); | |||
| 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
| 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); | 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); |
| 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); |
| 63 | void arch_restore_msi_irqs(struct pci_dev *dev, int irq); | 63 | void arch_restore_msi_irqs(struct pci_dev *dev); |
| 64 | 64 | ||
| 65 | void default_teardown_msi_irqs(struct pci_dev *dev); | 65 | void default_teardown_msi_irqs(struct pci_dev *dev); |
| 66 | void default_restore_msi_irqs(struct pci_dev *dev, int irq); | 66 | void default_restore_msi_irqs(struct pci_dev *dev); |
| 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); |
| 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); | 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); |
| 69 | 69 | ||
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 68bcefd7fca0..72031785fe1d 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -56,10 +56,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 56 | 56 | ||
| 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 58 | void pci_disable_pri(struct pci_dev *pdev); | 58 | void pci_disable_pri(struct pci_dev *pdev); |
| 59 | bool pci_pri_enabled(struct pci_dev *pdev); | ||
| 60 | int pci_reset_pri(struct pci_dev *pdev); | 59 | int pci_reset_pri(struct pci_dev *pdev); |
| 61 | bool pci_pri_stopped(struct pci_dev *pdev); | ||
| 62 | int pci_pri_status(struct pci_dev *pdev); | ||
| 63 | 60 | ||
| 64 | #else /* CONFIG_PCI_PRI */ | 61 | #else /* CONFIG_PCI_PRI */ |
| 65 | 62 | ||
| @@ -72,25 +69,11 @@ static inline void pci_disable_pri(struct pci_dev *pdev) | |||
| 72 | { | 69 | { |
| 73 | } | 70 | } |
| 74 | 71 | ||
| 75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
| 76 | { | ||
| 77 | return false; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int pci_reset_pri(struct pci_dev *pdev) | 72 | static inline int pci_reset_pri(struct pci_dev *pdev) |
| 81 | { | 73 | { |
| 82 | return -ENODEV; | 74 | return -ENODEV; |
| 83 | } | 75 | } |
| 84 | 76 | ||
| 85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
| 86 | { | ||
| 87 | return true; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
| 91 | { | ||
| 92 | return -ENODEV; | ||
| 93 | } | ||
| 94 | #endif /* CONFIG_PCI_PRI */ | 77 | #endif /* CONFIG_PCI_PRI */ |
| 95 | 78 | ||
| 96 | #ifdef CONFIG_PCI_PASID | 79 | #ifdef CONFIG_PCI_PASID |
diff --git a/include/linux/pci.h b/include/linux/pci.h index a13d6825e586..fb57c892b214 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -224,7 +224,8 @@ enum pci_bus_speed { | |||
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | struct pci_cap_saved_data { | 226 | struct pci_cap_saved_data { |
| 227 | char cap_nr; | 227 | u16 cap_nr; |
| 228 | bool cap_extended; | ||
| 228 | unsigned int size; | 229 | unsigned int size; |
| 229 | u32 data[0]; | 230 | u32 data[0]; |
| 230 | }; | 231 | }; |
| @@ -351,7 +352,7 @@ struct pci_dev { | |||
| 351 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ | 352 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ |
| 352 | #ifdef CONFIG_PCI_MSI | 353 | #ifdef CONFIG_PCI_MSI |
| 353 | struct list_head msi_list; | 354 | struct list_head msi_list; |
| 354 | struct kset *msi_kset; | 355 | const struct attribute_group **msi_irq_groups; |
| 355 | #endif | 356 | #endif |
| 356 | struct pci_vpd *vpd; | 357 | struct pci_vpd *vpd; |
| 357 | #ifdef CONFIG_PCI_ATS | 358 | #ifdef CONFIG_PCI_ATS |
| @@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); | 378 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); |
| 378 | struct pci_dev * __deprecated alloc_pci_dev(void); | ||
| 379 | 379 | ||
| 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
| 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
| @@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
| 385 | return (pdev->error_state != pci_channel_io_normal); | 385 | return (pdev->error_state != pci_channel_io_normal); |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | extern struct resource busn_resource; | ||
| 389 | |||
| 390 | struct pci_host_bridge_window { | 388 | struct pci_host_bridge_window { |
| 391 | struct list_head list; | 389 | struct list_head list; |
| 392 | struct resource *res; /* host bridge aperture (CPU address) */ | 390 | struct resource *res; /* host bridge aperture (CPU address) */ |
| @@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, | |||
| 551 | int reg, int len, u32 val); | 549 | int reg, int len, u32 val); |
| 552 | 550 | ||
| 553 | struct pci_bus_region { | 551 | struct pci_bus_region { |
| 554 | resource_size_t start; | 552 | dma_addr_t start; |
| 555 | resource_size_t end; | 553 | dma_addr_t end; |
| 556 | }; | 554 | }; |
| 557 | 555 | ||
| 558 | struct pci_dynids { | 556 | struct pci_dynids { |
| @@ -634,8 +632,7 @@ struct pci_driver { | |||
| 634 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table | 632 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table |
| 635 | * @_table: device table name | 633 | * @_table: device table name |
| 636 | * | 634 | * |
| 637 | * This macro is used to create a struct pci_device_id array (a device table) | 635 | * This macro is deprecated and should not be used in new code. |
| 638 | * in a generic manner. | ||
| 639 | */ | 636 | */ |
| 640 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ | 637 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ |
| 641 | const struct pci_device_id _table[] | 638 | const struct pci_device_id _table[] |
| @@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *); | |||
| 737 | 734 | ||
| 738 | /* Generic PCI functions used internally */ | 735 | /* Generic PCI functions used internally */ |
| 739 | 736 | ||
| 740 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 737 | void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, |
| 741 | struct resource *res); | 738 | struct resource *res); |
| 742 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 739 | void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, |
| 743 | struct pci_bus_region *region); | 740 | struct pci_bus_region *region); |
| 744 | void pcibios_scan_specific_bus(int busn); | 741 | void pcibios_scan_specific_bus(int busn); |
| 745 | struct pci_bus *pci_find_bus(int domain, int busnr); | 742 | struct pci_bus *pci_find_bus(int domain, int busnr); |
| @@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | |||
| 763 | const char *name, | 760 | const char *name, |
| 764 | struct hotplug_slot *hotplug); | 761 | struct hotplug_slot *hotplug); |
| 765 | void pci_destroy_slot(struct pci_slot *slot); | 762 | void pci_destroy_slot(struct pci_slot *slot); |
| 766 | void pci_renumber_slot(struct pci_slot *slot, int slot_nr); | ||
| 767 | int pci_scan_slot(struct pci_bus *bus, int devfn); | 763 | int pci_scan_slot(struct pci_bus *bus, int devfn); |
| 768 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); | 764 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); |
| 769 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 765 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
| @@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
| 779 | void pci_dev_put(struct pci_dev *dev); | 775 | void pci_dev_put(struct pci_dev *dev); |
| 780 | void pci_remove_bus(struct pci_bus *b); | 776 | void pci_remove_bus(struct pci_bus *b); |
| 781 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 777 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
| 778 | void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev); | ||
| 782 | void pci_stop_root_bus(struct pci_bus *bus); | 779 | void pci_stop_root_bus(struct pci_bus *bus); |
| 783 | void pci_remove_root_bus(struct pci_bus *bus); | 780 | void pci_remove_root_bus(struct pci_bus *bus); |
| 784 | void pci_setup_cardbus(struct pci_bus *bus); | 781 | void pci_setup_cardbus(struct pci_bus *bus); |
| @@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev); | |||
| 938 | void pci_msi_off(struct pci_dev *dev); | 935 | void pci_msi_off(struct pci_dev *dev); |
| 939 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 936 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 940 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 937 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| 938 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); | ||
| 941 | int pci_wait_for_pending_transaction(struct pci_dev *dev); | 939 | int pci_wait_for_pending_transaction(struct pci_dev *dev); |
| 942 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 940 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
| 943 | int pcix_get_mmrbc(struct pci_dev *dev); | 941 | int pcix_get_mmrbc(struct pci_dev *dev); |
| @@ -951,10 +949,13 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed, | |||
| 951 | int __pci_reset_function(struct pci_dev *dev); | 949 | int __pci_reset_function(struct pci_dev *dev); |
| 952 | int __pci_reset_function_locked(struct pci_dev *dev); | 950 | int __pci_reset_function_locked(struct pci_dev *dev); |
| 953 | int pci_reset_function(struct pci_dev *dev); | 951 | int pci_reset_function(struct pci_dev *dev); |
| 952 | int pci_try_reset_function(struct pci_dev *dev); | ||
| 954 | int pci_probe_reset_slot(struct pci_slot *slot); | 953 | int pci_probe_reset_slot(struct pci_slot *slot); |
| 955 | int pci_reset_slot(struct pci_slot *slot); | 954 | int pci_reset_slot(struct pci_slot *slot); |
| 955 | int pci_try_reset_slot(struct pci_slot *slot); | ||
| 956 | int pci_probe_reset_bus(struct pci_bus *bus); | 956 | int pci_probe_reset_bus(struct pci_bus *bus); |
| 957 | int pci_reset_bus(struct pci_bus *bus); | 957 | int pci_reset_bus(struct pci_bus *bus); |
| 958 | int pci_try_reset_bus(struct pci_bus *bus); | ||
| 958 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); | 959 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); |
| 959 | void pci_update_resource(struct pci_dev *dev, int resno); | 960 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 961 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| @@ -974,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); | |||
| 974 | int pci_save_state(struct pci_dev *dev); | 975 | int pci_save_state(struct pci_dev *dev); |
| 975 | void pci_restore_state(struct pci_dev *dev); | 976 | void pci_restore_state(struct pci_dev *dev); |
| 976 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); | 977 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); |
| 977 | int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); | ||
| 978 | int pci_load_and_free_saved_state(struct pci_dev *dev, | 978 | int pci_load_and_free_saved_state(struct pci_dev *dev, |
| 979 | struct pci_saved_state **state); | 979 | struct pci_saved_state **state); |
| 980 | struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); | ||
| 981 | struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, | ||
| 982 | u16 cap); | ||
| 983 | int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); | ||
| 984 | int pci_add_ext_cap_save_buffer(struct pci_dev *dev, | ||
| 985 | u16 cap, unsigned int size); | ||
| 980 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 986 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
| 981 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 987 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 982 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 988 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| @@ -985,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable); | |||
| 985 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 991 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 986 | bool runtime, bool enable); | 992 | bool runtime, bool enable); |
| 987 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 993 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
| 988 | pci_power_t pci_target_state(struct pci_dev *dev); | ||
| 989 | int pci_prepare_to_sleep(struct pci_dev *dev); | 994 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 990 | int pci_back_from_sleep(struct pci_dev *dev); | 995 | int pci_back_from_sleep(struct pci_dev *dev); |
| 991 | bool pci_dev_run_wake(struct pci_dev *dev); | 996 | bool pci_dev_run_wake(struct pci_dev *dev); |
| @@ -998,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
| 998 | return __pci_enable_wake(dev, state, false, enable); | 1003 | return __pci_enable_wake(dev, state, false, enable); |
| 999 | } | 1004 | } |
| 1000 | 1005 | ||
| 1001 | #define PCI_EXP_IDO_REQUEST (1<<0) | 1006 | /* PCI Virtual Channel */ |
| 1002 | #define PCI_EXP_IDO_COMPLETION (1<<1) | 1007 | int pci_save_vc_state(struct pci_dev *dev); |
| 1003 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | 1008 | void pci_restore_vc_state(struct pci_dev *dev); |
| 1004 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | 1009 | void pci_allocate_vc_save_buffers(struct pci_dev *dev); |
| 1005 | |||
| 1006 | enum pci_obff_signal_type { | ||
| 1007 | PCI_EXP_OBFF_SIGNAL_L0 = 0, | ||
| 1008 | PCI_EXP_OBFF_SIGNAL_ALWAYS = 1, | ||
| 1009 | }; | ||
| 1010 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
| 1011 | void pci_disable_obff(struct pci_dev *dev); | ||
| 1012 | |||
| 1013 | int pci_enable_ltr(struct pci_dev *dev); | ||
| 1014 | void pci_disable_ltr(struct pci_dev *dev); | ||
| 1015 | int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); | ||
| 1016 | 1010 | ||
| 1017 | /* For use by arch with custom probe code */ | 1011 | /* For use by arch with custom probe code */ |
| 1018 | void set_pcie_port_type(struct pci_dev *pdev); | 1012 | void set_pcie_port_type(struct pci_dev *pdev); |
| @@ -1022,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev); | |||
| 1022 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 1016 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 1023 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); | 1017 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); |
| 1024 | unsigned int pci_rescan_bus(struct pci_bus *bus); | 1018 | unsigned int pci_rescan_bus(struct pci_bus *bus); |
| 1019 | void pci_lock_rescan_remove(void); | ||
| 1020 | void pci_unlock_rescan_remove(void); | ||
| 1025 | 1021 | ||
| 1026 | /* Vital product data routines */ | 1022 | /* Vital product data routines */ |
| 1027 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | 1023 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); |
| 1028 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); | 1024 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); |
| 1029 | int pci_vpd_truncate(struct pci_dev *dev, size_t size); | ||
| 1030 | 1025 | ||
| 1031 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ | 1026 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ |
| 1032 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); | 1027 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); |
| @@ -1078,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | |||
| 1078 | resource_size_t), | 1073 | resource_size_t), |
| 1079 | void *alignf_data); | 1074 | void *alignf_data); |
| 1080 | 1075 | ||
| 1076 | static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) | ||
| 1077 | { | ||
| 1078 | struct pci_bus_region region; | ||
| 1079 | |||
| 1080 | pcibios_resource_to_bus(pdev->bus, ®ion, &pdev->resource[bar]); | ||
| 1081 | return region.start; | ||
| 1082 | } | ||
| 1083 | |||
| 1081 | /* Proper probing supporting hot-pluggable devices */ | 1084 | /* Proper probing supporting hot-pluggable devices */ |
| 1082 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, | 1085 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
| 1083 | const char *mod_name); | 1086 | const char *mod_name); |
| @@ -1115,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 1115 | 1118 | ||
| 1116 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | 1119 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
| 1117 | void *userdata); | 1120 | void *userdata); |
| 1118 | int pci_cfg_space_size_ext(struct pci_dev *dev); | ||
| 1119 | int pci_cfg_space_size(struct pci_dev *dev); | 1121 | int pci_cfg_space_size(struct pci_dev *dev); |
| 1120 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 1122 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 1121 | void pci_setup_bridge(struct pci_bus *bus); | 1123 | void pci_setup_bridge(struct pci_bus *bus); |
| @@ -1154,59 +1156,42 @@ struct msix_entry { | |||
| 1154 | }; | 1156 | }; |
| 1155 | 1157 | ||
| 1156 | 1158 | ||
| 1157 | #ifndef CONFIG_PCI_MSI | 1159 | #ifdef CONFIG_PCI_MSI |
| 1158 | static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) | 1160 | int pci_msi_vec_count(struct pci_dev *dev); |
| 1159 | { | 1161 | int pci_enable_msi_block(struct pci_dev *dev, int nvec); |
| 1160 | return -1; | ||
| 1161 | } | ||
| 1162 | |||
| 1163 | static inline int | ||
| 1164 | pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) | ||
| 1165 | { | ||
| 1166 | return -1; | ||
| 1167 | } | ||
| 1168 | |||
| 1169 | static inline void pci_msi_shutdown(struct pci_dev *dev) | ||
| 1170 | { } | ||
| 1171 | static inline void pci_disable_msi(struct pci_dev *dev) | ||
| 1172 | { } | ||
| 1173 | |||
| 1174 | static inline int pci_msix_table_size(struct pci_dev *dev) | ||
| 1175 | { | ||
| 1176 | return 0; | ||
| 1177 | } | ||
| 1178 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1179 | struct msix_entry *entries, int nvec) | ||
| 1180 | { | ||
| 1181 | return -1; | ||
| 1182 | } | ||
| 1183 | |||
| 1184 | static inline void pci_msix_shutdown(struct pci_dev *dev) | ||
| 1185 | { } | ||
| 1186 | static inline void pci_disable_msix(struct pci_dev *dev) | ||
| 1187 | { } | ||
| 1188 | |||
| 1189 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) | ||
| 1190 | { } | ||
| 1191 | |||
| 1192 | static inline void pci_restore_msi_state(struct pci_dev *dev) | ||
| 1193 | { } | ||
| 1194 | static inline int pci_msi_enabled(void) | ||
| 1195 | { | ||
| 1196 | return 0; | ||
| 1197 | } | ||
| 1198 | #else | ||
| 1199 | int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); | ||
| 1200 | int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); | ||
| 1201 | void pci_msi_shutdown(struct pci_dev *dev); | 1162 | void pci_msi_shutdown(struct pci_dev *dev); |
| 1202 | void pci_disable_msi(struct pci_dev *dev); | 1163 | void pci_disable_msi(struct pci_dev *dev); |
| 1203 | int pci_msix_table_size(struct pci_dev *dev); | 1164 | int pci_msix_vec_count(struct pci_dev *dev); |
| 1204 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); | 1165 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
| 1205 | void pci_msix_shutdown(struct pci_dev *dev); | 1166 | void pci_msix_shutdown(struct pci_dev *dev); |
| 1206 | void pci_disable_msix(struct pci_dev *dev); | 1167 | void pci_disable_msix(struct pci_dev *dev); |
| 1207 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 1168 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
| 1208 | void pci_restore_msi_state(struct pci_dev *dev); | 1169 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1209 | int pci_msi_enabled(void); | 1170 | int pci_msi_enabled(void); |
| 1171 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); | ||
| 1172 | int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, | ||
| 1173 | int minvec, int maxvec); | ||
| 1174 | #else | ||
| 1175 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1176 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) | ||
| 1177 | { return -ENOSYS; } | ||
| 1178 | static inline void pci_msi_shutdown(struct pci_dev *dev) { } | ||
| 1179 | static inline void pci_disable_msi(struct pci_dev *dev) { } | ||
| 1180 | static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1181 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1182 | struct msix_entry *entries, int nvec) | ||
| 1183 | { return -ENOSYS; } | ||
| 1184 | static inline void pci_msix_shutdown(struct pci_dev *dev) { } | ||
| 1185 | static inline void pci_disable_msix(struct pci_dev *dev) { } | ||
| 1186 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { } | ||
| 1187 | static inline void pci_restore_msi_state(struct pci_dev *dev) { } | ||
| 1188 | static inline int pci_msi_enabled(void) { return 0; } | ||
| 1189 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, | ||
| 1190 | int maxvec) | ||
| 1191 | { return -ENOSYS; } | ||
| 1192 | static inline int pci_enable_msix_range(struct pci_dev *dev, | ||
| 1193 | struct msix_entry *entries, int minvec, int maxvec) | ||
| 1194 | { return -ENOSYS; } | ||
| 1210 | #endif | 1195 | #endif |
| 1211 | 1196 | ||
| 1212 | #ifdef CONFIG_PCIEPORTBUS | 1197 | #ifdef CONFIG_PCIEPORTBUS |
| @@ -1217,12 +1202,10 @@ extern bool pcie_ports_auto; | |||
| 1217 | #define pcie_ports_auto false | 1202 | #define pcie_ports_auto false |
| 1218 | #endif | 1203 | #endif |
| 1219 | 1204 | ||
| 1220 | #ifndef CONFIG_PCIEASPM | 1205 | #ifdef CONFIG_PCIEASPM |
| 1221 | static inline int pcie_aspm_enabled(void) { return 0; } | ||
| 1222 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1223 | #else | ||
| 1224 | int pcie_aspm_enabled(void); | ||
| 1225 | bool pcie_aspm_support_enabled(void); | 1206 | bool pcie_aspm_support_enabled(void); |
| 1207 | #else | ||
| 1208 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1226 | #endif | 1209 | #endif |
| 1227 | 1210 | ||
| 1228 | #ifdef CONFIG_PCIEAER | 1211 | #ifdef CONFIG_PCIEAER |
| @@ -1233,15 +1216,12 @@ static inline void pci_no_aer(void) { } | |||
| 1233 | static inline bool pci_aer_available(void) { return false; } | 1216 | static inline bool pci_aer_available(void) { return false; } |
| 1234 | #endif | 1217 | #endif |
| 1235 | 1218 | ||
| 1236 | #ifndef CONFIG_PCIE_ECRC | 1219 | #ifdef CONFIG_PCIE_ECRC |
| 1237 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
| 1238 | { | ||
| 1239 | return; | ||
| 1240 | } | ||
| 1241 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
| 1242 | #else | ||
| 1243 | void pcie_set_ecrc_checking(struct pci_dev *dev); | 1220 | void pcie_set_ecrc_checking(struct pci_dev *dev); |
| 1244 | void pcie_ecrc_get_policy(char *str); | 1221 | void pcie_ecrc_get_policy(char *str); |
| 1222 | #else | ||
| 1223 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } | ||
| 1224 | static inline void pcie_ecrc_get_policy(char *str) { } | ||
| 1245 | #endif | 1225 | #endif |
| 1246 | 1226 | ||
| 1247 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1227 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
| @@ -1265,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev); | |||
| 1265 | extern int pci_domains_supported; | 1245 | extern int pci_domains_supported; |
| 1266 | #else | 1246 | #else |
| 1267 | enum { pci_domains_supported = 0 }; | 1247 | enum { pci_domains_supported = 0 }; |
| 1268 | static inline int pci_domain_nr(struct pci_bus *bus) | 1248 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1269 | { | 1249 | static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } |
| 1270 | return 0; | ||
| 1271 | } | ||
| 1272 | |||
| 1273 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
| 1274 | { | ||
| 1275 | return 0; | ||
| 1276 | } | ||
| 1277 | #endif /* CONFIG_PCI_DOMAINS */ | 1250 | #endif /* CONFIG_PCI_DOMAINS */ |
| 1278 | 1251 | ||
| 1279 | /* some architectures require additional setup to direct VGA traffic */ | 1252 | /* some architectures require additional setup to direct VGA traffic */ |
| @@ -1302,180 +1275,88 @@ _PCI_NOP_ALL(write,) | |||
| 1302 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 1275 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
| 1303 | unsigned int device, | 1276 | unsigned int device, |
| 1304 | struct pci_dev *from) | 1277 | struct pci_dev *from) |
| 1305 | { | 1278 | { return NULL; } |
| 1306 | return NULL; | ||
| 1307 | } | ||
| 1308 | 1279 | ||
| 1309 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | 1280 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, |
| 1310 | unsigned int device, | 1281 | unsigned int device, |
| 1311 | unsigned int ss_vendor, | 1282 | unsigned int ss_vendor, |
| 1312 | unsigned int ss_device, | 1283 | unsigned int ss_device, |
| 1313 | struct pci_dev *from) | 1284 | struct pci_dev *from) |
| 1314 | { | 1285 | { return NULL; } |
| 1315 | return NULL; | ||
| 1316 | } | ||
| 1317 | 1286 | ||
| 1318 | static inline struct pci_dev *pci_get_class(unsigned int class, | 1287 | static inline struct pci_dev *pci_get_class(unsigned int class, |
| 1319 | struct pci_dev *from) | 1288 | struct pci_dev *from) |
| 1320 | { | 1289 | { return NULL; } |
| 1321 | return NULL; | ||
| 1322 | } | ||
| 1323 | 1290 | ||
| 1324 | #define pci_dev_present(ids) (0) | 1291 | #define pci_dev_present(ids) (0) |
| 1325 | #define no_pci_devices() (1) | 1292 | #define no_pci_devices() (1) |
| 1326 | #define pci_dev_put(dev) do { } while (0) | 1293 | #define pci_dev_put(dev) do { } while (0) |
| 1327 | 1294 | ||
| 1328 | static inline void pci_set_master(struct pci_dev *dev) | 1295 | static inline void pci_set_master(struct pci_dev *dev) { } |
| 1329 | { } | 1296 | static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } |
| 1330 | 1297 | static inline void pci_disable_device(struct pci_dev *dev) { } | |
| 1331 | static inline int pci_enable_device(struct pci_dev *dev) | ||
| 1332 | { | ||
| 1333 | return -EIO; | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | static inline void pci_disable_device(struct pci_dev *dev) | ||
| 1337 | { } | ||
| 1338 | |||
| 1339 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | 1298 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) |
| 1340 | { | 1299 | { return -EIO; } |
| 1341 | return -EIO; | ||
| 1342 | } | ||
| 1343 | |||
| 1344 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | 1300 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) |
| 1345 | { | 1301 | { return -EIO; } |
| 1346 | return -EIO; | ||
| 1347 | } | ||
| 1348 | |||
| 1349 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, | 1302 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, |
| 1350 | unsigned int size) | 1303 | unsigned int size) |
| 1351 | { | 1304 | { return -EIO; } |
| 1352 | return -EIO; | ||
| 1353 | } | ||
| 1354 | |||
| 1355 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, | 1305 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, |
| 1356 | unsigned long mask) | 1306 | unsigned long mask) |
| 1357 | { | 1307 | { return -EIO; } |
| 1358 | return -EIO; | ||
| 1359 | } | ||
| 1360 | |||
| 1361 | static inline int pci_assign_resource(struct pci_dev *dev, int i) | 1308 | static inline int pci_assign_resource(struct pci_dev *dev, int i) |
| 1362 | { | 1309 | { return -EBUSY; } |
| 1363 | return -EBUSY; | ||
| 1364 | } | ||
| 1365 | |||
| 1366 | static inline int __pci_register_driver(struct pci_driver *drv, | 1310 | static inline int __pci_register_driver(struct pci_driver *drv, |
| 1367 | struct module *owner) | 1311 | struct module *owner) |
| 1368 | { | 1312 | { return 0; } |
| 1369 | return 0; | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | static inline int pci_register_driver(struct pci_driver *drv) | 1313 | static inline int pci_register_driver(struct pci_driver *drv) |
| 1373 | { | 1314 | { return 0; } |
| 1374 | return 0; | 1315 | static inline void pci_unregister_driver(struct pci_driver *drv) { } |
| 1375 | } | ||
| 1376 | |||
| 1377 | static inline void pci_unregister_driver(struct pci_driver *drv) | ||
| 1378 | { } | ||
| 1379 | |||
| 1380 | static inline int pci_find_capability(struct pci_dev *dev, int cap) | 1316 | static inline int pci_find_capability(struct pci_dev *dev, int cap) |
| 1381 | { | 1317 | { return 0; } |
| 1382 | return 0; | ||
| 1383 | } | ||
| 1384 | |||
| 1385 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, | 1318 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, |
| 1386 | int cap) | 1319 | int cap) |
| 1387 | { | 1320 | { return 0; } |
| 1388 | return 0; | ||
| 1389 | } | ||
| 1390 | |||
| 1391 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) | 1321 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) |
| 1392 | { | 1322 | { return 0; } |
| 1393 | return 0; | ||
| 1394 | } | ||
| 1395 | 1323 | ||
| 1396 | /* Power management related routines */ | 1324 | /* Power management related routines */ |
| 1397 | static inline int pci_save_state(struct pci_dev *dev) | 1325 | static inline int pci_save_state(struct pci_dev *dev) { return 0; } |
| 1398 | { | 1326 | static inline void pci_restore_state(struct pci_dev *dev) { } |
| 1399 | return 0; | ||
| 1400 | } | ||
| 1401 | |||
| 1402 | static inline void pci_restore_state(struct pci_dev *dev) | ||
| 1403 | { } | ||
| 1404 | |||
| 1405 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1327 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 1406 | { | 1328 | { return 0; } |
| 1407 | return 0; | ||
| 1408 | } | ||
| 1409 | |||
| 1410 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) | 1329 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) |
| 1411 | { | 1330 | { return 0; } |
| 1412 | return 0; | ||
| 1413 | } | ||
| 1414 | |||
| 1415 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, | 1331 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, |
| 1416 | pm_message_t state) | 1332 | pm_message_t state) |
| 1417 | { | 1333 | { return PCI_D0; } |
| 1418 | return PCI_D0; | ||
| 1419 | } | ||
| 1420 | |||
| 1421 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 1334 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 1422 | int enable) | 1335 | int enable) |
| 1423 | { | 1336 | { return 0; } |
| 1424 | return 0; | ||
| 1425 | } | ||
| 1426 | |||
| 1427 | static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1428 | { | ||
| 1429 | } | ||
| 1430 | |||
| 1431 | static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1432 | { | ||
| 1433 | } | ||
| 1434 | |||
| 1435 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
| 1436 | { | ||
| 1437 | return 0; | ||
| 1438 | } | ||
| 1439 | |||
| 1440 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
| 1441 | { | ||
| 1442 | } | ||
| 1443 | 1337 | ||
| 1444 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1338 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
| 1445 | { | 1339 | { return -EIO; } |
| 1446 | return -EIO; | 1340 | static inline void pci_release_regions(struct pci_dev *dev) { } |
| 1447 | } | ||
| 1448 | |||
| 1449 | static inline void pci_release_regions(struct pci_dev *dev) | ||
| 1450 | { } | ||
| 1451 | 1341 | ||
| 1452 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 1342 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
| 1453 | 1343 | ||
| 1454 | static inline void pci_block_cfg_access(struct pci_dev *dev) | 1344 | static inline void pci_block_cfg_access(struct pci_dev *dev) { } |
| 1455 | { } | ||
| 1456 | |||
| 1457 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) | 1345 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1458 | { return 0; } | 1346 | { return 0; } |
| 1459 | 1347 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) { } | |
| 1460 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1461 | { } | ||
| 1462 | 1348 | ||
| 1463 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1349 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
| 1464 | { return NULL; } | 1350 | { return NULL; } |
| 1465 | |||
| 1466 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | 1351 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, |
| 1467 | unsigned int devfn) | 1352 | unsigned int devfn) |
| 1468 | { return NULL; } | 1353 | { return NULL; } |
| 1469 | |||
| 1470 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | 1354 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, |
| 1471 | unsigned int devfn) | 1355 | unsigned int devfn) |
| 1472 | { return NULL; } | 1356 | { return NULL; } |
| 1473 | 1357 | ||
| 1474 | static inline int pci_domain_nr(struct pci_bus *bus) | 1358 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1475 | { return 0; } | 1359 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } |
| 1476 | |||
| 1477 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | ||
| 1478 | { return NULL; } | ||
| 1479 | 1360 | ||
| 1480 | #define dev_is_pci(d) (false) | 1361 | #define dev_is_pci(d) (false) |
| 1481 | #define dev_is_pf(d) (false) | 1362 | #define dev_is_pf(d) (false) |
| @@ -1486,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | |||
| 1486 | 1367 | ||
| 1487 | #include <asm/pci.h> | 1368 | #include <asm/pci.h> |
| 1488 | 1369 | ||
| 1489 | #ifndef PCIBIOS_MAX_MEM_32 | ||
| 1490 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
| 1491 | #endif | ||
| 1492 | |||
| 1493 | /* these helpers provide future and backwards compatibility | 1370 | /* these helpers provide future and backwards compatibility |
| 1494 | * for accessing popular PCI BAR info */ | 1371 | * for accessing popular PCI BAR info */ |
| 1495 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1372 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
| @@ -1635,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev); | |||
| 1635 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); | 1512 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); |
| 1636 | #else | 1513 | #else |
| 1637 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | 1514 | static inline void pci_fixup_device(enum pci_fixup_pass pass, |
| 1638 | struct pci_dev *dev) {} | 1515 | struct pci_dev *dev) { } |
| 1639 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) | 1516 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) |
| 1640 | { | 1517 | { |
| 1641 | return pci_dev_get(dev); | 1518 | return pci_dev_get(dev); |
| @@ -1707,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | |||
| 1707 | int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1584 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
| 1708 | #else | 1585 | #else |
| 1709 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1586 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1710 | { | 1587 | { return -ENODEV; } |
| 1711 | return -ENODEV; | 1588 | static inline void pci_disable_sriov(struct pci_dev *dev) { } |
| 1712 | } | ||
| 1713 | static inline void pci_disable_sriov(struct pci_dev *dev) | ||
| 1714 | { | ||
| 1715 | } | ||
| 1716 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | 1589 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) |
| 1717 | { | 1590 | { return IRQ_NONE; } |
| 1718 | return IRQ_NONE; | 1591 | static inline int pci_num_vf(struct pci_dev *dev) { return 0; } |
| 1719 | } | ||
| 1720 | static inline int pci_num_vf(struct pci_dev *dev) | ||
| 1721 | { | ||
| 1722 | return 0; | ||
| 1723 | } | ||
| 1724 | static inline int pci_vfs_assigned(struct pci_dev *dev) | 1592 | static inline int pci_vfs_assigned(struct pci_dev *dev) |
| 1725 | { | 1593 | { return 0; } |
| 1726 | return 0; | ||
| 1727 | } | ||
| 1728 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) | 1594 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) |
| 1729 | { | 1595 | { return 0; } |
| 1730 | return 0; | ||
| 1731 | } | ||
| 1732 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) | 1596 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) |
| 1733 | { | 1597 | { return 0; } |
| 1734 | return 0; | ||
| 1735 | } | ||
| 1736 | #endif | 1598 | #endif |
| 1737 | 1599 | ||
| 1738 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1600 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 4a98e85438a7..ab6b4e7f6657 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
| @@ -518,8 +518,16 @@ | |||
| 518 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ | 518 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ |
| 519 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ | 519 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ |
| 520 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ | 520 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ |
| 521 | #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ | ||
| 522 | #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ | ||
| 523 | #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ | ||
| 521 | #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ | 524 | #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ |
| 525 | #define PCI_EXP_SLTCTL_PWR_IND_ON 0x0100 /* Power Indicator on */ | ||
| 526 | #define PCI_EXP_SLTCTL_PWR_IND_BLINK 0x0200 /* Power Indicator blinking */ | ||
| 527 | #define PCI_EXP_SLTCTL_PWR_IND_OFF 0x0300 /* Power Indicator off */ | ||
| 522 | #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ | 528 | #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ |
| 529 | #define PCI_EXP_SLTCTL_PWR_ON 0x0000 /* Power On */ | ||
| 530 | #define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */ | ||
| 523 | #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ | 531 | #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ |
| 524 | #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ | 532 | #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ |
| 525 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ | 533 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ |
| @@ -677,17 +685,34 @@ | |||
| 677 | #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ | 685 | #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ |
| 678 | 686 | ||
| 679 | /* Virtual Channel */ | 687 | /* Virtual Channel */ |
| 680 | #define PCI_VC_PORT_REG1 4 | 688 | #define PCI_VC_PORT_CAP1 4 |
| 681 | #define PCI_VC_REG1_EVCC 0x7 /* extended VC count */ | 689 | #define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */ |
| 682 | #define PCI_VC_PORT_REG2 8 | 690 | #define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */ |
| 683 | #define PCI_VC_REG2_32_PHASE 0x2 | 691 | #define PCI_VC_CAP1_ARB_SIZE 0x00000c00 |
| 684 | #define PCI_VC_REG2_64_PHASE 0x4 | 692 | #define PCI_VC_PORT_CAP2 8 |
| 685 | #define PCI_VC_REG2_128_PHASE 0x8 | 693 | #define PCI_VC_CAP2_32_PHASE 0x00000002 |
| 694 | #define PCI_VC_CAP2_64_PHASE 0x00000004 | ||
| 695 | #define PCI_VC_CAP2_128_PHASE 0x00000008 | ||
| 696 | #define PCI_VC_CAP2_ARB_OFF 0xff000000 | ||
| 686 | #define PCI_VC_PORT_CTRL 12 | 697 | #define PCI_VC_PORT_CTRL 12 |
| 698 | #define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001 | ||
| 687 | #define PCI_VC_PORT_STATUS 14 | 699 | #define PCI_VC_PORT_STATUS 14 |
| 700 | #define PCI_VC_PORT_STATUS_TABLE 0x00000001 | ||
| 688 | #define PCI_VC_RES_CAP 16 | 701 | #define PCI_VC_RES_CAP 16 |
| 702 | #define PCI_VC_RES_CAP_32_PHASE 0x00000002 | ||
| 703 | #define PCI_VC_RES_CAP_64_PHASE 0x00000004 | ||
| 704 | #define PCI_VC_RES_CAP_128_PHASE 0x00000008 | ||
| 705 | #define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010 | ||
| 706 | #define PCI_VC_RES_CAP_256_PHASE 0x00000020 | ||
| 707 | #define PCI_VC_RES_CAP_ARB_OFF 0xff000000 | ||
| 689 | #define PCI_VC_RES_CTRL 20 | 708 | #define PCI_VC_RES_CTRL 20 |
| 709 | #define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000 | ||
| 710 | #define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000 | ||
| 711 | #define PCI_VC_RES_CTRL_ID 0x07000000 | ||
| 712 | #define PCI_VC_RES_CTRL_ENABLE 0x80000000 | ||
| 690 | #define PCI_VC_RES_STATUS 26 | 713 | #define PCI_VC_RES_STATUS 26 |
| 714 | #define PCI_VC_RES_STATUS_TABLE 0x00000001 | ||
| 715 | #define PCI_VC_RES_STATUS_NEGO 0x00000002 | ||
| 691 | #define PCI_CAP_VC_BASE_SIZEOF 0x10 | 716 | #define PCI_CAP_VC_BASE_SIZEOF 0x10 |
| 692 | #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C | 717 | #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C |
| 693 | 718 | ||
