diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-01-28 16:38:25 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-01-28 16:38:25 -0500 |
commit | 0ada0a73120c28cc432bcdbac061781465c2f48f (patch) | |
tree | d17cadd4ea47e25d9e48e7d409a39c84268fbd27 /include/linux/pci.h | |
parent | 6016a363f6b56b46b24655bcfc0499b715851cf3 (diff) | |
parent | 92dcffb916d309aa01778bf8963a6932e4014d07 (diff) |
Merge commit 'v2.6.33-rc5' into secretlab/test-devicetree
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index f5c7cd343e56..174e5392e51e 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); |
@@ -1246,6 +1259,8 @@ extern int pci_pci_problems; | |||
1246 | 1259 | ||
1247 | extern unsigned long pci_cardbus_io_size; | 1260 | extern unsigned long pci_cardbus_io_size; |
1248 | extern unsigned long pci_cardbus_mem_size; | 1261 | extern unsigned long pci_cardbus_mem_size; |
1262 | extern u8 __devinitdata pci_dfl_cache_line_size; | ||
1263 | extern u8 pci_cache_line_size; | ||
1249 | 1264 | ||
1250 | extern unsigned long pci_hotplug_io_size; | 1265 | extern unsigned long pci_hotplug_io_size; |
1251 | extern unsigned long pci_hotplug_mem_size; | 1266 | extern unsigned long pci_hotplug_mem_size; |
@@ -1290,5 +1305,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); | 1305 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
1291 | #endif | 1306 | #endif |
1292 | 1307 | ||
1308 | /** | ||
1309 | * pci_pcie_cap - get the saved PCIe capability offset | ||
1310 | * @dev: PCI device | ||
1311 | * | ||
1312 | * PCIe capability offset is calculated at PCI device initialization | ||
1313 | * time and saved in the data structure. This function returns saved | ||
1314 | * PCIe capability offset. Using this instead of pci_find_capability() | ||
1315 | * reduces unnecessary search in the PCI configuration space. If you | ||
1316 | * need to calculate PCIe capability offset from raw device for some | ||
1317 | * reasons, please use pci_find_capability() instead. | ||
1318 | */ | ||
1319 | static inline int pci_pcie_cap(struct pci_dev *dev) | ||
1320 | { | ||
1321 | return dev->pcie_cap; | ||
1322 | } | ||
1323 | |||
1324 | /** | ||
1325 | * pci_is_pcie - check if the PCI device is PCI Express capable | ||
1326 | * @dev: PCI device | ||
1327 | * | ||
1328 | * Retrun true if the PCI device is PCI Express capable, false otherwise. | ||
1329 | */ | ||
1330 | static inline bool pci_is_pcie(struct pci_dev *dev) | ||
1331 | { | ||
1332 | return !!pci_pcie_cap(dev); | ||
1333 | } | ||
1334 | |||
1335 | void pci_request_acs(void); | ||
1336 | |||
1293 | #endif /* __KERNEL__ */ | 1337 | #endif /* __KERNEL__ */ |
1294 | #endif /* LINUX_PCI_H */ | 1338 | #endif /* LINUX_PCI_H */ |