diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index f5c7cd343e56..c1968f464c38 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -218,6 +218,7 @@ struct pci_dev { | |||
218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
219 | u8 revision; /* PCI revision, low byte of class word */ | 219 | u8 revision; /* PCI revision, low byte of class word */ |
220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
221 | u8 pcie_cap; /* PCI-E capability offset */ | ||
221 | u8 pcie_type; /* PCI-E device/port type */ | 222 | u8 pcie_type; /* PCI-E device/port type */ |
222 | u8 rom_base_reg; /* which config register controls the ROM */ | 223 | u8 rom_base_reg; /* which config register controls the ROM */ |
223 | u8 pin; /* which interrupt pin this device uses */ | 224 | u8 pin; /* which interrupt pin this device uses */ |
@@ -242,6 +243,7 @@ struct pci_dev { | |||
242 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 243 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
243 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 244 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
244 | unsigned int wakeup_prepared:1; | 245 | unsigned int wakeup_prepared:1; |
246 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | ||
245 | 247 | ||
246 | #ifdef CONFIG_PCIEASPM | 248 | #ifdef CONFIG_PCIEASPM |
247 | struct pcie_link_state *link_state; /* ASPM link state. */ | 249 | struct pcie_link_state *link_state; /* ASPM link state. */ |
@@ -280,6 +282,7 @@ struct pci_dev { | |||
280 | unsigned int is_virtfn:1; | 282 | unsigned int is_virtfn:1; |
281 | unsigned int reset_fn:1; | 283 | unsigned int reset_fn:1; |
282 | unsigned int is_hotplug_bridge:1; | 284 | unsigned int is_hotplug_bridge:1; |
285 | unsigned int aer_firmware_first:1; | ||
283 | pci_dev_flags_t dev_flags; | 286 | pci_dev_flags_t dev_flags; |
284 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 287 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
285 | 288 | ||
@@ -564,6 +567,9 @@ void pcibios_align_resource(void *, struct resource *, resource_size_t, | |||
564 | resource_size_t); | 567 | resource_size_t); |
565 | void pcibios_update_irq(struct pci_dev *, int irq); | 568 | void pcibios_update_irq(struct pci_dev *, int irq); |
566 | 569 | ||
570 | /* Weak but can be overriden by arch */ | ||
571 | void pci_fixup_cardbus(struct pci_bus *); | ||
572 | |||
567 | /* Generic PCI functions used internally */ | 573 | /* Generic PCI functions used internally */ |
568 | 574 | ||
569 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 575 | extern struct pci_bus *pci_find_bus(int domain, int busnr); |
@@ -635,7 +641,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | |||
635 | unsigned int ss_vendor, unsigned int ss_device, | 641 | unsigned int ss_vendor, unsigned int ss_device, |
636 | struct pci_dev *from); | 642 | struct pci_dev *from); |
637 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 643 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
638 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 644 | struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, |
645 | unsigned int devfn); | ||
646 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
647 | unsigned int devfn) | ||
648 | { | ||
649 | return pci_get_domain_bus_and_slot(0, bus, devfn); | ||
650 | } | ||
639 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 651 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
640 | int pci_dev_present(const struct pci_device_id *ids); | 652 | int pci_dev_present(const struct pci_device_id *ids); |
641 | 653 | ||
@@ -701,6 +713,7 @@ void pci_disable_device(struct pci_dev *dev); | |||
701 | void pci_set_master(struct pci_dev *dev); | 713 | void pci_set_master(struct pci_dev *dev); |
702 | void pci_clear_master(struct pci_dev *dev); | 714 | void pci_clear_master(struct pci_dev *dev); |
703 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 715 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
716 | int pci_set_cacheline_size(struct pci_dev *dev); | ||
704 | #define HAVE_PCI_SET_MWI | 717 | #define HAVE_PCI_SET_MWI |
705 | int __must_check pci_set_mwi(struct pci_dev *dev); | 718 | int __must_check pci_set_mwi(struct pci_dev *dev); |
706 | int pci_try_set_mwi(struct pci_dev *dev); | 719 | int pci_try_set_mwi(struct pci_dev *dev); |
@@ -743,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev); | |||
743 | int pci_prepare_to_sleep(struct pci_dev *dev); | 756 | int pci_prepare_to_sleep(struct pci_dev *dev); |
744 | int pci_back_from_sleep(struct pci_dev *dev); | 757 | int pci_back_from_sleep(struct pci_dev *dev); |
745 | 758 | ||
759 | /* For use by arch with custom probe code */ | ||
760 | void set_pcie_port_type(struct pci_dev *pdev); | ||
761 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | ||
762 | |||
746 | /* Functions for PCI Hotplug drivers to use */ | 763 | /* Functions for PCI Hotplug drivers to use */ |
747 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 764 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
748 | #ifdef CONFIG_HOTPLUG | 765 | #ifdef CONFIG_HOTPLUG |
@@ -1246,6 +1263,8 @@ extern int pci_pci_problems; | |||
1246 | 1263 | ||
1247 | extern unsigned long pci_cardbus_io_size; | 1264 | extern unsigned long pci_cardbus_io_size; |
1248 | extern unsigned long pci_cardbus_mem_size; | 1265 | extern unsigned long pci_cardbus_mem_size; |
1266 | extern u8 __devinitdata pci_dfl_cache_line_size; | ||
1267 | extern u8 pci_cache_line_size; | ||
1249 | 1268 | ||
1250 | extern unsigned long pci_hotplug_io_size; | 1269 | extern unsigned long pci_hotplug_io_size; |
1251 | extern unsigned long pci_hotplug_mem_size; | 1270 | extern unsigned long pci_hotplug_mem_size; |
@@ -1290,5 +1309,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | |||
1290 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1309 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
1291 | #endif | 1310 | #endif |
1292 | 1311 | ||
1312 | /** | ||
1313 | * pci_pcie_cap - get the saved PCIe capability offset | ||
1314 | * @dev: PCI device | ||
1315 | * | ||
1316 | * PCIe capability offset is calculated at PCI device initialization | ||
1317 | * time and saved in the data structure. This function returns saved | ||
1318 | * PCIe capability offset. Using this instead of pci_find_capability() | ||
1319 | * reduces unnecessary search in the PCI configuration space. If you | ||
1320 | * need to calculate PCIe capability offset from raw device for some | ||
1321 | * reasons, please use pci_find_capability() instead. | ||
1322 | */ | ||
1323 | static inline int pci_pcie_cap(struct pci_dev *dev) | ||
1324 | { | ||
1325 | return dev->pcie_cap; | ||
1326 | } | ||
1327 | |||
1328 | /** | ||
1329 | * pci_is_pcie - check if the PCI device is PCI Express capable | ||
1330 | * @dev: PCI device | ||
1331 | * | ||
1332 | * Retrun true if the PCI device is PCI Express capable, false otherwise. | ||
1333 | */ | ||
1334 | static inline bool pci_is_pcie(struct pci_dev *dev) | ||
1335 | { | ||
1336 | return !!pci_pcie_cap(dev); | ||
1337 | } | ||
1338 | |||
1339 | void pci_request_acs(void); | ||
1340 | |||
1293 | #endif /* __KERNEL__ */ | 1341 | #endif /* __KERNEL__ */ |
1294 | #endif /* LINUX_PCI_H */ | 1342 | #endif /* LINUX_PCI_H */ |