Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1739923 > unrolled thread

[PATCH 2/7] PCI: Introduce pcie_upstream_port()

Started byMika Westerberg <mika.westerberg@linux.intel.com>
First post2017-09-26 16:20 +0200
Last post2017-09-26 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/7] PCI: Introduce pcie_upstream_port() Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-09-26 16:20 +0200

#1739923 — [PATCH 2/7] PCI: Introduce pcie_upstream_port()

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-09-26 16:20 +0200
Subject[PATCH 2/7] PCI: Introduce pcie_upstream_port()
Message-ID<utYSl-5Rt-13@gated-at.bofh.it>
This helper allows to determine whether the PCI device is PCIe upstream
port.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 include/linux/pci.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index f68c58a93dd0..4397692be538 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2042,6 +2042,17 @@ static inline int pci_pcie_type(const struct pci_dev *dev)
 	return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
 }
 
+/**
+ * pcie_upstream_port - is the PCI device PCIe upstream port
+ * @dev: PCI device
+ */
+static inline bool pcie_upstream_port(struct pci_dev *dev)
+{
+	if (!pci_is_pcie(dev))
+		return false;
+	return pci_pcie_type(dev) == PCI_EXP_TYPE_UPSTREAM;
+}
+
 static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
 {
 	while (1) {
-- 
2.14.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web