Lines Matching refs:xd
560 static int icm_fr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_fr_approve_xdomain_paths() argument
570 request.link_info = xd->depth << ICM_LINK_INFO_DEPTH_SHIFT | xd->link; in icm_fr_approve_xdomain_paths()
571 memcpy(&request.remote_uuid, xd->remote_uuid, sizeof(*xd->remote_uuid)); in icm_fr_approve_xdomain_paths()
590 static int icm_fr_disconnect_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_fr_disconnect_xdomain_paths() argument
597 phy_port = tb_phy_port_from_link(xd->link); in icm_fr_disconnect_xdomain_paths()
685 struct tb_xdomain *xd; in add_xdomain() local
689 xd = tb_xdomain_alloc(sw->tb, &sw->dev, route, local_uuid, remote_uuid); in add_xdomain()
690 if (!xd) in add_xdomain()
693 xd->link = link; in add_xdomain()
694 xd->depth = depth; in add_xdomain()
696 tb_port_at(route, sw)->xdomain = xd; in add_xdomain()
698 tb_xdomain_add(xd); in add_xdomain()
705 static void update_xdomain(struct tb_xdomain *xd, u64 route, u8 link) in update_xdomain() argument
707 xd->link = link; in update_xdomain()
708 xd->route = route; in update_xdomain()
709 xd->is_unplugged = false; in update_xdomain()
712 static void remove_xdomain(struct tb_xdomain *xd) in remove_xdomain() argument
716 sw = tb_to_switch(xd->dev.parent); in remove_xdomain()
717 tb_port_at(xd->route, sw)->xdomain = NULL; in remove_xdomain()
718 tb_xdomain_remove(xd); in remove_xdomain()
731 struct tb_xdomain *xd; in icm_fr_device_connected() local
823 xd = tb_xdomain_find_by_link_depth(tb, link, depth); in icm_fr_device_connected()
824 if (xd) { in icm_fr_device_connected()
825 remove_xdomain(xd); in icm_fr_device_connected()
826 tb_xdomain_put(xd); in icm_fr_device_connected()
908 struct tb_xdomain *xd; in icm_fr_xdomain_connected() local
924 xd = tb_xdomain_find_by_uuid(tb, &pkg->remote_uuid); in icm_fr_xdomain_connected()
925 if (xd) { in icm_fr_xdomain_connected()
928 xd_phy_port = phy_port_from_route(xd->route, xd->depth); in icm_fr_xdomain_connected()
931 if (xd->depth == depth && xd_phy_port == phy_port) { in icm_fr_xdomain_connected()
932 update_xdomain(xd, route, link); in icm_fr_xdomain_connected()
933 tb_xdomain_put(xd); in icm_fr_xdomain_connected()
943 remove_xdomain(xd); in icm_fr_xdomain_connected()
944 tb_xdomain_put(xd); in icm_fr_xdomain_connected()
952 xd = tb_xdomain_find_by_link_depth(tb, link, depth); in icm_fr_xdomain_connected()
953 if (!xd) { in icm_fr_xdomain_connected()
958 xd = tb_xdomain_find_by_link_depth(tb, dual_link, in icm_fr_xdomain_connected()
961 if (xd) { in icm_fr_xdomain_connected()
962 remove_xdomain(xd); in icm_fr_xdomain_connected()
963 tb_xdomain_put(xd); in icm_fr_xdomain_connected()
994 struct tb_xdomain *xd; in icm_fr_xdomain_disconnected() local
1001 xd = tb_xdomain_find_by_uuid(tb, &pkg->remote_uuid); in icm_fr_xdomain_disconnected()
1002 if (xd) { in icm_fr_xdomain_disconnected()
1003 remove_xdomain(xd); in icm_fr_xdomain_disconnected()
1004 tb_xdomain_put(xd); in icm_fr_xdomain_disconnected()
1129 static int icm_tr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_tr_approve_xdomain_paths() argument
1139 request.route_hi = upper_32_bits(xd->route); in icm_tr_approve_xdomain_paths()
1140 request.route_lo = lower_32_bits(xd->route); in icm_tr_approve_xdomain_paths()
1145 memcpy(&request.remote_uuid, xd->remote_uuid, sizeof(*xd->remote_uuid)); in icm_tr_approve_xdomain_paths()
1159 static int icm_tr_xdomain_tear_down(struct tb *tb, struct tb_xdomain *xd, in icm_tr_xdomain_tear_down() argument
1169 request.route_hi = upper_32_bits(xd->route); in icm_tr_xdomain_tear_down()
1170 request.route_lo = lower_32_bits(xd->route); in icm_tr_xdomain_tear_down()
1171 memcpy(&request.remote_uuid, xd->remote_uuid, sizeof(*xd->remote_uuid)); in icm_tr_xdomain_tear_down()
1185 static int icm_tr_disconnect_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_tr_disconnect_xdomain_paths() argument
1191 ret = icm_tr_xdomain_tear_down(tb, xd, 1); in icm_tr_disconnect_xdomain_paths()
1196 return icm_tr_xdomain_tear_down(tb, xd, 2); in icm_tr_disconnect_xdomain_paths()
1208 struct tb_xdomain *xd; in __icm_tr_device_connected() local
1258 xd = tb_xdomain_find_by_route(tb, route); in __icm_tr_device_connected()
1259 if (xd) { in __icm_tr_device_connected()
1260 remove_xdomain(xd); in __icm_tr_device_connected()
1261 tb_xdomain_put(xd); in __icm_tr_device_connected()
1331 struct tb_xdomain *xd; in icm_tr_xdomain_connected() local
1340 xd = tb_xdomain_find_by_uuid(tb, &pkg->remote_uuid); in icm_tr_xdomain_connected()
1341 if (xd) { in icm_tr_xdomain_connected()
1342 if (xd->route == route) { in icm_tr_xdomain_connected()
1343 update_xdomain(xd, route, 0); in icm_tr_xdomain_connected()
1344 tb_xdomain_put(xd); in icm_tr_xdomain_connected()
1348 remove_xdomain(xd); in icm_tr_xdomain_connected()
1349 tb_xdomain_put(xd); in icm_tr_xdomain_connected()
1353 xd = tb_xdomain_find_by_route(tb, route); in icm_tr_xdomain_connected()
1354 if (xd) { in icm_tr_xdomain_connected()
1355 remove_xdomain(xd); in icm_tr_xdomain_connected()
1356 tb_xdomain_put(xd); in icm_tr_xdomain_connected()
1385 struct tb_xdomain *xd; in icm_tr_xdomain_disconnected() local
1390 xd = tb_xdomain_find_by_route(tb, route); in icm_tr_xdomain_disconnected()
1391 if (xd) { in icm_tr_xdomain_disconnected()
1392 remove_xdomain(xd); in icm_tr_xdomain_disconnected()
1393 tb_xdomain_put(xd); in icm_tr_xdomain_disconnected()