Lines Matching full:tcm
65 static inline struct tb *tcm_to_tb(struct tb_cm *tcm) in tcm_to_tb() argument
67 return ((void *)tcm - sizeof(struct tb)); in tcm_to_tb()
78 static void tb_init_bandwidth_groups(struct tb_cm *tcm) in tb_init_bandwidth_groups() argument
82 for (i = 0; i < ARRAY_SIZE(tcm->groups); i++) { in tb_init_bandwidth_groups()
83 struct tb_bandwidth_group *group = &tcm->groups[i]; in tb_init_bandwidth_groups()
85 group->tb = tcm_to_tb(tcm); in tb_init_bandwidth_groups()
103 static struct tb_bandwidth_group *tb_find_free_bandwidth_group(struct tb_cm *tcm) in tb_find_free_bandwidth_group() argument
107 for (i = 0; i < ARRAY_SIZE(tcm->groups); i++) { in tb_find_free_bandwidth_group()
108 struct tb_bandwidth_group *group = &tcm->groups[i]; in tb_find_free_bandwidth_group()
118 tb_attach_bandwidth_group(struct tb_cm *tcm, struct tb_port *in, in tb_attach_bandwidth_group() argument
130 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_attach_bandwidth_group()
145 group = tb_find_free_bandwidth_group(tcm); in tb_attach_bandwidth_group()
154 static void tb_discover_bandwidth_group(struct tb_cm *tcm, struct tb_port *in, in tb_discover_bandwidth_group() argument
161 for (i = 0; i < ARRAY_SIZE(tcm->groups); i++) { in tb_discover_bandwidth_group()
162 if (tcm->groups[i].index == index) { in tb_discover_bandwidth_group()
163 tb_bandwidth_group_attach_port(&tcm->groups[i], in); in tb_discover_bandwidth_group()
169 tb_attach_bandwidth_group(tcm, in, out); in tb_discover_bandwidth_group()
206 struct tb_cm *tcm = tb_priv(sw->tb); in tb_add_dp_resources() local
216 list_add_tail(&port->list, &tcm->dp_resources); in tb_add_dp_resources()
223 struct tb_cm *tcm = tb_priv(sw->tb); in tb_remove_dp_resources() local
232 list_for_each_entry_safe(port, tmp, &tcm->dp_resources, list) { in tb_remove_dp_resources()
242 struct tb_cm *tcm = tb_priv(tb); in tb_discover_dp_resource() local
245 list_for_each_entry(p, &tcm->dp_resources, list) { in tb_discover_dp_resource()
252 list_add_tail(&port->list, &tcm->dp_resources); in tb_discover_dp_resource()
257 struct tb_cm *tcm = tb_priv(tb); in tb_discover_dp_resources() local
260 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_discover_dp_resources()
269 struct tb_cm *tcm = tb_priv(sw->tb); in tb_enable_clx() local
294 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_enable_clx()
503 struct tb_cm *tcm = tb_priv(tb); in tb_discover_tunnels() local
506 tb_switch_discover_tunnels(tb->root_switch, &tcm->tunnel_list, true); in tb_discover_tunnels()
508 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_discover_tunnels()
524 tb_discover_bandwidth_group(tcm, in, out); in tb_discover_tunnels()
611 struct tb_cm *tcm = tb_priv(tb); in tb_find_tunnel() local
614 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_find_tunnel()
720 struct tb_cm *tcm = tb_priv(tb); in tb_consumed_dp_bandwidth() local
730 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_consumed_dp_bandwidth()
994 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_usb3() local
1057 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_usb3()
1339 struct tb_cm *tcm = tb_priv(port->sw->tb); in tb_scan_port() local
1408 if (!tcm->hotplug_active) { in tb_scan_port()
1454 if (tcm->hotplug_active && tb_tunnel_usb3(sw->tb, sw)) in tb_scan_port()
1522 struct tb_cm *tcm = tb_priv(tb); in tb_free_invalid_tunnels() local
1526 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_free_invalid_tunnels()
1686 struct tb_cm *tcm = tb_priv(tb); in tb_recalc_estimated_bandwidth() local
1691 for (i = 0; i < ARRAY_SIZE(tcm->groups); i++) { in tb_recalc_estimated_bandwidth()
1692 struct tb_bandwidth_group *group = &tcm->groups[i]; in tb_recalc_estimated_bandwidth()
1704 struct tb_cm *tcm = tb_priv(tb); in tb_find_dp_out() local
1709 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_find_dp_out()
1742 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_one_dp() local
1753 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_tunnel_one_dp()
1776 if (!tb_attach_bandwidth_group(tcm, in, out)) in tb_tunnel_one_dp()
1811 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_one_dp()
1851 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_dp() local
1867 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_tunnel_dp()
1996 struct tb_cm *tcm = tb_priv(tb); in tb_dp_resource_available() local
2002 list_for_each_entry(p, &tcm->dp_resources, list) { in tb_dp_resource_available()
2009 list_add_tail(&port->list, &tcm->dp_resources); in tb_dp_resource_available()
2018 struct tb_cm *tcm = tb_priv(tb); in tb_disconnect_and_release_dp() local
2025 list_for_each_entry_safe_reverse(tunnel, n, &tcm->tunnel_list, list) { in tb_disconnect_and_release_dp()
2030 while (!list_empty(&tcm->dp_resources)) { in tb_disconnect_and_release_dp()
2033 port = list_first_entry(&tcm->dp_resources, in tb_disconnect_and_release_dp()
2063 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_pci() local
2100 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_pci()
2108 struct tb_cm *tcm = tb_priv(tb); in tb_approve_xdomain_paths() local
2140 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_approve_xdomain_paths()
2157 struct tb_cm *tcm = tb_priv(tb); in __tb_disconnect_xdomain_paths() local
2166 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in __tb_disconnect_xdomain_paths()
2210 struct tb_cm *tcm = tb_priv(tb); in tb_handle_hotplug() local
2218 if (!tcm->hotplug_active) in tb_handle_hotplug()
2462 struct tb_cm *tcm = tb_priv(tb); in tb_handle_dp_bandwidth_request() local
2468 if (!tcm->hotplug_active) in tb_handle_dp_bandwidth_request()
2617 struct tb_cm *tcm = tb_priv(tb); in tb_stop() local
2621 cancel_delayed_work(&tcm->remove_work); in tb_stop()
2623 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_stop()
2634 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_stop()
2660 struct tb_cm *tcm = tb_priv(tb); in tb_start() local
2730 tcm->hotplug_active = true; in tb_start()
2736 struct tb_cm *tcm = tb_priv(tb); in tb_suspend_noirq() local
2742 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_suspend_noirq()
2782 struct tb_cm *tcm = tb_priv(tb); in tb_resume_noirq() local
2816 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_resume_noirq()
2825 if (!list_empty(&tcm->tunnel_list)) { in tb_resume_noirq()
2835 tcm->hotplug_active = true; in tb_resume_noirq()
2865 struct tb_cm *tcm = tb_priv(tb); in tb_freeze_noirq() local
2867 tcm->hotplug_active = false; in tb_freeze_noirq()
2873 struct tb_cm *tcm = tb_priv(tb); in tb_thaw_noirq() local
2875 tcm->hotplug_active = true; in tb_thaw_noirq()
2894 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_suspend() local
2904 tcm->hotplug_active = false; in tb_runtime_suspend()
2912 struct tb_cm *tcm = container_of(work, struct tb_cm, remove_work.work); in tb_remove_work() local
2913 struct tb *tb = tcm_to_tb(tcm); in tb_remove_work()
2925 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_resume() local
2932 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_runtime_resume()
2935 tcm->hotplug_active = true; in tb_runtime_resume()
2943 queue_delayed_work(tb->wq, &tcm->remove_work, msecs_to_jiffies(50)); in tb_runtime_resume()
3034 struct tb_cm *tcm; in tb_probe() local
3037 tb = tb_domain_alloc(nhi, TB_TIMEOUT, sizeof(*tcm)); in tb_probe()
3048 tcm = tb_priv(tb); in tb_probe()
3049 INIT_LIST_HEAD(&tcm->tunnel_list); in tb_probe()
3050 INIT_LIST_HEAD(&tcm->dp_resources); in tb_probe()
3051 INIT_DELAYED_WORK(&tcm->remove_work, tb_remove_work); in tb_probe()
3052 tb_init_bandwidth_groups(tcm); in tb_probe()