summaryrefslogtreecommitdiffstats
path: root/include/linux/thunderbolt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/thunderbolt.h')
-rw-r--r--include/linux/thunderbolt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h
index 910b1bf92112..43b8d1e09341 100644
--- a/include/linux/thunderbolt.h
+++ b/include/linux/thunderbolt.h
@@ -78,6 +78,13 @@ struct tb {
extern struct bus_type tb_bus_type;
+#define TB_LINKS_PER_PHY_PORT 2
+
+static inline unsigned int tb_phy_port_from_link(unsigned int link)
+{
+ return (link - 1) / TB_LINKS_PER_PHY_PORT;
+}
+
/**
* struct tb_property_dir - XDomain property directory
* @uuid: Directory UUID or %NULL if root directory