Lines Matching +full:0 +full:xd

26 #define PCIE2CIO_CMD			0x30
35 #define PCIE2CIO_WRDATA 0x34
36 #define PCIE2CIO_RDDATA 0x38
38 #define PHY_PORT_CS1 0x37
73 * @max_boot_acl: Maximum number of preboot ACL entries (%0 if not supported)
136 #define EP_NAME_INTEL_VSS 0x10
148 #define INTEL_VSS_FLAGS_RTD3 BIT(0)
197 return link ? ((link - 1) ^ 0x01) + 1 : 0; in dual_link_from_link()
208 return depth ? route & ~(0xffULL << (depth - 1) * TB_ROUTE_SHIFT) : 0; in get_parent_route()
222 return 0; in pci2cio_wait_completion()
249 return 0; in pcie2cio_read()
392 return 0; in icm_fr_get_switch_index()
395 return index != 0xff ? index : 0; in icm_fr_get_switch_index()
417 sw = &switches[0]; in icm_fr_get_route()
433 for (j = 0; j < ARRAY_SIZE(sw->ports); j++) { in icm_fr_get_route()
451 nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_SAVE_DEVS, 0); in icm_fr_save_devices()
464 memset(&reply, 0, sizeof(reply)); in icm_fr_driver_ready()
473 return 0; in icm_fr_driver_ready()
482 memset(&request, 0, sizeof(request)); in icm_fr_approve_switch()
488 memset(&reply, 0, sizeof(reply)); in icm_fr_approve_switch()
500 return 0; in icm_fr_approve_switch()
509 memset(&request, 0, sizeof(request)); in icm_fr_add_switch_key()
516 memset(&reply, 0, sizeof(reply)); in icm_fr_add_switch_key()
527 return 0; in icm_fr_add_switch_key()
537 memset(&request, 0, sizeof(request)); in icm_fr_challenge_switch_key()
544 memset(&reply, 0, sizeof(reply)); in icm_fr_challenge_switch_key()
557 return 0; in icm_fr_challenge_switch_key()
560 static int icm_fr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_fr_approve_xdomain_paths() argument
568 memset(&request, 0, sizeof(request)); in icm_fr_approve_xdomain_paths()
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()
578 memset(&reply, 0, sizeof(reply)); in icm_fr_approve_xdomain_paths()
587 return 0; 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()
598 if (phy_port == 0) in icm_fr_disconnect_xdomain_paths()
606 return 0; 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()
1010 return pcie2cio_write(tb_priv(tb), TB_CFG_SWITCH, 0, 0x777, BIT(1)); in icm_tr_cio_reset()
1023 memset(&reply, 0, sizeof(reply)); in icm_tr_driver_ready()
1040 return 0; in icm_tr_driver_ready()
1049 memset(&request, 0, sizeof(request)); in icm_tr_approve_switch()
1056 memset(&reply, 0, sizeof(reply)); in icm_tr_approve_switch()
1067 return 0; in icm_tr_approve_switch()
1076 memset(&request, 0, sizeof(request)); in icm_tr_add_switch_key()
1084 memset(&reply, 0, sizeof(reply)); in icm_tr_add_switch_key()
1095 return 0; in icm_tr_add_switch_key()
1105 memset(&request, 0, sizeof(request)); in icm_tr_challenge_switch_key()
1113 memset(&reply, 0, sizeof(reply)); in icm_tr_challenge_switch_key()
1126 return 0; in icm_tr_challenge_switch_key()
1129 static int icm_tr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd, in icm_tr_approve_xdomain_paths() argument
1137 memset(&request, 0, sizeof(request)); in icm_tr_approve_xdomain_paths()
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()
1147 memset(&reply, 0, sizeof(reply)); in icm_tr_approve_xdomain_paths()
1156 return 0; 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
1166 memset(&request, 0, sizeof(request)); in icm_tr_xdomain_tear_down()
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()
1173 memset(&reply, 0, sizeof(reply)); in icm_tr_xdomain_tear_down()
1182 return 0; 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
1241 0, 0, 0, boot); in __icm_tr_device_connected()
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()
1376 add_xdomain(sw, route, &pkg->local_uuid, &pkg->remote_uuid, 0, 0); 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()
1452 if (cap > 0) { in icm_ar_is_supported()
1465 return pcie2cio_write(tb_priv(tb), TB_CFG_SWITCH, 0, 0x50, BIT(9)); in icm_ar_cio_reset()
1499 memset(&reply, 0, sizeof(reply)); in icm_ar_driver_ready()
1513 return 0; in icm_ar_driver_ready()
1525 memset(&reply, 0, sizeof(reply)); in icm_ar_get_route()
1535 return 0; in icm_ar_get_route()
1546 memset(&reply, 0, sizeof(reply)); in icm_ar_get_boot_acl()
1555 for (i = 0; i < nuuids; i++) { in icm_ar_get_boot_acl()
1558 uuid[0] = reply.acl[i].uuid_lo; in icm_ar_get_boot_acl()
1561 if (uuid[0] == 0xffffffff && uuid[1] == 0xffffffff) { in icm_ar_get_boot_acl()
1563 uuid[0] = 0; in icm_ar_get_boot_acl()
1564 uuid[1] = 0; in icm_ar_get_boot_acl()
1565 } else if (uuid[0] != 0 || uuid[1] != 0) { in icm_ar_get_boot_acl()
1567 uuid[2] = 0xffffffff; in icm_ar_get_boot_acl()
1568 uuid[3] = 0xffffffff; in icm_ar_get_boot_acl()
1587 for (i = 0; i < nuuids; i++) { in icm_ar_set_boot_acl()
1595 request.acl[i].uuid_lo = 0xffffffff; in icm_ar_set_boot_acl()
1596 request.acl[i].uuid_hi = 0xffffffff; in icm_ar_set_boot_acl()
1599 if (uuid[2] != 0xffffffff || uuid[3] != 0xffffffff) in icm_ar_set_boot_acl()
1602 request.acl[i].uuid_lo = uuid[0]; in icm_ar_set_boot_acl()
1607 memset(&reply, 0, sizeof(reply)); in icm_ar_set_boot_acl()
1616 return 0; in icm_ar_set_boot_acl()
1629 memset(&reply, 0, sizeof(reply)); in icm_icl_driver_ready()
1643 return 0; in icm_icl_driver_ready()
1651 pci_read_config_dword(nhi->pdev, VS_CAP_10, &uuid[0]); in icm_icl_set_uuid()
1653 uuid[2] = 0xffffffff; in icm_icl_set_uuid()
1654 uuid[3] = 0xffffffff; in icm_icl_set_uuid()
1670 tb_dbg(tb, "ICM rtd3 veto=0x%08x\n", pkg->veto_reason); in icm_icl_rtd3_veto()
1779 res = tb_cfg_read_raw(tb->ctl, &tmp, 0, 0, TB_CFG_SWITCH, in __icm_driver_ready()
1780 0, 1, 100); in __icm_driver_ready()
1782 return 0; in __icm_driver_ready()
1822 return 0; in icm_firmware_start()
1835 return 0; in icm_firmware_start()
1852 return 0; in icm_reset_phy_port()
1880 return 0; in icm_reset_phy_port()
1933 nhi_mailbox_cmd(nhi, NHI_MAILBOX_ALLOW_ALL_DEVS, 0); in icm_firmware_init()
1937 if (ret < 0) in icm_firmware_init()
1949 ret = icm_reset_phy_port(tb, 0); in icm_firmware_init()
1956 return 0; in icm_firmware_init()
1972 return 0; in icm_driver_ready()
1985 tb->nboot_acl = 0; in icm_driver_ready()
1990 return 0; in icm_driver_ready()
2000 nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_DRV_UNLOADS, 0); in icm_suspend()
2001 return 0; in icm_suspend()
2031 return 0; in complete_rpm()
2117 nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_DRV_UNLOADS, 0); in icm_runtime_suspend()
2118 return 0; in icm_runtime_suspend()
2125 return 0; in icm_runtime_suspend_switch()
2136 return 0; in icm_runtime_resume_switch()
2146 return 0; in icm_runtime_resume()
2155 tb->root_switch = tb_switch_alloc_safe_mode(tb, &tb->dev, 0); in icm_start()
2157 tb->root_switch = tb_switch_alloc(tb, &tb->dev, 0); in icm_start()
2183 nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_DRV_UNLOADS, 0); in icm_stop()
2190 return nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_DISCONNECT_PCIE_PATHS, 0); in icm_disconnect_pcie_paths()
2253 return 0; in icm_usb4_switch_nvm_authenticate()
2285 memset(&request, 0, sizeof(request)); in icm_usb4_switch_op()
2301 memset(&reply, 0, sizeof(reply)); in icm_usb4_switch_op()
2319 return 0; in icm_usb4_switch_op()
2328 int ret = 0; in icm_usb4_switch_nvm_authenticate_status()
2345 *status = 0; in icm_usb4_switch_nvm_authenticate_status()