summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.h
diff options
context:
space:
mode:
authorAndreas Noever <andreas.noever@gmail.com>2014-06-03 22:04:06 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 14:07:47 -0700
commit053596d9e26c86352c4b2b372f43f2746b97de45 (patch)
tree7568b6b0dc29e9030bf1d6ffd38f522d6907e980 /drivers/thunderbolt/tb.h
parent9da672a42878c58af5c50d7389dbae17bea9df38 (diff)
thunderbolt: Handle hotplug events
We receive a plug event callback whenever a thunderbolt device is added or removed. This patch fills in the tb_handle_hotplug method and starts reacting to these events by adding/removing switches from the hierarchy. Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/tb.h')
-rw-r--r--drivers/thunderbolt/tb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index 70a66fef0177..661f1828527a 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -20,6 +20,7 @@ struct tb_switch {
struct tb_port *ports;
struct tb *tb;
int cap_plug_events; /* offset, zero if not found */
+ bool is_unplugged; /* unplugged, will go away */
};
/**
@@ -160,6 +161,8 @@ void thunderbolt_shutdown_and_free(struct tb *tb);
struct tb_switch *tb_switch_alloc(struct tb *tb, u64 route);
void tb_switch_free(struct tb_switch *sw);
+void tb_sw_set_unpplugged(struct tb_switch *sw);
+struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged);