Lines Matching refs:parent_sw
589 static struct tb_switch *alloc_switch(struct tb_switch *parent_sw, u64 route, in alloc_switch() argument
592 struct tb *tb = parent_sw->tb; in alloc_switch()
595 sw = tb_switch_alloc(tb, &parent_sw->dev, route); in alloc_switch()
611 static int add_switch(struct tb_switch *parent_sw, struct tb_switch *sw) in add_switch() argument
617 tb_port_at(route, parent_sw)->remote = tb_upstream_port(sw); in add_switch()
618 tb_upstream_port(sw)->remote = tb_port_at(route, parent_sw); in add_switch()
622 tb_port_at(tb_route(sw), parent_sw)->remote = NULL; in add_switch()
627 static void update_switch(struct tb_switch *parent_sw, struct tb_switch *sw, in update_switch() argument
632 tb_port_at(tb_route(sw), parent_sw)->remote = NULL; in update_switch()
634 tb_port_at(route, parent_sw)->remote = tb_upstream_port(sw); in update_switch()
654 struct tb_switch *parent_sw; in remove_switch() local
656 parent_sw = tb_to_switch(sw->dev.parent); in remove_switch()
657 tb_port_at(tb_route(sw), parent_sw)->remote = NULL; in remove_switch()
707 struct tb_switch *sw, *parent_sw; in icm_fr_device_connected() local
738 parent_sw = tb_to_switch(sw->dev.parent); in icm_fr_device_connected()
768 update_switch(parent_sw, sw, route, pkg->connection_id, in icm_fr_device_connected()
809 parent_sw = tb_switch_find_by_link_depth(tb, link, depth - 1); in icm_fr_device_connected()
810 if (!parent_sw) { in icm_fr_device_connected()
820 tb_switch_put(parent_sw); in icm_fr_device_connected()
824 pm_runtime_get_sync(&parent_sw->dev); in icm_fr_device_connected()
826 sw = alloc_switch(parent_sw, route, &pkg->ep_uuid); in icm_fr_device_connected()
839 if (add_switch(parent_sw, sw)) in icm_fr_device_connected()
843 pm_runtime_mark_last_busy(&parent_sw->dev); in icm_fr_device_connected()
844 pm_runtime_put_autosuspend(&parent_sw->dev); in icm_fr_device_connected()
846 tb_switch_put(parent_sw); in icm_fr_device_connected()
1174 struct tb_switch *sw, *parent_sw; in __icm_tr_device_connected() local
1206 parent_sw = tb_to_switch(sw->dev.parent); in __icm_tr_device_connected()
1207 update_switch(parent_sw, sw, route, pkg->connection_id, in __icm_tr_device_connected()
1231 parent_sw = tb_switch_find_by_route(tb, get_parent_route(route)); in __icm_tr_device_connected()
1232 if (!parent_sw) { in __icm_tr_device_connected()
1237 pm_runtime_get_sync(&parent_sw->dev); in __icm_tr_device_connected()
1239 sw = alloc_switch(parent_sw, route, &pkg->ep_uuid); in __icm_tr_device_connected()
1252 if (add_switch(parent_sw, sw)) in __icm_tr_device_connected()
1256 pm_runtime_mark_last_busy(&parent_sw->dev); in __icm_tr_device_connected()
1257 pm_runtime_put_autosuspend(&parent_sw->dev); in __icm_tr_device_connected()
1259 tb_switch_put(parent_sw); in __icm_tr_device_connected()