mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
4f807e47ee
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>
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Thunderbolt driver - Tunneling support
|
|
*
|
|
* Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
|
|
* Copyright (C) 2019, Intel Corporation
|
|
*/
|
|
|
|
#ifndef TB_TUNNEL_H_
|
|
#define TB_TUNNEL_H_
|
|
|
|
#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
|
|
* @src_port: Source port of the tunnel
|
|
* @dst_port: Destination port of the tunnel. For discovered incomplete
|
|
* 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;
|
|
struct tb_port *src_port;
|
|
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
|
|
|