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
387 ret = fn_set(tc->ntb, bits); in tool_fn_write()
392 ret = fn_clear(tc->ntb, bits); in tool_fn_write()
408 struct tool_ctx *tc = filep->private_data; in tool_port_read() local
412 pos = scnprintf(buf, sizeof(buf), "%d\n", ntb_port_number(tc->ntb)); in tool_port_read()
425 struct tool_ctx *tc = peer->tc; in tool_peer_port_read() local
430 ntb_peer_port_number(tc->ntb, peer->pidx)); in tool_peer_port_read()
439 static int tool_init_peers(struct tool_ctx *tc) in tool_init_peers() argument
443 tc->peer_cnt = ntb_peer_port_count(tc->ntb); in tool_init_peers()
444 tc->peers = devm_kcalloc(&tc->ntb->dev, tc->peer_cnt, in tool_init_peers()
445 sizeof(*tc->peers), GFP_KERNEL); in tool_init_peers()
446 if (tc->peers == NULL) in tool_init_peers()
449 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_peers()
450 tc->peers[pidx].pidx = pidx; in tool_init_peers()
451 tc->peers[pidx].tc = tc; in tool_init_peers()
465 struct tool_ctx *tc = filep->private_data; in tool_link_write() local
474 ret = ntb_link_enable(tc->ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); in tool_link_write()
476 ret = ntb_link_disable(tc->ntb); in tool_link_write()
492 struct tool_ctx *tc = peer->tc; in tool_peer_link_read() local
495 if (ntb_link_is_up(tc->ntb, NULL, NULL) & BIT(peer->pidx)) in tool_peer_link_read()
514 struct tool_ctx *tc = peer->tc; in tool_peer_link_event_write() local
525 if (wait_event_interruptible(tc->link_wq, in tool_peer_link_event_write()
526 !!(ntb_link_is_up(tc->ntb, NULL, NULL) & link_msk) == val)) in tool_peer_link_event_write()
569 static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_mw() argument
573 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_setup_mw()
580 ret = ntb_mw_get_align(tc->ntb, pidx, widx, &addr_align, in tool_setup_mw()
588 inmw->mm_base = dma_alloc_coherent(&tc->ntb->pdev->dev, inmw->size, in tool_setup_mw()
598 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
604 tc->peers[pidx].dbgfs_dir, inmw, in tool_setup_mw()
610 dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, inmw->mm_base, in tool_setup_mw()
619 static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx) in tool_free_mw() argument
621 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_free_mw()
626 ntb_mw_clear_trans(tc->ntb, pidx, widx); in tool_free_mw()
627 dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, in tool_free_mw()
654 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
665 ntb_peer_port_number(inmw->tc->ntb, inmw->pidx), in tool_mw_trans_read()
710 tool_free_mw(inmw->tc, inmw->pidx, inmw->widx); in tool_mw_trans_write()
712 ret = tool_setup_mw(inmw->tc, inmw->pidx, inmw->widx, val); in tool_mw_trans_write()
804 static int tool_setup_peer_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_peer_mw() argument
807 struct tool_mw *outmw = &tc->outmws[widx]; in tool_setup_peer_mw()
816 ret = ntb_peer_mw_get_addr(tc->ntb, widx, &map_base, &map_size); in tool_setup_peer_mw()
820 ret = ntb_peer_mw_set_trans(tc->ntb, pidx, widx, req_addr, req_size); in tool_setup_peer_mw()
836 tc->peers[pidx].dbgfs_dir, outmw, in tool_setup_peer_mw()
842 ntb_peer_mw_clear_trans(tc->ntb, pidx, widx); in tool_setup_peer_mw()
847 static void tool_free_peer_mw(struct tool_ctx *tc, int widx) in tool_free_peer_mw() argument
849 struct tool_mw *outmw = &tc->outmws[widx]; in tool_free_peer_mw()
854 iounmap(tc->outmws[widx].io_base); in tool_free_peer_mw()
855 ntb_peer_mw_clear_trans(tc->ntb, outmw->pidx, widx); in tool_free_peer_mw()
877 ret = ntb_peer_mw_get_addr(outmw->tc->ntb, outmw->widx, in tool_peer_mw_trans_read()
894 ntb_peer_port_number(outmw->tc->ntb, outmw->pidx), in tool_peer_mw_trans_read()
943 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
945 ret = tool_setup_peer_mw(outmw->tc, outmw_wrap->pidx, in tool_peer_mw_trans_write()
958 static int tool_init_mws(struct tool_ctx *tc) in tool_init_mws() argument
963 tc->outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
964 tc->outmws = devm_kcalloc(&tc->ntb->dev, tc->outmw_cnt, in tool_init_mws()
965 sizeof(*tc->outmws), GFP_KERNEL); in tool_init_mws()
966 if (tc->outmws == NULL) in tool_init_mws()
969 for (widx = 0; widx < tc->outmw_cnt; widx++) { in tool_init_mws()
970 tc->outmws[widx].widx = widx; in tool_init_mws()
971 tc->outmws[widx].pidx = -1; in tool_init_mws()
972 tc->outmws[widx].tc = tc; in tool_init_mws()
976 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_mws()
977 tc->peers[pidx].inmw_cnt = ntb_mw_count(tc->ntb, pidx); in tool_init_mws()
978 tc->peers[pidx].inmws = in tool_init_mws()
979 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].inmw_cnt, in tool_init_mws()
980 sizeof(*tc->peers[pidx].inmws), GFP_KERNEL); in tool_init_mws()
981 if (tc->peers[pidx].inmws == NULL) in tool_init_mws()
984 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_init_mws()
985 tc->peers[pidx].inmws[widx].widx = widx; in tool_init_mws()
986 tc->peers[pidx].inmws[widx].pidx = pidx; in tool_init_mws()
987 tc->peers[pidx].inmws[widx].tc = tc; in tool_init_mws()
990 tc->peers[pidx].outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
991 tc->peers[pidx].outmws = in tool_init_mws()
992 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmw_cnt, in tool_init_mws()
993 sizeof(*tc->peers[pidx].outmws), GFP_KERNEL); in tool_init_mws()
994 if (tc->peers[pidx].outmws == NULL) in tool_init_mws()
997 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_init_mws()
998 tc->peers[pidx].outmws[widx].pidx = pidx; in tool_init_mws()
999 tc->peers[pidx].outmws[widx].mw = &tc->outmws[widx]; in tool_init_mws()
1006 static void tool_clear_mws(struct tool_ctx *tc) in tool_clear_mws() argument
1011 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1012 tool_free_peer_mw(tc, widx); in tool_clear_mws()
1015 for (pidx = 0; pidx < tc->peer_cnt; pidx++) in tool_clear_mws()
1016 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) in tool_clear_mws()
1017 tool_free_mw(tc, pidx, widx); in tool_clear_mws()
1028 struct tool_ctx *tc = filep->private_data; in tool_db_read() local
1030 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read); in tool_db_read()
1036 struct tool_ctx *tc = filep->private_data; in tool_db_write() local
1038 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set, in tool_db_write()
1039 tc->ntb->ops->db_clear); in tool_db_write()
1049 struct tool_ctx *tc = filep->private_data; in tool_db_valid_mask_read() local
1051 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_valid_mask); in tool_db_valid_mask_read()
1061 struct tool_ctx *tc = filep->private_data; in tool_db_mask_read() local
1063 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read_mask); in tool_db_mask_read()
1069 struct tool_ctx *tc = filep->private_data; in tool_db_mask_write() local
1071 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set_mask, in tool_db_mask_write()
1072 tc->ntb->ops->db_clear_mask); in tool_db_mask_write()
1082 struct tool_ctx *tc = filep->private_data; in tool_peer_db_read() local
1084 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->peer_db_read); in tool_peer_db_read()
1090 struct tool_ctx *tc = filep->private_data; in tool_peer_db_write() local
1092 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->peer_db_set, in tool_peer_db_write()
1093 tc->ntb->ops->peer_db_clear); in tool_peer_db_write()
1103 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_read() local
1105 return tool_fn_read(tc, ubuf, size, offp, in tool_peer_db_mask_read()
1106 tc->ntb->ops->peer_db_read_mask); in tool_peer_db_mask_read()
1113 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_write() local
1115 return tool_fn_write(tc, ubuf, size, offp, in tool_peer_db_mask_write()
1116 tc->ntb->ops->peer_db_set_mask, in tool_peer_db_mask_write()
1117 tc->ntb->ops->peer_db_clear_mask); in tool_peer_db_mask_write()
1128 struct tool_ctx *tc = filep->private_data; in tool_db_event_write() local
1136 if (wait_event_interruptible(tc->db_wq, ntb_db_read(tc->ntb) == val)) in tool_db_event_write()
1158 if (!spad->tc->ntb->ops->spad_read) in tool_spad_read()
1162 ntb_spad_read(spad->tc->ntb, spad->sidx)); in tool_spad_read()
1174 if (!spad->tc->ntb->ops->spad_write) { in tool_spad_write()
1175 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_spad_write()
1183 ret = ntb_spad_write(spad->tc->ntb, spad->sidx, val); in tool_spad_write()
1199 if (!spad->tc->ntb->ops->peer_spad_read) in tool_peer_spad_read()
1203 ntb_peer_spad_read(spad->tc->ntb, spad->pidx, spad->sidx)); in tool_peer_spad_read()
1215 if (!spad->tc->ntb->ops->peer_spad_write) { in tool_peer_spad_write()
1216 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_peer_spad_write()
1224 ret = ntb_peer_spad_write(spad->tc->ntb, spad->pidx, spad->sidx, val); in tool_peer_spad_write()
1233 static int tool_init_spads(struct tool_ctx *tc) in tool_init_spads() argument
1238 tc->inspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1239 tc->inspads = devm_kcalloc(&tc->ntb->dev, tc->inspad_cnt, in tool_init_spads()
1240 sizeof(*tc->inspads), GFP_KERNEL); in tool_init_spads()
1241 if (tc->inspads == NULL) in tool_init_spads()
1244 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_init_spads()
1245 tc->inspads[sidx].sidx = sidx; in tool_init_spads()
1246 tc->inspads[sidx].pidx = -1; in tool_init_spads()
1247 tc->inspads[sidx].tc = tc; in tool_init_spads()
1251 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_spads()
1252 tc->peers[pidx].outspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1253 tc->peers[pidx].outspads = in tool_init_spads()
1254 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outspad_cnt, in tool_init_spads()
1255 sizeof(*tc->peers[pidx].outspads), GFP_KERNEL); in tool_init_spads()
1256 if (tc->peers[pidx].outspads == NULL) in tool_init_spads()
1259 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_init_spads()
1260 tc->peers[pidx].outspads[sidx].sidx = sidx; in tool_init_spads()
1261 tc->peers[pidx].outspads[sidx].pidx = pidx; in tool_init_spads()
1262 tc->peers[pidx].outspads[sidx].tc = tc; in tool_init_spads()
1283 data = ntb_msg_read(msg->tc->ntb, &pidx, msg->midx); in tool_inmsg_read()
1306 ret = ntb_peer_msg_write(msg->tc->ntb, msg->pidx, msg->midx, val); in tool_outmsg_write()
1318 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_read() local
1320 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_read_sts); in tool_msg_sts_read()
1326 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_write() local
1328 return tool_fn_write(tc, ubuf, size, offp, NULL, in tool_msg_sts_write()
1329 tc->ntb->ops->msg_clear_sts); in tool_msg_sts_write()
1339 struct tool_ctx *tc = filep->private_data; in tool_msg_inbits_read() local
1341 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_inbits); in tool_msg_inbits_read()
1351 struct tool_ctx *tc = filep->private_data; in tool_msg_outbits_read() local
1353 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_outbits); in tool_msg_outbits_read()
1363 struct tool_ctx *tc = filep->private_data; in tool_msg_mask_write() local
1365 return tool_fn_write(tc, ubuf, size, offp, in tool_msg_mask_write()
1366 tc->ntb->ops->msg_set_mask, in tool_msg_mask_write()
1367 tc->ntb->ops->msg_clear_mask); in tool_msg_mask_write()
1378 struct tool_ctx *tc = filep->private_data; in tool_msg_event_write() local
1386 if (wait_event_interruptible(tc->msg_wq, in tool_msg_event_write()
1387 ntb_msg_read_sts(tc->ntb) == val)) in tool_msg_event_write()
1397 static int tool_init_msgs(struct tool_ctx *tc) in tool_init_msgs() argument
1402 tc->inmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1403 tc->inmsgs = devm_kcalloc(&tc->ntb->dev, tc->inmsg_cnt, in tool_init_msgs()
1404 sizeof(*tc->inmsgs), GFP_KERNEL); in tool_init_msgs()
1405 if (tc->inmsgs == NULL) in tool_init_msgs()
1408 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_init_msgs()
1409 tc->inmsgs[midx].midx = midx; in tool_init_msgs()
1410 tc->inmsgs[midx].pidx = -1; in tool_init_msgs()
1411 tc->inmsgs[midx].tc = tc; in tool_init_msgs()
1415 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_msgs()
1416 tc->peers[pidx].outmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1417 tc->peers[pidx].outmsgs = in tool_init_msgs()
1418 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmsg_cnt, in tool_init_msgs()
1419 sizeof(*tc->peers[pidx].outmsgs), GFP_KERNEL); in tool_init_msgs()
1420 if (tc->peers[pidx].outmsgs == NULL) in tool_init_msgs()
1423 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_init_msgs()
1424 tc->peers[pidx].outmsgs[midx].midx = midx; in tool_init_msgs()
1425 tc->peers[pidx].outmsgs[midx].pidx = pidx; in tool_init_msgs()
1426 tc->peers[pidx].outmsgs[midx].tc = tc; in tool_init_msgs()
1440 struct tool_ctx *tc; in tool_create_data() local
1442 tc = devm_kzalloc(&ntb->dev, sizeof(*tc), GFP_KERNEL); in tool_create_data()
1443 if (tc == NULL) in tool_create_data()
1446 tc->ntb = ntb; in tool_create_data()
1447 init_waitqueue_head(&tc->link_wq); in tool_create_data()
1448 init_waitqueue_head(&tc->db_wq); in tool_create_data()
1449 init_waitqueue_head(&tc->msg_wq); in tool_create_data()
1457 return tc; in tool_create_data()
1460 static void tool_clear_data(struct tool_ctx *tc) in tool_clear_data() argument
1462 wake_up(&tc->link_wq); in tool_clear_data()
1463 wake_up(&tc->db_wq); in tool_clear_data()
1464 wake_up(&tc->msg_wq); in tool_clear_data()
1467 static int tool_init_ntb(struct tool_ctx *tc) in tool_init_ntb() argument
1469 return ntb_set_ctx(tc->ntb, tc, &tool_ops); in tool_init_ntb()
1472 static void tool_clear_ntb(struct tool_ctx *tc) in tool_clear_ntb() argument
1474 ntb_clear_ctx(tc->ntb); in tool_clear_ntb()
1475 ntb_link_disable(tc->ntb); in tool_clear_ntb()
1478 static void tool_setup_dbgfs(struct tool_ctx *tc) in tool_setup_dbgfs() argument
1485 tc->dbgfs_dir = NULL; in tool_setup_dbgfs()
1489 tc->dbgfs_dir = debugfs_create_dir(dev_name(&tc->ntb->dev), in tool_setup_dbgfs()
1492 debugfs_create_file("port", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1493 tc, &tool_port_fops); in tool_setup_dbgfs()
1495 debugfs_create_file("link", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1496 tc, &tool_link_fops); in tool_setup_dbgfs()
1498 debugfs_create_file("db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1499 tc, &tool_db_fops); in tool_setup_dbgfs()
1501 debugfs_create_file("db_valid_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1502 tc, &tool_db_valid_mask_fops); in tool_setup_dbgfs()
1504 debugfs_create_file("db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1505 tc, &tool_db_mask_fops); in tool_setup_dbgfs()
1507 debugfs_create_file("db_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1508 tc, &tool_db_event_fops); in tool_setup_dbgfs()
1510 debugfs_create_file("peer_db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1511 tc, &tool_peer_db_fops); in tool_setup_dbgfs()
1513 debugfs_create_file("peer_db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1514 tc, &tool_peer_db_mask_fops); in tool_setup_dbgfs()
1516 if (tc->inspad_cnt != 0) { in tool_setup_dbgfs()
1517 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_setup_dbgfs()
1520 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1521 &tc->inspads[sidx], &tool_spad_fops); in tool_setup_dbgfs()
1525 if (tc->inmsg_cnt != 0) { in tool_setup_dbgfs()
1526 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_setup_dbgfs()
1528 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1529 &tc->inmsgs[midx], &tool_inmsg_fops); in tool_setup_dbgfs()
1532 debugfs_create_file("msg_sts", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1533 tc, &tool_msg_sts_fops); in tool_setup_dbgfs()
1535 debugfs_create_file("msg_inbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1536 tc, &tool_msg_inbits_fops); in tool_setup_dbgfs()
1538 debugfs_create_file("msg_outbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1539 tc, &tool_msg_outbits_fops); in tool_setup_dbgfs()
1541 debugfs_create_file("msg_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1542 tc, &tool_msg_mask_fops); in tool_setup_dbgfs()
1544 debugfs_create_file("msg_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1545 tc, &tool_msg_event_fops); in tool_setup_dbgfs()
1548 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_setup_dbgfs()
1550 tc->peers[pidx].dbgfs_dir = in tool_setup_dbgfs()
1551 debugfs_create_dir(buf, tc->dbgfs_dir); in tool_setup_dbgfs()
1554 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1555 &tc->peers[pidx], &tool_peer_port_fops); in tool_setup_dbgfs()
1558 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1559 &tc->peers[pidx], &tool_peer_link_fops); in tool_setup_dbgfs()
1562 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1563 &tc->peers[pidx], &tool_peer_link_event_fops); in tool_setup_dbgfs()
1565 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1568 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1569 &tc->peers[pidx].inmws[widx], in tool_setup_dbgfs()
1573 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_setup_dbgfs()
1576 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1577 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()
1581 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_setup_dbgfs()
1585 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1586 &tc->peers[pidx].outspads[sidx], in tool_setup_dbgfs()
1590 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_setup_dbgfs()
1593 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1594 &tc->peers[pidx].outmsgs[midx], in tool_setup_dbgfs()
1600 static void tool_clear_dbgfs(struct tool_ctx *tc) in tool_clear_dbgfs() argument
1602 debugfs_remove_recursive(tc->dbgfs_dir); in tool_clear_dbgfs()
1607 struct tool_ctx *tc; in tool_probe() local
1610 tc = tool_create_data(ntb); in tool_probe()
1611 if (IS_ERR(tc)) in tool_probe()
1612 return PTR_ERR(tc); in tool_probe()
1614 ret = tool_init_peers(tc); in tool_probe()
1618 ret = tool_init_mws(tc); in tool_probe()
1622 ret = tool_init_spads(tc); in tool_probe()
1626 ret = tool_init_msgs(tc); in tool_probe()
1630 ret = tool_init_ntb(tc); in tool_probe()
1634 tool_setup_dbgfs(tc); in tool_probe()
1639 tool_clear_mws(tc); in tool_probe()
1642 tool_clear_data(tc); in tool_probe()
1649 struct tool_ctx *tc = ntb->ctx; in tool_remove() local
1651 tool_clear_dbgfs(tc); in tool_remove()
1653 tool_clear_ntb(tc); in tool_remove()
1655 tool_clear_mws(tc); in tool_remove()
1657 tool_clear_data(tc); in tool_remove()