summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tunnel.h
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2018-09-17 16:30:49 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2019-04-18 11:18:53 +0300
commit4f807e47ee9a75747d042a8eacf398f436da9452 (patch)
treef8bbff8b83730fe4ea3275ebba63d9ff274350ac /drivers/thunderbolt/tunnel.h
parentc5ee6feb34709da96f9909b8a2e1e42875020efb (diff)
thunderbolt: Add support for Display Port tunnels
Display Port tunnels are somewhat more complex than PCIe tunnels as it requires 3 tunnels (AUX Rx/Tx and Video). In addition we are not supposed to create the tunnels immediately when a DP OUT is enumerated. Instead we need to wait until we get hotplug event to that adapter port or check if the port has HPD set before tunnels can be established. This adds Display Port tunneling support to the software connection manager. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tunnel.h')
-rw-r--r--drivers/thunderbolt/tunnel.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tunnel.h b/drivers/thunderbolt/tunnel.h
index 07bf587bed80..0373779f43ba 100644
--- a/drivers/thunderbolt/tunnel.h
+++ b/drivers/thunderbolt/tunnel.h
@@ -11,6 +11,11 @@
#include "tb.h"
+enum tb_tunnel_type {
+ TB_TUNNEL_PCI,
+ TB_TUNNEL_DP,
+};
+
/**
* struct tb_tunnel - Tunnel between two ports
* @tb: Pointer to the domain
@@ -19,8 +24,10 @@
* tunnels may be %NULL or null adapter port instead.
* @paths: All paths required by the tunnel
* @npaths: Number of paths in @paths
+ * @init: Optional tunnel specific initialization
* @activate: Optional tunnel specific activation/deactivation
* @list: Tunnels are linked using this field
+ * @type: Type of the tunnel
*/
struct tb_tunnel {
struct tb *tb;
@@ -28,18 +35,34 @@ struct tb_tunnel {
struct tb_port *dst_port;
struct tb_path **paths;
size_t npaths;
+ int (*init)(struct tb_tunnel *tunnel);
int (*activate)(struct tb_tunnel *tunnel, bool activate);
struct list_head list;
+ enum tb_tunnel_type type;
};
struct tb_tunnel *tb_tunnel_discover_pci(struct tb *tb, struct tb_port *down);
struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
struct tb_port *down);
+struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in);
+struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,
+ struct tb_port *out);
+
void tb_tunnel_free(struct tb_tunnel *tunnel);
int tb_tunnel_activate(struct tb_tunnel *tunnel);
int tb_tunnel_restart(struct tb_tunnel *tunnel);
void tb_tunnel_deactivate(struct tb_tunnel *tunnel);
bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel);
+static inline bool tb_tunnel_is_pci(const struct tb_tunnel *tunnel)
+{
+ return tunnel->type == TB_TUNNEL_PCI;
+}
+
+static inline bool tb_tunnel_is_dp(const struct tb_tunnel *tunnel)
+{
+ return tunnel->type == TB_TUNNEL_DP;
+}
+
#endif