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
1412 if (!tcm->hotplug_active) { in tb_scan_port()
1466 if (tcm->hotplug_active && tb_tunnel_usb3(sw->tb, sw)) in tb_scan_port()
1534 struct tb_cm *tcm = tb_priv(tb); in tb_free_invalid_tunnels() local
1538 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_free_invalid_tunnels()
1698 struct tb_cm *tcm = tb_priv(tb); in tb_recalc_estimated_bandwidth() local
1703 for (i = 0; i < ARRAY_SIZE(tcm->groups); i++) { in tb_recalc_estimated_bandwidth()
1704 struct tb_bandwidth_group *group = &tcm->groups[i]; in tb_recalc_estimated_bandwidth()
1716 struct tb_cm *tcm = tb_priv(tb); in tb_find_dp_out() local
1721 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_find_dp_out()
1754 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_one_dp() local
1765 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_tunnel_one_dp()
1788 if (!tb_attach_bandwidth_group(tcm, in, out)) in tb_tunnel_one_dp()
1823 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_one_dp()
1863 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_dp() local
1879 list_for_each_entry(port, &tcm->dp_resources, list) { in tb_tunnel_dp()
2008 struct tb_cm *tcm = tb_priv(tb); in tb_dp_resource_available() local
2014 list_for_each_entry(p, &tcm->dp_resources, list) { in tb_dp_resource_available()
2021 list_add_tail(&port->list, &tcm->dp_resources); in tb_dp_resource_available()
2030 struct tb_cm *tcm = tb_priv(tb); in tb_disconnect_and_release_dp() local
2037 list_for_each_entry_safe_reverse(tunnel, n, &tcm->tunnel_list, list) { in tb_disconnect_and_release_dp()
2042 while (!list_empty(&tcm->dp_resources)) { in tb_disconnect_and_release_dp()
2045 port = list_first_entry(&tcm->dp_resources, in tb_disconnect_and_release_dp()
2075 struct tb_cm *tcm = tb_priv(tb); in tb_tunnel_pci() local
2112 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_tunnel_pci()
2120 struct tb_cm *tcm = tb_priv(tb); in tb_approve_xdomain_paths() local
2152 list_add_tail(&tunnel->list, &tcm->tunnel_list); in tb_approve_xdomain_paths()
2169 struct tb_cm *tcm = tb_priv(tb); in __tb_disconnect_xdomain_paths() local
2178 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in __tb_disconnect_xdomain_paths()
2222 struct tb_cm *tcm = tb_priv(tb); in tb_handle_hotplug() local
2230 if (!tcm->hotplug_active) in tb_handle_hotplug()
2474 struct tb_cm *tcm = tb_priv(tb); in tb_handle_dp_bandwidth_request() local
2480 if (!tcm->hotplug_active) in tb_handle_dp_bandwidth_request()
2629 struct tb_cm *tcm = tb_priv(tb); in tb_stop() local
2633 cancel_delayed_work(&tcm->remove_work); in tb_stop()
2635 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_stop()
2646 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_stop()
2672 struct tb_cm *tcm = tb_priv(tb); in tb_start() local
2742 tcm->hotplug_active = true; in tb_start()
2748 struct tb_cm *tcm = tb_priv(tb); in tb_suspend_noirq() local
2754 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */ in tb_suspend_noirq()
2794 struct tb_cm *tcm = tb_priv(tb); in tb_resume_noirq() local
2828 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) { in tb_resume_noirq()
2837 if (!list_empty(&tcm->tunnel_list)) { in tb_resume_noirq()
2847 tcm->hotplug_active = true; in tb_resume_noirq()
2877 struct tb_cm *tcm = tb_priv(tb); in tb_freeze_noirq() local
2879 tcm->hotplug_active = false; in tb_freeze_noirq()
2885 struct tb_cm *tcm = tb_priv(tb); in tb_thaw_noirq() local
2887 tcm->hotplug_active = true; in tb_thaw_noirq()
2906 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_suspend() local
2916 tcm->hotplug_active = false; in tb_runtime_suspend()
2924 struct tb_cm *tcm = container_of(work, struct tb_cm, remove_work.work); in tb_remove_work() local
2925 struct tb *tb = tcm_to_tb(tcm); in tb_remove_work()
2937 struct tb_cm *tcm = tb_priv(tb); in tb_runtime_resume() local
2944 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) in tb_runtime_resume()
2947 tcm->hotplug_active = true; in tb_runtime_resume()
2955 queue_delayed_work(tb->wq, &tcm->remove_work, msecs_to_jiffies(50)); in tb_runtime_resume()
3046 struct tb_cm *tcm; in tb_probe() local
3049 tb = tb_domain_alloc(nhi, TB_TIMEOUT, sizeof(*tcm)); in tb_probe()
3060 tcm = tb_priv(tb); in tb_probe()
3061 INIT_LIST_HEAD(&tcm->tunnel_list); in tb_probe()
3062 INIT_LIST_HEAD(&tcm->dp_resources); in tb_probe()
3063 INIT_DELAYED_WORK(&tcm->remove_work, tb_remove_work); in tb_probe()
3064 tb_init_bandwidth_groups(tcm); in tb_probe()