Lines Matching full:tunnel

22  * enum tb_tunnel_state - State of a tunnel
23 * @TB_TUNNEL_INACTIVE: tb_tunnel_activate() is not called for the tunnel
24 * @TB_TUNNEL_ACTIVATING: tb_tunnel_activate() returned successfully for the tunnel
25 * @TB_TUNNEL_ACTIVE: The tunnel is fully active
34 * struct tb_tunnel - Tunnel between two ports
37 * @src_port: Source port of the tunnel
38 * @dst_port: Destination port of the tunnel. For discovered incomplete
40 * @paths: All paths required by the tunnel
42 * @pre_activate: Optional tunnel specific initialization called before
44 * @activate: Optional tunnel specific activation/deactivation
45 * @post_deactivate: Optional tunnel specific de-initialization called
47 * @destroy: Optional tunnel specific callback called when the tunnel
49 * @maximum_bandwidth: Returns maximum possible bandwidth for this tunnel
50 * @allocated_bandwidth: Return how much bandwidth is allocated for the tunnel
51 * @alloc_bandwidth: Change tunnel bandwidth allocation
52 * @consumed_bandwidth: Return how much bandwidth the tunnel consumes
56 * @type: Type of the tunnel
57 * @state: Current state of the tunnel
58 * @max_up: Maximum upstream bandwidth (Mb/s) available for the tunnel.
60 * @max_down: Maximum downstream bandwidth (Mb/s) available for the tunnel.
70 * @callback: Optional callback called when DP tunnel is fully activated
80 int (*pre_activate)(struct tb_tunnel *tunnel);
81 int (*activate)(struct tb_tunnel *tunnel, bool activate);
82 void (*post_deactivate)(struct tb_tunnel *tunnel);
83 void (*destroy)(struct tb_tunnel *tunnel);
84 int (*maximum_bandwidth)(struct tb_tunnel *tunnel, int *max_up,
86 int (*allocated_bandwidth)(struct tb_tunnel *tunnel, int *allocated_up,
88 int (*alloc_bandwidth)(struct tb_tunnel *tunnel, int *alloc_up,
90 int (*consumed_bandwidth)(struct tb_tunnel *tunnel, int *consumed_up,
92 int (*release_unused_bandwidth)(struct tb_tunnel *tunnel);
93 void (*reclaim_available_bandwidth)(struct tb_tunnel *tunnel,
108 void (*callback)(struct tb_tunnel *tunnel, void *data);
129 bool tb_tunnel_match_dma(const struct tb_tunnel *tunnel, int transmit_path,
137 void tb_tunnel_put(struct tb_tunnel *tunnel);
138 int tb_tunnel_activate(struct tb_tunnel *tunnel);
139 void tb_tunnel_deactivate(struct tb_tunnel *tunnel);
142 * tb_tunnel_is_active() - Is tunnel fully activated
143 * @tunnel: Tunnel to check
145 * Returns %true if @tunnel is fully activated. For other than DP
150 static inline bool tb_tunnel_is_active(const struct tb_tunnel *tunnel) in tb_tunnel_is_active() argument
152 return tunnel->state == TB_TUNNEL_ACTIVE; in tb_tunnel_is_active()
155 bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel);
156 bool tb_tunnel_port_on_path(const struct tb_tunnel *tunnel,
158 int tb_tunnel_maximum_bandwidth(struct tb_tunnel *tunnel, int *max_up,
160 int tb_tunnel_allocated_bandwidth(struct tb_tunnel *tunnel, int *allocated_up,
162 int tb_tunnel_alloc_bandwidth(struct tb_tunnel *tunnel, int *alloc_up,
164 int tb_tunnel_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up,
166 int tb_tunnel_release_unused_bandwidth(struct tb_tunnel *tunnel);
167 void tb_tunnel_reclaim_available_bandwidth(struct tb_tunnel *tunnel,
171 static inline bool tb_tunnel_is_pci(const struct tb_tunnel *tunnel) in tb_tunnel_is_pci() argument
173 return tunnel->type == TB_TUNNEL_PCI; in tb_tunnel_is_pci()
176 static inline bool tb_tunnel_is_dp(const struct tb_tunnel *tunnel) in tb_tunnel_is_dp() argument
178 return tunnel->type == TB_TUNNEL_DP; in tb_tunnel_is_dp()
181 static inline bool tb_tunnel_is_dma(const struct tb_tunnel *tunnel) in tb_tunnel_is_dma() argument
183 return tunnel->type == TB_TUNNEL_DMA; in tb_tunnel_is_dma()
186 static inline bool tb_tunnel_is_usb3(const struct tb_tunnel *tunnel) in tb_tunnel_is_usb3() argument
188 return tunnel->type == TB_TUNNEL_USB3; in tb_tunnel_is_usb3()
191 static inline bool tb_tunnel_direction_downstream(const struct tb_tunnel *tunnel) in tb_tunnel_direction_downstream() argument
193 return tb_port_path_direction_downstream(tunnel->src_port, in tb_tunnel_direction_downstream()
194 tunnel->dst_port); in tb_tunnel_direction_downstream()
197 const char *tb_tunnel_type_name(const struct tb_tunnel *tunnel);
199 #define __TB_TUNNEL_PRINT(level, tunnel, fmt, arg...) \ argument
201 struct tb_tunnel *__tunnel = (tunnel); \
211 #define tb_tunnel_WARN(tunnel, fmt, arg...) \ argument
212 __TB_TUNNEL_PRINT(tb_WARN, tunnel, fmt, ##arg)
213 #define tb_tunnel_warn(tunnel, fmt, arg...) \ argument
214 __TB_TUNNEL_PRINT(tb_warn, tunnel, fmt, ##arg)
215 #define tb_tunnel_info(tunnel, fmt, arg...) \ argument
216 __TB_TUNNEL_PRINT(tb_info, tunnel, fmt, ##arg)
217 #define tb_tunnel_dbg(tunnel, fmt, arg...) \ argument
218 __TB_TUNNEL_PRINT(tb_dbg, tunnel, fmt, ##arg)