summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/tb.h
diff options
context:
space:
mode:
authorMika Westerberg2017-10-11 16:19:54 +0200
committerMika Westerberg2019-04-18 10:18:53 +0200
commit344e06430a72347b554a7fd98f3a961084f37be6 (patch)
tree749030b9462451e58673e0ceb987be245d26c978 /drivers/thunderbolt/tb.h
parentthunderbolt: Add support for full PCIe daisy chains (diff)
downloadkernel-qcow2-linux-344e06430a72347b554a7fd98f3a961084f37be6.tar.gz
kernel-qcow2-linux-344e06430a72347b554a7fd98f3a961084f37be6.tar.xz
kernel-qcow2-linux-344e06430a72347b554a7fd98f3a961084f37be6.zip
thunderbolt: Scan only valid NULL adapter ports in hotplug
The only way to expand Thunderbolt topology is through the NULL adapter ports (typically ports 1, 2, 3 and 4). There is no point handling Thunderbolt hotplug events on any other port. Add a helper function (tb_port_is_null()) that can be used to determine if the port is NULL port, and use it in software connection manager code when hotplug event is handled. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.h')
-rw-r--r--drivers/thunderbolt/tb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index 5b5ba8919086..260360ec59a9 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -350,6 +350,11 @@ static inline bool tb_port_has_remote(const struct tb_port *port)
return true;
}
+static inline bool tb_port_is_null(const struct tb_port *port)
+{
+ return port && port->port && port->config.type == TB_TYPE_PORT;
+}
+
static inline bool tb_port_is_pcie_down(const struct tb_port *port)
{
return port && port->config.type == TB_TYPE_PCIE_DOWN;