This source file includes following definitions.
- tb_tunnel_is_pci
- tb_tunnel_is_dp
- tb_tunnel_is_dma
1
2
3
4
5
6
7
8
9 #ifndef TB_TUNNEL_H_
10 #define TB_TUNNEL_H_
11
12 #include "tb.h"
13
14 enum tb_tunnel_type {
15 TB_TUNNEL_PCI,
16 TB_TUNNEL_DP,
17 TB_TUNNEL_DMA,
18 };
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 struct tb_tunnel {
34 struct tb *tb;
35 struct tb_port *src_port;
36 struct tb_port *dst_port;
37 struct tb_path **paths;
38 size_t npaths;
39 int (*init)(struct tb_tunnel *tunnel);
40 int (*activate)(struct tb_tunnel *tunnel, bool activate);
41 struct list_head list;
42 enum tb_tunnel_type type;
43 };
44
45 struct tb_tunnel *tb_tunnel_discover_pci(struct tb *tb, struct tb_port *down);
46 struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
47 struct tb_port *down);
48 struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in);
49 struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,
50 struct tb_port *out);
51 struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi,
52 struct tb_port *dst, int transmit_ring,
53 int transmit_path, int receive_ring,
54 int receive_path);
55
56 void tb_tunnel_free(struct tb_tunnel *tunnel);
57 int tb_tunnel_activate(struct tb_tunnel *tunnel);
58 int tb_tunnel_restart(struct tb_tunnel *tunnel);
59 void tb_tunnel_deactivate(struct tb_tunnel *tunnel);
60 bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel);
61
62 static inline bool tb_tunnel_is_pci(const struct tb_tunnel *tunnel)
63 {
64 return tunnel->type == TB_TUNNEL_PCI;
65 }
66
67 static inline bool tb_tunnel_is_dp(const struct tb_tunnel *tunnel)
68 {
69 return tunnel->type == TB_TUNNEL_DP;
70 }
71
72 static inline bool tb_tunnel_is_dma(const struct tb_tunnel *tunnel)
73 {
74 return tunnel->type == TB_TUNNEL_DMA;
75 }
76
77 #endif
78