Lines Matching refs:tunnel

67 		struct tb_tunnel *tunnel = NULL;  in tb_discover_tunnels()  local
72 tunnel = tb_tunnel_discover_dp(tb, port); in tb_discover_tunnels()
76 tunnel = tb_tunnel_discover_pci(tb, port); in tb_discover_tunnels()
83 if (!tunnel) in tb_discover_tunnels()
86 if (tb_tunnel_is_pci(tunnel)) { in tb_discover_tunnels()
87 struct tb_switch *parent = tunnel->dst_port->sw; in tb_discover_tunnels()
89 while (parent != tunnel->src_port->sw) { in tb_discover_tunnels()
95 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_discover_tunnels()
227 struct tb_tunnel *tunnel; in tb_free_tunnel() local
229 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_free_tunnel()
230 if (tunnel->type == type && in tb_free_tunnel()
231 ((src_port && src_port == tunnel->src_port) || in tb_free_tunnel()
232 (dst_port && dst_port == tunnel->dst_port))) { in tb_free_tunnel()
233 tb_tunnel_deactivate(tunnel); in tb_free_tunnel()
234 list_del(&tunnel->list); in tb_free_tunnel()
235 tb_tunnel_free(tunnel); in tb_free_tunnel()
249 struct tb_tunnel *tunnel; in tb_free_invalid_tunnels() local
252 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_free_invalid_tunnels()
253 if (tb_tunnel_is_invalid(tunnel)) { in tb_free_invalid_tunnels()
254 tb_tunnel_deactivate(tunnel); in tb_free_invalid_tunnels()
255 list_del(&tunnel->list); in tb_free_invalid_tunnels()
256 tb_tunnel_free(tunnel); in tb_free_invalid_tunnels()
365 struct tb_tunnel *tunnel; in tb_tunnel_dp() local
378 tunnel = tb_tunnel_alloc_dp(tb, in, out); in tb_tunnel_dp()
379 if (!tunnel) { in tb_tunnel_dp()
384 if (tb_tunnel_activate(tunnel)) { in tb_tunnel_dp()
386 tb_tunnel_free(tunnel); in tb_tunnel_dp()
390 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_dp()
404 struct tb_tunnel *tunnel; in tb_tunnel_pci() local
420 tunnel = tb_tunnel_alloc_pci(tb, up, down); in tb_tunnel_pci()
421 if (!tunnel) in tb_tunnel_pci()
424 if (tb_tunnel_activate(tunnel)) { in tb_tunnel_pci()
427 tb_tunnel_free(tunnel); in tb_tunnel_pci()
431 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_pci()
439 struct tb_tunnel *tunnel; in tb_approve_xdomain_paths() local
447 tunnel = tb_tunnel_alloc_dma(tb, nhi_port, dst_port, xd->transmit_ring, in tb_approve_xdomain_paths()
450 if (!tunnel) { in tb_approve_xdomain_paths()
455 if (tb_tunnel_activate(tunnel)) { in tb_approve_xdomain_paths()
458 tb_tunnel_free(tunnel); in tb_approve_xdomain_paths()
463 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_approve_xdomain_paths()
612 struct tb_tunnel *tunnel; in tb_stop() local
616 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_stop()
622 if (tb_tunnel_is_dma(tunnel)) in tb_stop()
623 tb_tunnel_deactivate(tunnel); in tb_stop()
624 tb_tunnel_free(tunnel); in tb_stop()
708 struct tb_tunnel *tunnel, *n; in tb_resume_noirq() local
718 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_resume_noirq()
719 tb_tunnel_restart(tunnel); in tb_resume_noirq()