Lines Matching refs:tcm
39 static inline struct tb *tcm_to_tb(struct tb_cm *tcm) in tcm_to_tb() argument
41 return ((void *)tcm - sizeof(struct tb)); in tcm_to_tb()
74 struct tb_cm *tcm = tb_priv(sw->tb); in tb_add_dp_resources() local
84 list_add_tail(&port->list, &tcm->dp_resources); in tb_add_dp_resources()
91 struct tb_cm *tcm = tb_priv(sw->tb); in tb_remove_dp_resources() local
100 list_for_each_entry_safe(port, tmp, &tcm->dp_resources, list) { in tb_remove_dp_resources()
111 struct tb_cm *tcm = tb_priv(tb); in tb_discover_tunnels() local
150 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_discover_tunnels()
266 struct tb_cm *tcm = tb_priv(tb); in tb_find_tunnel() local
269 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_find_tunnel()
311 struct tb_cm *tcm = tb_priv(tb); in tb_available_bandwidth() local
358 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_available_bandwidth()
444 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_usb3() local
507 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_usb3()
570 struct tb_cm *tcm = tb_priv(port->sw->tb); in tb_scan_port() local
634 if (!tcm->hotplug_active) in tb_scan_port()
674 if (tcm->hotplug_active && tb_tunnel_usb3(sw->tb, sw)) in tb_scan_port()
730 struct tb_cm *tcm = tb_priv(tb); in tb_free_invalid_tunnels() local
734 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_free_invalid_tunnels()
818 struct tb_cm *tcm = tb_priv(tb); in tb_find_dp_out() local
823 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_find_dp_out()
855 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_dp() local
872 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_tunnel_dp()
941 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_dp()
986 struct tb_cm *tcm = tb_priv(tb); in tb_dp_resource_available() local
992 list_for_each_entry(p, &tcm->dp_resources, list) { in tb_dp_resource_available()
999 list_add_tail(&port->list, &tcm->dp_resources); in tb_dp_resource_available()
1007 struct tb_cm *tcm = tb_priv(tb); in tb_disconnect_and_release_dp() local
1014 list_for_each_entry_safe_reverse(tunnel, n, &tcm->tunnel_list, list) { in tb_disconnect_and_release_dp()
1019 while (!list_empty(&tcm->dp_resources)) { in tb_disconnect_and_release_dp()
1022 port = list_first_entry(&tcm->dp_resources, in tb_disconnect_and_release_dp()
1050 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_pci() local
1079 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_pci()
1087 struct tb_cm *tcm = tb_priv(tb); in tb_approve_xdomain_paths() local
1112 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_approve_xdomain_paths()
1121 struct tb_cm *tcm = tb_priv(tb); in __tb_disconnect_xdomain_paths() local
1130 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in __tb_disconnect_xdomain_paths()
1167 struct tb_cm *tcm = tb_priv(tb); in tb_handle_hotplug() local
1175 if (!tcm->hotplug_active) in tb_handle_hotplug()
1295 struct tb_cm *tcm = tb_priv(tb); in tb_stop() local
1299 cancel_delayed_work(&tcm->remove_work); in tb_stop()
1301 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_stop()
1312 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_stop()
1338 struct tb_cm *tcm = tb_priv(tb); in tb_start() local
1385 tcm->hotplug_active = true; in tb_start()
1391 struct tb_cm *tcm = tb_priv(tb); in tb_suspend_noirq() local
1396 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_suspend_noirq()
1430 struct tb_cm *tcm = tb_priv(tb); in tb_resume_noirq() local
1442 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_resume_noirq()
1444 if (!list_empty(&tcm->tunnel_list)) { in tb_resume_noirq()
1453 tcm->hotplug_active = true; in tb_resume_noirq()
1483 struct tb_cm *tcm = tb_priv(tb); in tb_freeze_noirq() local
1485 tcm->hotplug_active = false; in tb_freeze_noirq()
1491 struct tb_cm *tcm = tb_priv(tb); in tb_thaw_noirq() local
1493 tcm->hotplug_active = true; in tb_thaw_noirq()
1512 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_suspend() local
1516 tcm->hotplug_active = false; in tb_runtime_suspend()
1524 struct tb_cm *tcm = container_of(work, struct tb_cm, remove_work.work); in tb_remove_work() local
1525 struct tb *tb = tcm_to_tb(tcm); in tb_remove_work()
1537 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_resume() local
1544 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_runtime_resume()
1546 tcm->hotplug_active = true; in tb_runtime_resume()
1554 queue_delayed_work(tb->wq, &tcm->remove_work, msecs_to_jiffies(50)); in tb_runtime_resume()
1640 struct tb_cm *tcm; in tb_probe() local
1643 tb = tb_domain_alloc(nhi, TB_TIMEOUT, sizeof(*tcm)); in tb_probe()
1654 tcm = tb_priv(tb); in tb_probe()
1655 INIT_LIST_HEAD(&tcm->tunnel_list); in tb_probe()
1656 INIT_LIST_HEAD(&tcm->dp_resources); in tb_probe()
1657 INIT_DELAYED_WORK(&tcm->remove_work, tb_remove_work); in tb_probe()