thunderbolt: Make tb_port_get_link_speed() available to other files
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 8 May 2020 09:41:34 +0000 (12:41 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 22 Jun 2020 16:58:20 +0000 (19:58 +0300)
We need to call this from tb.c when we improve the bandwidth management
to take USB3 into account.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.h

index 29db484d2c742950a04b978658601fcf2f617a26..c01176429d5f1712bf09fb33137c8e3aed880f96 100644 (file)
@@ -911,7 +911,13 @@ struct tb_port *tb_next_port_on_path(struct tb_port *start, struct tb_port *end,
        return next != prev ? next : NULL;
 }
 
-static int tb_port_get_link_speed(struct tb_port *port)
+/**
+ * tb_port_get_link_speed() - Get current link speed
+ * @port: Port to check (USB4 or CIO)
+ *
+ * Returns link speed in Gb/s or negative errno in case of failure.
+ */
+int tb_port_get_link_speed(struct tb_port *port)
 {
        u32 val, speed;
        int ret;
index cb53a94fe4f8ae18dc74086ef13de01c0786f4d4..c6f18200fe92c8a5422cc8d09192ce45f12899dc 100644 (file)
@@ -759,6 +759,8 @@ struct tb_port *tb_next_port_on_path(struct tb_port *start, struct tb_port *end,
        for ((p) = tb_next_port_on_path((src), (dst), NULL); (p);       \
             (p) = tb_next_port_on_path((src), (dst), (p)))
 
+int tb_port_get_link_speed(struct tb_port *port);
+
 int tb_switch_find_vse_cap(struct tb_switch *sw, enum tb_switch_vse_cap vsec);
 int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap);
 int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap);