Skip to content

Commit

Permalink
thunderbolt: Introduce tb_path_deactivate_hop()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>
  • Loading branch information
Sanath S authored and westeri committed Jan 22, 2024
1 parent 01da6b9 commit b35c1d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/thunderbolt/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/thunderbolt/tb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b35c1d7

Please sign in to comment.