Lines Matching refs:tc

208 	struct tool_ctx *tc;  member
233 struct tool_ctx *tc; member
239 struct tool_ctx *tc; member
244 struct tool_ctx *tc; member
291 struct tool_ctx *tc = ctx; in tool_link_event() local
296 up = ntb_link_is_up(tc->ntb, &speed, &width); in tool_link_event()
298 dev_dbg(&tc->ntb->dev, "link is %s speed %d width %d\n", in tool_link_event()
301 wake_up(&tc->link_wq); in tool_link_event()
306 struct tool_ctx *tc = ctx; in tool_db_event() local
309 db_mask = ntb_db_vector_mask(tc->ntb, vec); in tool_db_event()
310 db_bits = ntb_db_read(tc->ntb); in tool_db_event()
312 dev_dbg(&tc->ntb->dev, "doorbell vec %d mask %#llx bits %#llx\n", in tool_db_event()
315 wake_up(&tc->db_wq); in tool_db_event()
320 struct tool_ctx *tc = ctx; in tool_msg_event() local
323 msg_sts = ntb_msg_read_sts(tc->ntb); in tool_msg_event()
325 dev_dbg(&tc->ntb->dev, "message bits %#llx\n", msg_sts); in tool_msg_event()
327 wake_up(&tc->msg_wq); in tool_msg_event()
341 static ssize_t tool_fn_read(struct tool_ctx *tc, char __user *ubuf, in tool_fn_read() argument
354 pos = scnprintf(buf, buf_size, "%#llx\n", fn_read(tc->ntb)); in tool_fn_read()
359 static ssize_t tool_fn_write(struct tool_ctx *tc, in tool_fn_write() argument
394 ret = fn_set(tc->ntb, bits); in tool_fn_write()
399 ret = fn_clear(tc->ntb, bits); in tool_fn_write()
415 struct tool_ctx *tc = filep->private_data; in tool_port_read() local
419 pos = scnprintf(buf, sizeof(buf), "%d\n", ntb_port_number(tc->ntb)); in tool_port_read()
432 struct tool_ctx *tc = peer->tc; in tool_peer_port_read() local
437 ntb_peer_port_number(tc->ntb, peer->pidx)); in tool_peer_port_read()
446 static int tool_init_peers(struct tool_ctx *tc) in tool_init_peers() argument
450 tc->peer_cnt = ntb_peer_port_count(tc->ntb); in tool_init_peers()
451 tc->peers = devm_kcalloc(&tc->ntb->dev, tc->peer_cnt, in tool_init_peers()
452 sizeof(*tc->peers), GFP_KERNEL); in tool_init_peers()
453 if (tc->peers == NULL) in tool_init_peers()
456 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_peers()
457 tc->peers[pidx].pidx = pidx; in tool_init_peers()
458 tc->peers[pidx].tc = tc; in tool_init_peers()
472 struct tool_ctx *tc = filep->private_data; in tool_link_write() local
481 ret = ntb_link_enable(tc->ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); in tool_link_write()
483 ret = ntb_link_disable(tc->ntb); in tool_link_write()
499 struct tool_ctx *tc = peer->tc; in tool_peer_link_read() local
502 if (ntb_link_is_up(tc->ntb, NULL, NULL) & BIT(peer->pidx)) in tool_peer_link_read()
521 struct tool_ctx *tc = peer->tc; in tool_peer_link_event_write() local
532 if (wait_event_interruptible(tc->link_wq, in tool_peer_link_event_write()
533 !!(ntb_link_is_up(tc->ntb, NULL, NULL) & link_msk) == val)) in tool_peer_link_event_write()
576 static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_mw() argument
580 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_setup_mw()
587 ret = ntb_mw_get_align(tc->ntb, pidx, widx, &addr_align, in tool_setup_mw()
595 inmw->mm_base = dma_alloc_coherent(&tc->ntb->pdev->dev, inmw->size, in tool_setup_mw()
605 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
611 tc->peers[pidx].dbgfs_dir, inmw, in tool_setup_mw()
617 dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, inmw->mm_base, in tool_setup_mw()
626 static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx) in tool_free_mw() argument
628 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_free_mw()
633 ntb_mw_clear_trans(tc->ntb, pidx, widx); in tool_free_mw()
634 dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, in tool_free_mw()
661 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
672 ntb_peer_port_number(inmw->tc->ntb, inmw->pidx), in tool_mw_trans_read()
717 tool_free_mw(inmw->tc, inmw->pidx, inmw->widx); in tool_mw_trans_write()
719 ret = tool_setup_mw(inmw->tc, inmw->pidx, inmw->widx, val); in tool_mw_trans_write()
811 static int tool_setup_peer_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_peer_mw() argument
814 struct tool_mw *outmw = &tc->outmws[widx]; in tool_setup_peer_mw()
823 ret = ntb_peer_mw_get_addr(tc->ntb, widx, &map_base, &map_size); in tool_setup_peer_mw()
827 ret = ntb_peer_mw_set_trans(tc->ntb, pidx, widx, req_addr, req_size); in tool_setup_peer_mw()
843 tc->peers[pidx].dbgfs_dir, outmw, in tool_setup_peer_mw()
849 ntb_peer_mw_clear_trans(tc->ntb, pidx, widx); in tool_setup_peer_mw()
854 static void tool_free_peer_mw(struct tool_ctx *tc, int widx) in tool_free_peer_mw() argument
856 struct tool_mw *outmw = &tc->outmws[widx]; in tool_free_peer_mw()
861 iounmap(tc->outmws[widx].io_base); in tool_free_peer_mw()
862 ntb_peer_mw_clear_trans(tc->ntb, outmw->pidx, widx); in tool_free_peer_mw()
884 ret = ntb_peer_mw_get_addr(outmw->tc->ntb, outmw->widx, in tool_peer_mw_trans_read()
901 ntb_peer_port_number(outmw->tc->ntb, outmw->pidx), in tool_peer_mw_trans_read()
950 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
952 ret = tool_setup_peer_mw(outmw->tc, outmw_wrap->pidx, in tool_peer_mw_trans_write()
965 static int tool_init_mws(struct tool_ctx *tc) in tool_init_mws() argument
970 tc->outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
971 tc->outmws = devm_kcalloc(&tc->ntb->dev, tc->outmw_cnt, in tool_init_mws()
972 sizeof(*tc->outmws), GFP_KERNEL); in tool_init_mws()
973 if (tc->outmws == NULL) in tool_init_mws()
976 for (widx = 0; widx < tc->outmw_cnt; widx++) { in tool_init_mws()
977 tc->outmws[widx].widx = widx; in tool_init_mws()
978 tc->outmws[widx].pidx = -1; in tool_init_mws()
979 tc->outmws[widx].tc = tc; in tool_init_mws()
983 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_mws()
984 tc->peers[pidx].inmw_cnt = ntb_mw_count(tc->ntb, pidx); in tool_init_mws()
985 tc->peers[pidx].inmws = in tool_init_mws()
986 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].inmw_cnt, in tool_init_mws()
987 sizeof(*tc->peers[pidx].inmws), GFP_KERNEL); in tool_init_mws()
988 if (tc->peers[pidx].inmws == NULL) in tool_init_mws()
991 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_init_mws()
992 tc->peers[pidx].inmws[widx].widx = widx; in tool_init_mws()
993 tc->peers[pidx].inmws[widx].pidx = pidx; in tool_init_mws()
994 tc->peers[pidx].inmws[widx].tc = tc; in tool_init_mws()
997 tc->peers[pidx].outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
998 tc->peers[pidx].outmws = in tool_init_mws()
999 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmw_cnt, in tool_init_mws()
1000 sizeof(*tc->peers[pidx].outmws), GFP_KERNEL); in tool_init_mws()
1002 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_init_mws()
1003 tc->peers[pidx].outmws[widx].pidx = pidx; in tool_init_mws()
1004 tc->peers[pidx].outmws[widx].mw = &tc->outmws[widx]; in tool_init_mws()
1011 static void tool_clear_mws(struct tool_ctx *tc) in tool_clear_mws() argument
1016 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1017 tool_free_peer_mw(tc, widx); in tool_clear_mws()
1020 for (pidx = 0; pidx < tc->peer_cnt; pidx++) in tool_clear_mws()
1021 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) in tool_clear_mws()
1022 tool_free_mw(tc, pidx, widx); in tool_clear_mws()
1033 struct tool_ctx *tc = filep->private_data; in tool_db_read() local
1035 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read); in tool_db_read()
1041 struct tool_ctx *tc = filep->private_data; in tool_db_write() local
1043 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set, in tool_db_write()
1044 tc->ntb->ops->db_clear); in tool_db_write()
1054 struct tool_ctx *tc = filep->private_data; in tool_db_valid_mask_read() local
1056 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_valid_mask); in tool_db_valid_mask_read()
1066 struct tool_ctx *tc = filep->private_data; in tool_db_mask_read() local
1068 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read_mask); in tool_db_mask_read()
1074 struct tool_ctx *tc = filep->private_data; in tool_db_mask_write() local
1076 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set_mask, in tool_db_mask_write()
1077 tc->ntb->ops->db_clear_mask); in tool_db_mask_write()
1087 struct tool_ctx *tc = filep->private_data; in tool_peer_db_read() local
1089 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->peer_db_read); in tool_peer_db_read()
1095 struct tool_ctx *tc = filep->private_data; in tool_peer_db_write() local
1097 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->peer_db_set, in tool_peer_db_write()
1098 tc->ntb->ops->peer_db_clear); in tool_peer_db_write()
1108 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_read() local
1110 return tool_fn_read(tc, ubuf, size, offp, in tool_peer_db_mask_read()
1111 tc->ntb->ops->peer_db_read_mask); in tool_peer_db_mask_read()
1118 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_write() local
1120 return tool_fn_write(tc, ubuf, size, offp, in tool_peer_db_mask_write()
1121 tc->ntb->ops->peer_db_set_mask, in tool_peer_db_mask_write()
1122 tc->ntb->ops->peer_db_clear_mask); in tool_peer_db_mask_write()
1133 struct tool_ctx *tc = filep->private_data; in tool_db_event_write() local
1141 if (wait_event_interruptible(tc->db_wq, ntb_db_read(tc->ntb) == val)) in tool_db_event_write()
1163 if (!spad->tc->ntb->ops->spad_read) in tool_spad_read()
1167 ntb_spad_read(spad->tc->ntb, spad->sidx)); in tool_spad_read()
1179 if (!spad->tc->ntb->ops->spad_write) { in tool_spad_write()
1180 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_spad_write()
1188 ret = ntb_spad_write(spad->tc->ntb, spad->sidx, val); in tool_spad_write()
1204 if (!spad->tc->ntb->ops->peer_spad_read) in tool_peer_spad_read()
1208 ntb_peer_spad_read(spad->tc->ntb, spad->pidx, spad->sidx)); in tool_peer_spad_read()
1220 if (!spad->tc->ntb->ops->peer_spad_write) { in tool_peer_spad_write()
1221 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_peer_spad_write()
1229 ret = ntb_peer_spad_write(spad->tc->ntb, spad->pidx, spad->sidx, val); in tool_peer_spad_write()
1238 static int tool_init_spads(struct tool_ctx *tc) in tool_init_spads() argument
1243 tc->inspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1244 tc->inspads = devm_kcalloc(&tc->ntb->dev, tc->inspad_cnt, in tool_init_spads()
1245 sizeof(*tc->inspads), GFP_KERNEL); in tool_init_spads()
1246 if (tc->inspads == NULL) in tool_init_spads()
1249 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_init_spads()
1250 tc->inspads[sidx].sidx = sidx; in tool_init_spads()
1251 tc->inspads[sidx].pidx = -1; in tool_init_spads()
1252 tc->inspads[sidx].tc = tc; in tool_init_spads()
1256 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_spads()
1257 tc->peers[pidx].outspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1258 tc->peers[pidx].outspads = in tool_init_spads()
1259 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outspad_cnt, in tool_init_spads()
1260 sizeof(*tc->peers[pidx].outspads), GFP_KERNEL); in tool_init_spads()
1261 if (tc->peers[pidx].outspads == NULL) in tool_init_spads()
1264 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_init_spads()
1265 tc->peers[pidx].outspads[sidx].sidx = sidx; in tool_init_spads()
1266 tc->peers[pidx].outspads[sidx].pidx = pidx; in tool_init_spads()
1267 tc->peers[pidx].outspads[sidx].tc = tc; in tool_init_spads()
1288 data = ntb_msg_read(msg->tc->ntb, &pidx, msg->midx); in tool_inmsg_read()
1311 ret = ntb_peer_msg_write(msg->tc->ntb, msg->pidx, msg->midx, val); in tool_outmsg_write()
1323 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_read() local
1325 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_read_sts); in tool_msg_sts_read()
1331 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_write() local
1333 return tool_fn_write(tc, ubuf, size, offp, NULL, in tool_msg_sts_write()
1334 tc->ntb->ops->msg_clear_sts); in tool_msg_sts_write()
1344 struct tool_ctx *tc = filep->private_data; in tool_msg_inbits_read() local
1346 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_inbits); in tool_msg_inbits_read()
1356 struct tool_ctx *tc = filep->private_data; in tool_msg_outbits_read() local
1358 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_outbits); in tool_msg_outbits_read()
1368 struct tool_ctx *tc = filep->private_data; in tool_msg_mask_write() local
1370 return tool_fn_write(tc, ubuf, size, offp, in tool_msg_mask_write()
1371 tc->ntb->ops->msg_set_mask, in tool_msg_mask_write()
1372 tc->ntb->ops->msg_clear_mask); in tool_msg_mask_write()
1383 struct tool_ctx *tc = filep->private_data; in tool_msg_event_write() local
1391 if (wait_event_interruptible(tc->msg_wq, in tool_msg_event_write()
1392 ntb_msg_read_sts(tc->ntb) == val)) in tool_msg_event_write()
1402 static int tool_init_msgs(struct tool_ctx *tc) in tool_init_msgs() argument
1407 tc->inmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1408 tc->inmsgs = devm_kcalloc(&tc->ntb->dev, tc->inmsg_cnt, in tool_init_msgs()
1409 sizeof(*tc->inmsgs), GFP_KERNEL); in tool_init_msgs()
1410 if (tc->inmsgs == NULL) in tool_init_msgs()
1413 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_init_msgs()
1414 tc->inmsgs[midx].midx = midx; in tool_init_msgs()
1415 tc->inmsgs[midx].pidx = -1; in tool_init_msgs()
1416 tc->inmsgs[midx].tc = tc; in tool_init_msgs()
1420 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_msgs()
1421 tc->peers[pidx].outmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1422 tc->peers[pidx].outmsgs = in tool_init_msgs()
1423 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmsg_cnt, in tool_init_msgs()
1424 sizeof(*tc->peers[pidx].outmsgs), GFP_KERNEL); in tool_init_msgs()
1425 if (tc->peers[pidx].outmsgs == NULL) in tool_init_msgs()
1428 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_init_msgs()
1429 tc->peers[pidx].outmsgs[midx].midx = midx; in tool_init_msgs()
1430 tc->peers[pidx].outmsgs[midx].pidx = pidx; in tool_init_msgs()
1431 tc->peers[pidx].outmsgs[midx].tc = tc; in tool_init_msgs()
1445 struct tool_ctx *tc; in tool_create_data() local
1447 tc = devm_kzalloc(&ntb->dev, sizeof(*tc), GFP_KERNEL); in tool_create_data()
1448 if (tc == NULL) in tool_create_data()
1451 tc->ntb = ntb; in tool_create_data()
1452 init_waitqueue_head(&tc->link_wq); in tool_create_data()
1453 init_waitqueue_head(&tc->db_wq); in tool_create_data()
1454 init_waitqueue_head(&tc->msg_wq); in tool_create_data()
1462 return tc; in tool_create_data()
1465 static void tool_clear_data(struct tool_ctx *tc) in tool_clear_data() argument
1467 wake_up(&tc->link_wq); in tool_clear_data()
1468 wake_up(&tc->db_wq); in tool_clear_data()
1469 wake_up(&tc->msg_wq); in tool_clear_data()
1472 static int tool_init_ntb(struct tool_ctx *tc) in tool_init_ntb() argument
1474 return ntb_set_ctx(tc->ntb, tc, &tool_ops); in tool_init_ntb()
1477 static void tool_clear_ntb(struct tool_ctx *tc) in tool_clear_ntb() argument
1479 ntb_clear_ctx(tc->ntb); in tool_clear_ntb()
1480 ntb_link_disable(tc->ntb); in tool_clear_ntb()
1483 static void tool_setup_dbgfs(struct tool_ctx *tc) in tool_setup_dbgfs() argument
1490 tc->dbgfs_dir = NULL; in tool_setup_dbgfs()
1494 tc->dbgfs_dir = debugfs_create_dir(dev_name(&tc->ntb->dev), in tool_setup_dbgfs()
1496 if (!tc->dbgfs_dir) in tool_setup_dbgfs()
1499 debugfs_create_file("port", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1500 tc, &tool_port_fops); in tool_setup_dbgfs()
1502 debugfs_create_file("link", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1503 tc, &tool_link_fops); in tool_setup_dbgfs()
1505 debugfs_create_file("db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1506 tc, &tool_db_fops); in tool_setup_dbgfs()
1508 debugfs_create_file("db_valid_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1509 tc, &tool_db_valid_mask_fops); in tool_setup_dbgfs()
1511 debugfs_create_file("db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1512 tc, &tool_db_mask_fops); in tool_setup_dbgfs()
1514 debugfs_create_file("db_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1515 tc, &tool_db_event_fops); in tool_setup_dbgfs()
1517 debugfs_create_file("peer_db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1518 tc, &tool_peer_db_fops); in tool_setup_dbgfs()
1520 debugfs_create_file("peer_db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1521 tc, &tool_peer_db_mask_fops); in tool_setup_dbgfs()
1523 if (tc->inspad_cnt != 0) { in tool_setup_dbgfs()
1524 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_setup_dbgfs()
1527 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1528 &tc->inspads[sidx], &tool_spad_fops); in tool_setup_dbgfs()
1532 if (tc->inmsg_cnt != 0) { in tool_setup_dbgfs()
1533 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_setup_dbgfs()
1535 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1536 &tc->inmsgs[midx], &tool_inmsg_fops); in tool_setup_dbgfs()
1539 debugfs_create_file("msg_sts", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1540 tc, &tool_msg_sts_fops); in tool_setup_dbgfs()
1542 debugfs_create_file("msg_inbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1543 tc, &tool_msg_inbits_fops); in tool_setup_dbgfs()
1545 debugfs_create_file("msg_outbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1546 tc, &tool_msg_outbits_fops); in tool_setup_dbgfs()
1548 debugfs_create_file("msg_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1549 tc, &tool_msg_mask_fops); in tool_setup_dbgfs()
1551 debugfs_create_file("msg_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1552 tc, &tool_msg_event_fops); in tool_setup_dbgfs()
1555 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_setup_dbgfs()
1557 tc->peers[pidx].dbgfs_dir = in tool_setup_dbgfs()
1558 debugfs_create_dir(buf, tc->dbgfs_dir); in tool_setup_dbgfs()
1561 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1562 &tc->peers[pidx], &tool_peer_port_fops); in tool_setup_dbgfs()
1565 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1566 &tc->peers[pidx], &tool_peer_link_fops); in tool_setup_dbgfs()
1569 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1570 &tc->peers[pidx], &tool_peer_link_event_fops); in tool_setup_dbgfs()
1572 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1575 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1576 &tc->peers[pidx].inmws[widx], in tool_setup_dbgfs()
1580 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_setup_dbgfs()
1583 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1584 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()
1588 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_setup_dbgfs()
1592 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1593 &tc->peers[pidx].outspads[sidx], in tool_setup_dbgfs()
1597 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_setup_dbgfs()
1600 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1601 &tc->peers[pidx].outmsgs[midx], in tool_setup_dbgfs()
1607 static void tool_clear_dbgfs(struct tool_ctx *tc) in tool_clear_dbgfs() argument
1609 debugfs_remove_recursive(tc->dbgfs_dir); in tool_clear_dbgfs()
1614 struct tool_ctx *tc; in tool_probe() local
1617 tc = tool_create_data(ntb); in tool_probe()
1618 if (IS_ERR(tc)) in tool_probe()
1619 return PTR_ERR(tc); in tool_probe()
1621 ret = tool_init_peers(tc); in tool_probe()
1625 ret = tool_init_mws(tc); in tool_probe()
1629 ret = tool_init_spads(tc); in tool_probe()
1633 ret = tool_init_msgs(tc); in tool_probe()
1637 ret = tool_init_ntb(tc); in tool_probe()
1641 tool_setup_dbgfs(tc); in tool_probe()
1646 tool_clear_mws(tc); in tool_probe()
1649 tool_clear_data(tc); in tool_probe()
1656 struct tool_ctx *tc = ntb->ctx; in tool_remove() local
1658 tool_clear_dbgfs(tc); in tool_remove()
1660 tool_clear_ntb(tc); in tool_remove()
1662 tool_clear_mws(tc); in tool_remove()
1664 tool_clear_data(tc); in tool_remove()