diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 0e49f70dbd9b..a38772a85588 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1928,6 +1928,20 @@ static inline int pci_pcie_type(const struct pci_dev *dev) | |||
1928 | return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; | 1928 | return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; |
1929 | } | 1929 | } |
1930 | 1930 | ||
1931 | static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev) | ||
1932 | { | ||
1933 | while (1) { | ||
1934 | if (!pci_is_pcie(dev)) | ||
1935 | break; | ||
1936 | if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) | ||
1937 | return dev; | ||
1938 | if (!dev->bus->self) | ||
1939 | break; | ||
1940 | dev = dev->bus->self; | ||
1941 | } | ||
1942 | return NULL; | ||
1943 | } | ||
1944 | |||
1931 | void pci_request_acs(void); | 1945 | void pci_request_acs(void); |
1932 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); | 1946 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); |
1933 | bool pci_acs_path_enabled(struct pci_dev *start, | 1947 | bool pci_acs_path_enabled(struct pci_dev *start, |