aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f5c7cd343e56..04771b9c3316 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 */
@@ -280,6 +281,7 @@ struct pci_dev {
280 unsigned int is_virtfn:1; 281 unsigned int is_virtfn:1;
281 unsigned int reset_fn:1; 282 unsigned int reset_fn:1;
282 unsigned int is_hotplug_bridge:1; 283 unsigned int is_hotplug_bridge:1;
284 unsigned int aer_firmware_first:1;
283 pci_dev_flags_t dev_flags; 285 pci_dev_flags_t dev_flags;
284 atomic_t enable_cnt; /* pci_enable_device has been called */ 286 atomic_t enable_cnt; /* pci_enable_device has been called */
285 287
@@ -635,7 +637,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
635 unsigned int ss_vendor, unsigned int ss_device, 637 unsigned int ss_vendor, unsigned int ss_device,
636 struct pci_dev *from); 638 struct pci_dev *from);
637struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 639struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
638struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 640struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
641 unsigned int devfn);
642static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
643 unsigned int devfn)
644{
645 return pci_get_domain_bus_and_slot(0, bus, devfn);
646}
639struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 647struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
640int pci_dev_present(const struct pci_device_id *ids); 648int pci_dev_present(const struct pci_device_id *ids);
641 649
@@ -701,6 +709,7 @@ void pci_disable_device(struct pci_dev *dev);
701void pci_set_master(struct pci_dev *dev); 709void pci_set_master(struct pci_dev *dev);
702void pci_clear_master(struct pci_dev *dev); 710void pci_clear_master(struct pci_dev *dev);
703int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 711int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
712int pci_set_cacheline_size(struct pci_dev *dev);
704#define HAVE_PCI_SET_MWI 713#define HAVE_PCI_SET_MWI
705int __must_check pci_set_mwi(struct pci_dev *dev); 714int __must_check pci_set_mwi(struct pci_dev *dev);
706int pci_try_set_mwi(struct pci_dev *dev); 715int pci_try_set_mwi(struct pci_dev *dev);
@@ -1246,6 +1255,8 @@ extern int pci_pci_problems;
1246 1255
1247extern unsigned long pci_cardbus_io_size; 1256extern unsigned long pci_cardbus_io_size;
1248extern unsigned long pci_cardbus_mem_size; 1257extern unsigned long pci_cardbus_mem_size;
1258extern u8 pci_dfl_cache_line_size;
1259extern u8 pci_cache_line_size;
1249 1260
1250extern unsigned long pci_hotplug_io_size; 1261extern unsigned long pci_hotplug_io_size;
1251extern unsigned long pci_hotplug_mem_size; 1262extern unsigned long pci_hotplug_mem_size;
@@ -1290,5 +1301,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
1290extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1301extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1291#endif 1302#endif
1292 1303
1304/**
1305 * pci_pcie_cap - get the saved PCIe capability offset
1306 * @dev: PCI device
1307 *
1308 * PCIe capability offset is calculated at PCI device initialization
1309 * time and saved in the data structure. This function returns saved
1310 * PCIe capability offset. Using this instead of pci_find_capability()
1311 * reduces unnecessary search in the PCI configuration space. If you
1312 * need to calculate PCIe capability offset from raw device for some
1313 * reasons, please use pci_find_capability() instead.
1314 */
1315static inline int pci_pcie_cap(struct pci_dev *dev)
1316{
1317 return dev->pcie_cap;
1318}
1319
1320/**
1321 * pci_is_pcie - check if the PCI device is PCI Express capable
1322 * @dev: PCI device
1323 *
1324 * Retrun true if the PCI device is PCI Express capable, false otherwise.
1325 */
1326static inline bool pci_is_pcie(struct pci_dev *dev)
1327{
1328 return !!pci_pcie_cap(dev);
1329}
1330
1331void pci_request_acs(void);
1332
1293#endif /* __KERNEL__ */ 1333#endif /* __KERNEL__ */
1294#endif /* LINUX_PCI_H */ 1334#endif /* LINUX_PCI_H */