Lines Matching refs:tcm
36 static inline struct tb *tcm_to_tb(struct tb_cm *tcm) in tcm_to_tb() argument
38 return ((void *)tcm - sizeof(struct tb)); in tcm_to_tb()
71 struct tb_cm *tcm = tb_priv(sw->tb); in tb_add_dp_resources() local
81 list_add_tail(&port->list, &tcm->dp_resources); in tb_add_dp_resources()
88 struct tb_cm *tcm = tb_priv(sw->tb); in tb_remove_dp_resources() local
97 list_for_each_entry_safe(port, tmp, &tcm->dp_resources, list) { in tb_remove_dp_resources()
108 struct tb_cm *tcm = tb_priv(tb); in tb_discover_tunnels() local
143 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_discover_tunnels()
256 struct tb_cm *tcm = tb_priv(tb); in tb_find_tunnel() local
259 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_find_tunnel()
301 struct tb_cm *tcm = tb_priv(tb); in tb_available_bandwidth() local
348 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_available_bandwidth()
434 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_usb3() local
492 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_usb3()
552 struct tb_cm *tcm = tb_priv(port->sw->tb); in tb_scan_port() local
616 if (!tcm->hotplug_active) in tb_scan_port()
656 if (tcm->hotplug_active && tb_tunnel_usb3(sw->tb, sw)) in tb_scan_port()
712 struct tb_cm *tcm = tb_priv(tb); in tb_free_invalid_tunnels() local
716 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_free_invalid_tunnels()
800 struct tb_cm *tcm = tb_priv(tb); in tb_find_dp_out() local
805 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_find_dp_out()
837 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_dp() local
849 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_tunnel_dp()
918 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_dp()
963 struct tb_cm *tcm = tb_priv(tb); in tb_dp_resource_available() local
969 list_for_each_entry(p, &tcm->dp_resources, list) { in tb_dp_resource_available()
976 list_add_tail(&port->list, &tcm->dp_resources); in tb_dp_resource_available()
984 struct tb_cm *tcm = tb_priv(tb); in tb_disconnect_and_release_dp() local
991 list_for_each_entry_safe_reverse(tunnel, n, &tcm->tunnel_list, list) { in tb_disconnect_and_release_dp()
996 while (!list_empty(&tcm->dp_resources)) { in tb_disconnect_and_release_dp()
999 port = list_first_entry(&tcm->dp_resources, in tb_disconnect_and_release_dp()
1008 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_pci() local
1037 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_pci()
1043 struct tb_cm *tcm = tb_priv(tb); in tb_approve_xdomain_paths() local
1069 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_approve_xdomain_paths()
1113 struct tb_cm *tcm = tb_priv(tb); in tb_handle_hotplug() local
1121 if (!tcm->hotplug_active) in tb_handle_hotplug()
1241 struct tb_cm *tcm = tb_priv(tb); in tb_stop() local
1245 cancel_delayed_work(&tcm->remove_work); in tb_stop()
1247 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_stop()
1258 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_stop()
1284 struct tb_cm *tcm = tb_priv(tb); in tb_start() local
1331 tcm->hotplug_active = true; in tb_start()
1337 struct tb_cm *tcm = tb_priv(tb); in tb_suspend_noirq() local
1342 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_suspend_noirq()
1376 struct tb_cm *tcm = tb_priv(tb); in tb_resume_noirq() local
1388 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_resume_noirq()
1390 if (!list_empty(&tcm->tunnel_list)) { in tb_resume_noirq()
1399 tcm->hotplug_active = true; in tb_resume_noirq()
1429 struct tb_cm *tcm = tb_priv(tb); in tb_freeze_noirq() local
1431 tcm->hotplug_active = false; in tb_freeze_noirq()
1437 struct tb_cm *tcm = tb_priv(tb); in tb_thaw_noirq() local
1439 tcm->hotplug_active = true; in tb_thaw_noirq()
1458 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_suspend() local
1462 tcm->hotplug_active = false; in tb_runtime_suspend()
1470 struct tb_cm *tcm = container_of(work, struct tb_cm, remove_work.work); in tb_remove_work() local
1471 struct tb *tb = tcm_to_tb(tcm); in tb_remove_work()
1483 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_resume() local
1490 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_runtime_resume()
1492 tcm->hotplug_active = true; in tb_runtime_resume()
1500 queue_delayed_work(tb->wq, &tcm->remove_work, msecs_to_jiffies(50)); in tb_runtime_resume()
1522 struct tb_cm *tcm; in tb_probe() local
1525 tb = tb_domain_alloc(nhi, sizeof(*tcm)); in tb_probe()
1532 tcm = tb_priv(tb); in tb_probe()
1533 INIT_LIST_HEAD(&tcm->tunnel_list); in tb_probe()
1534 INIT_LIST_HEAD(&tcm->dp_resources); in tb_probe()
1535 INIT_DELAYED_WORK(&tcm->remove_work, tb_remove_work); in tb_probe()