]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
thunderbolt: Introduce tb_path_deactivate_hop()
authorSanath S <Sanath.S@amd.com>
Sat, 13 Jan 2024 09:42:23 +0000 (11:42 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 22 Jan 2024 11:21:06 +0000 (13:21 +0200)
This function can be used to clear path config space of an adapter. Make
it available for other files in this driver.

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

index 091a81bbdbdc94623b1fda9a059c1b6396595c15..f760e54cd9bd1f9cc8caf8ad43990e1d32996437 100644 (file)
@@ -446,6 +446,19 @@ static int __tb_path_deactivate_hop(struct tb_port *port, int hop_index,
        return -ETIMEDOUT;
 }
 
+/**
+ * tb_path_deactivate_hop() - Deactivate one path in path config space
+ * @port: Lane or protocol adapter
+ * @hop_index: HopID of the path to be cleared
+ *
+ * This deactivates or clears a single path config space entry at
+ * @hop_index. Returns %0 in success and negative errno otherwise.
+ */
+int tb_path_deactivate_hop(struct tb_port *port, int hop_index)
+{
+       return __tb_path_deactivate_hop(port, hop_index, true);
+}
+
 static void __tb_path_deactivate_hops(struct tb_path *path, int first_hop)
 {
        int i, res;
index c38b047ba14beff44ef54bb5759732044fe0c572..2c689e3b02b9417ee9028de5a65ec7e7fc16a13c 100644 (file)
@@ -1150,6 +1150,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid,
 void tb_path_free(struct tb_path *path);
 int tb_path_activate(struct tb_path *path);
 void tb_path_deactivate(struct tb_path *path);
+int tb_path_deactivate_hop(struct tb_port *port, int hop_index);
 bool tb_path_is_invalid(struct tb_path *path);
 bool tb_path_port_on_path(const struct tb_path *path,
                          const struct tb_port *port);