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
392 ret = fn_set(tc->ntb, bits); in tool_fn_write()
397 ret = fn_clear(tc->ntb, bits); in tool_fn_write()
413 struct tool_ctx *tc = filep->private_data; in tool_port_read() local
417 pos = scnprintf(buf, sizeof(buf), "%d\n", ntb_port_number(tc->ntb)); in tool_port_read()
430 struct tool_ctx *tc = peer->tc; in tool_peer_port_read() local
435 ntb_peer_port_number(tc->ntb, peer->pidx)); in tool_peer_port_read()
444 static int tool_init_peers(struct tool_ctx *tc) in tool_init_peers() argument
448 tc->peer_cnt = ntb_peer_port_count(tc->ntb); in tool_init_peers()
449 tc->peers = devm_kcalloc(&tc->ntb->dev, tc->peer_cnt, in tool_init_peers()
450 sizeof(*tc->peers), GFP_KERNEL); in tool_init_peers()
451 if (tc->peers == NULL) in tool_init_peers()
454 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_peers()
455 tc->peers[pidx].pidx = pidx; in tool_init_peers()
456 tc->peers[pidx].tc = tc; in tool_init_peers()
470 struct tool_ctx *tc = filep->private_data; in tool_link_write() local
479 ret = ntb_link_enable(tc->ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); in tool_link_write()
481 ret = ntb_link_disable(tc->ntb); in tool_link_write()
497 struct tool_ctx *tc = peer->tc; in tool_peer_link_read() local
500 if (ntb_link_is_up(tc->ntb, NULL, NULL) & BIT(peer->pidx)) in tool_peer_link_read()
519 struct tool_ctx *tc = peer->tc; in tool_peer_link_event_write() local
530 if (wait_event_interruptible(tc->link_wq, in tool_peer_link_event_write()
531 !!(ntb_link_is_up(tc->ntb, NULL, NULL) & link_msk) == val)) in tool_peer_link_event_write()
574 static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_mw() argument
578 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_setup_mw()
585 ret = ntb_mw_get_align(tc->ntb, pidx, widx, &addr_align, in tool_setup_mw()
593 inmw->mm_base = dma_alloc_coherent(&tc->ntb->dev, inmw->size, in tool_setup_mw()
603 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
609 tc->peers[pidx].dbgfs_dir, inmw, in tool_setup_mw()
615 dma_free_coherent(&tc->ntb->dev, inmw->size, inmw->mm_base, in tool_setup_mw()
624 static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx) in tool_free_mw() argument
626 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_free_mw()
631 ntb_mw_clear_trans(tc->ntb, pidx, widx); in tool_free_mw()
632 dma_free_coherent(&tc->ntb->dev, inmw->size, in tool_free_mw()
659 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
670 ntb_peer_port_number(inmw->tc->ntb, inmw->pidx), in tool_mw_trans_read()
715 tool_free_mw(inmw->tc, inmw->pidx, inmw->widx); in tool_mw_trans_write()
717 ret = tool_setup_mw(inmw->tc, inmw->pidx, inmw->widx, val); in tool_mw_trans_write()
809 static int tool_setup_peer_mw(struct tool_ctx *tc, int pidx, int widx, in tool_setup_peer_mw() argument
812 struct tool_mw *outmw = &tc->outmws[widx]; in tool_setup_peer_mw()
821 ret = ntb_peer_mw_get_addr(tc->ntb, widx, &map_base, &map_size); in tool_setup_peer_mw()
825 ret = ntb_peer_mw_set_trans(tc->ntb, pidx, widx, req_addr, req_size); in tool_setup_peer_mw()
841 tc->peers[pidx].dbgfs_dir, outmw, in tool_setup_peer_mw()
847 ntb_peer_mw_clear_trans(tc->ntb, pidx, widx); in tool_setup_peer_mw()
852 static void tool_free_peer_mw(struct tool_ctx *tc, int widx) in tool_free_peer_mw() argument
854 struct tool_mw *outmw = &tc->outmws[widx]; in tool_free_peer_mw()
859 iounmap(tc->outmws[widx].io_base); in tool_free_peer_mw()
860 ntb_peer_mw_clear_trans(tc->ntb, outmw->pidx, widx); in tool_free_peer_mw()
882 ret = ntb_peer_mw_get_addr(outmw->tc->ntb, outmw->widx, in tool_peer_mw_trans_read()
899 ntb_peer_port_number(outmw->tc->ntb, outmw->pidx), in tool_peer_mw_trans_read()
948 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
950 ret = tool_setup_peer_mw(outmw->tc, outmw_wrap->pidx, in tool_peer_mw_trans_write()
963 static int tool_init_mws(struct tool_ctx *tc) in tool_init_mws() argument
968 tc->outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
969 tc->outmws = devm_kcalloc(&tc->ntb->dev, tc->outmw_cnt, in tool_init_mws()
970 sizeof(*tc->outmws), GFP_KERNEL); in tool_init_mws()
971 if (tc->outmws == NULL) in tool_init_mws()
974 for (widx = 0; widx < tc->outmw_cnt; widx++) { in tool_init_mws()
975 tc->outmws[widx].widx = widx; in tool_init_mws()
976 tc->outmws[widx].pidx = -1; in tool_init_mws()
977 tc->outmws[widx].tc = tc; in tool_init_mws()
981 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_mws()
982 tc->peers[pidx].inmw_cnt = ntb_mw_count(tc->ntb, pidx); in tool_init_mws()
983 tc->peers[pidx].inmws = in tool_init_mws()
984 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].inmw_cnt, in tool_init_mws()
985 sizeof(*tc->peers[pidx].inmws), GFP_KERNEL); in tool_init_mws()
986 if (tc->peers[pidx].inmws == NULL) in tool_init_mws()
989 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_init_mws()
990 tc->peers[pidx].inmws[widx].widx = widx; in tool_init_mws()
991 tc->peers[pidx].inmws[widx].pidx = pidx; in tool_init_mws()
992 tc->peers[pidx].inmws[widx].tc = tc; in tool_init_mws()
995 tc->peers[pidx].outmw_cnt = ntb_peer_mw_count(tc->ntb); in tool_init_mws()
996 tc->peers[pidx].outmws = in tool_init_mws()
997 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmw_cnt, in tool_init_mws()
998 sizeof(*tc->peers[pidx].outmws), GFP_KERNEL); in tool_init_mws()
1000 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_init_mws()
1001 tc->peers[pidx].outmws[widx].pidx = pidx; in tool_init_mws()
1002 tc->peers[pidx].outmws[widx].mw = &tc->outmws[widx]; in tool_init_mws()
1009 static void tool_clear_mws(struct tool_ctx *tc) in tool_clear_mws() argument
1014 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1015 tool_free_peer_mw(tc, widx); in tool_clear_mws()
1018 for (pidx = 0; pidx < tc->peer_cnt; pidx++) in tool_clear_mws()
1019 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) in tool_clear_mws()
1020 tool_free_mw(tc, pidx, widx); in tool_clear_mws()
1031 struct tool_ctx *tc = filep->private_data; in tool_db_read() local
1033 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read); in tool_db_read()
1039 struct tool_ctx *tc = filep->private_data; in tool_db_write() local
1041 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set, in tool_db_write()
1042 tc->ntb->ops->db_clear); in tool_db_write()
1052 struct tool_ctx *tc = filep->private_data; in tool_db_valid_mask_read() local
1054 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_valid_mask); in tool_db_valid_mask_read()
1064 struct tool_ctx *tc = filep->private_data; in tool_db_mask_read() local
1066 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->db_read_mask); in tool_db_mask_read()
1072 struct tool_ctx *tc = filep->private_data; in tool_db_mask_write() local
1074 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->db_set_mask, in tool_db_mask_write()
1075 tc->ntb->ops->db_clear_mask); in tool_db_mask_write()
1085 struct tool_ctx *tc = filep->private_data; in tool_peer_db_read() local
1087 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->peer_db_read); in tool_peer_db_read()
1093 struct tool_ctx *tc = filep->private_data; in tool_peer_db_write() local
1095 return tool_fn_write(tc, ubuf, size, offp, tc->ntb->ops->peer_db_set, in tool_peer_db_write()
1096 tc->ntb->ops->peer_db_clear); in tool_peer_db_write()
1106 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_read() local
1108 return tool_fn_read(tc, ubuf, size, offp, in tool_peer_db_mask_read()
1109 tc->ntb->ops->peer_db_read_mask); in tool_peer_db_mask_read()
1116 struct tool_ctx *tc = filep->private_data; in tool_peer_db_mask_write() local
1118 return tool_fn_write(tc, ubuf, size, offp, in tool_peer_db_mask_write()
1119 tc->ntb->ops->peer_db_set_mask, in tool_peer_db_mask_write()
1120 tc->ntb->ops->peer_db_clear_mask); in tool_peer_db_mask_write()
1131 struct tool_ctx *tc = filep->private_data; in tool_db_event_write() local
1139 if (wait_event_interruptible(tc->db_wq, ntb_db_read(tc->ntb) == val)) in tool_db_event_write()
1161 if (!spad->tc->ntb->ops->spad_read) in tool_spad_read()
1165 ntb_spad_read(spad->tc->ntb, spad->sidx)); in tool_spad_read()
1177 if (!spad->tc->ntb->ops->spad_write) { in tool_spad_write()
1178 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_spad_write()
1186 ret = ntb_spad_write(spad->tc->ntb, spad->sidx, val); in tool_spad_write()
1202 if (!spad->tc->ntb->ops->peer_spad_read) in tool_peer_spad_read()
1206 ntb_peer_spad_read(spad->tc->ntb, spad->pidx, spad->sidx)); in tool_peer_spad_read()
1218 if (!spad->tc->ntb->ops->peer_spad_write) { in tool_peer_spad_write()
1219 dev_dbg(&spad->tc->ntb->dev, "no spad write fn\n"); in tool_peer_spad_write()
1227 ret = ntb_peer_spad_write(spad->tc->ntb, spad->pidx, spad->sidx, val); in tool_peer_spad_write()
1236 static int tool_init_spads(struct tool_ctx *tc) in tool_init_spads() argument
1241 tc->inspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1242 tc->inspads = devm_kcalloc(&tc->ntb->dev, tc->inspad_cnt, in tool_init_spads()
1243 sizeof(*tc->inspads), GFP_KERNEL); in tool_init_spads()
1244 if (tc->inspads == NULL) in tool_init_spads()
1247 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_init_spads()
1248 tc->inspads[sidx].sidx = sidx; in tool_init_spads()
1249 tc->inspads[sidx].pidx = -1; in tool_init_spads()
1250 tc->inspads[sidx].tc = tc; in tool_init_spads()
1254 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_spads()
1255 tc->peers[pidx].outspad_cnt = ntb_spad_count(tc->ntb); in tool_init_spads()
1256 tc->peers[pidx].outspads = in tool_init_spads()
1257 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outspad_cnt, in tool_init_spads()
1258 sizeof(*tc->peers[pidx].outspads), GFP_KERNEL); in tool_init_spads()
1259 if (tc->peers[pidx].outspads == NULL) in tool_init_spads()
1262 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_init_spads()
1263 tc->peers[pidx].outspads[sidx].sidx = sidx; in tool_init_spads()
1264 tc->peers[pidx].outspads[sidx].pidx = pidx; in tool_init_spads()
1265 tc->peers[pidx].outspads[sidx].tc = tc; in tool_init_spads()
1286 data = ntb_msg_read(msg->tc->ntb, &pidx, msg->midx); in tool_inmsg_read()
1309 ret = ntb_peer_msg_write(msg->tc->ntb, msg->pidx, msg->midx, val); in tool_outmsg_write()
1321 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_read() local
1323 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_read_sts); in tool_msg_sts_read()
1329 struct tool_ctx *tc = filep->private_data; in tool_msg_sts_write() local
1331 return tool_fn_write(tc, ubuf, size, offp, NULL, in tool_msg_sts_write()
1332 tc->ntb->ops->msg_clear_sts); in tool_msg_sts_write()
1342 struct tool_ctx *tc = filep->private_data; in tool_msg_inbits_read() local
1344 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_inbits); in tool_msg_inbits_read()
1354 struct tool_ctx *tc = filep->private_data; in tool_msg_outbits_read() local
1356 return tool_fn_read(tc, ubuf, size, offp, tc->ntb->ops->msg_outbits); in tool_msg_outbits_read()
1366 struct tool_ctx *tc = filep->private_data; in tool_msg_mask_write() local
1368 return tool_fn_write(tc, ubuf, size, offp, in tool_msg_mask_write()
1369 tc->ntb->ops->msg_set_mask, in tool_msg_mask_write()
1370 tc->ntb->ops->msg_clear_mask); in tool_msg_mask_write()
1381 struct tool_ctx *tc = filep->private_data; in tool_msg_event_write() local
1389 if (wait_event_interruptible(tc->msg_wq, in tool_msg_event_write()
1390 ntb_msg_read_sts(tc->ntb) == val)) in tool_msg_event_write()
1400 static int tool_init_msgs(struct tool_ctx *tc) in tool_init_msgs() argument
1405 tc->inmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1406 tc->inmsgs = devm_kcalloc(&tc->ntb->dev, tc->inmsg_cnt, in tool_init_msgs()
1407 sizeof(*tc->inmsgs), GFP_KERNEL); in tool_init_msgs()
1408 if (tc->inmsgs == NULL) in tool_init_msgs()
1411 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_init_msgs()
1412 tc->inmsgs[midx].midx = midx; in tool_init_msgs()
1413 tc->inmsgs[midx].pidx = -1; in tool_init_msgs()
1414 tc->inmsgs[midx].tc = tc; in tool_init_msgs()
1418 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_msgs()
1419 tc->peers[pidx].outmsg_cnt = ntb_msg_count(tc->ntb); in tool_init_msgs()
1420 tc->peers[pidx].outmsgs = in tool_init_msgs()
1421 devm_kcalloc(&tc->ntb->dev, tc->peers[pidx].outmsg_cnt, in tool_init_msgs()
1422 sizeof(*tc->peers[pidx].outmsgs), GFP_KERNEL); in tool_init_msgs()
1423 if (tc->peers[pidx].outmsgs == NULL) in tool_init_msgs()
1426 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_init_msgs()
1427 tc->peers[pidx].outmsgs[midx].midx = midx; in tool_init_msgs()
1428 tc->peers[pidx].outmsgs[midx].pidx = pidx; in tool_init_msgs()
1429 tc->peers[pidx].outmsgs[midx].tc = tc; in tool_init_msgs()
1443 struct tool_ctx *tc; in tool_create_data() local
1445 tc = devm_kzalloc(&ntb->dev, sizeof(*tc), GFP_KERNEL); in tool_create_data()
1446 if (tc == NULL) in tool_create_data()
1449 tc->ntb = ntb; in tool_create_data()
1450 init_waitqueue_head(&tc->link_wq); in tool_create_data()
1451 init_waitqueue_head(&tc->db_wq); in tool_create_data()
1452 init_waitqueue_head(&tc->msg_wq); in tool_create_data()
1460 return tc; in tool_create_data()
1463 static void tool_clear_data(struct tool_ctx *tc) in tool_clear_data() argument
1465 wake_up(&tc->link_wq); in tool_clear_data()
1466 wake_up(&tc->db_wq); in tool_clear_data()
1467 wake_up(&tc->msg_wq); in tool_clear_data()
1470 static int tool_init_ntb(struct tool_ctx *tc) in tool_init_ntb() argument
1472 return ntb_set_ctx(tc->ntb, tc, &tool_ops); in tool_init_ntb()
1475 static void tool_clear_ntb(struct tool_ctx *tc) in tool_clear_ntb() argument
1477 ntb_clear_ctx(tc->ntb); in tool_clear_ntb()
1478 ntb_link_disable(tc->ntb); in tool_clear_ntb()
1481 static void tool_setup_dbgfs(struct tool_ctx *tc) in tool_setup_dbgfs() argument
1488 tc->dbgfs_dir = NULL; in tool_setup_dbgfs()
1492 tc->dbgfs_dir = debugfs_create_dir(dev_name(&tc->ntb->dev), in tool_setup_dbgfs()
1494 if (!tc->dbgfs_dir) in tool_setup_dbgfs()
1497 debugfs_create_file("port", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1498 tc, &tool_port_fops); in tool_setup_dbgfs()
1500 debugfs_create_file("link", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1501 tc, &tool_link_fops); in tool_setup_dbgfs()
1503 debugfs_create_file("db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1504 tc, &tool_db_fops); in tool_setup_dbgfs()
1506 debugfs_create_file("db_valid_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1507 tc, &tool_db_valid_mask_fops); in tool_setup_dbgfs()
1509 debugfs_create_file("db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1510 tc, &tool_db_mask_fops); in tool_setup_dbgfs()
1512 debugfs_create_file("db_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1513 tc, &tool_db_event_fops); in tool_setup_dbgfs()
1515 debugfs_create_file("peer_db", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1516 tc, &tool_peer_db_fops); in tool_setup_dbgfs()
1518 debugfs_create_file("peer_db_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1519 tc, &tool_peer_db_mask_fops); in tool_setup_dbgfs()
1521 if (tc->inspad_cnt != 0) { in tool_setup_dbgfs()
1522 for (sidx = 0; sidx < tc->inspad_cnt; sidx++) { in tool_setup_dbgfs()
1525 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1526 &tc->inspads[sidx], &tool_spad_fops); in tool_setup_dbgfs()
1530 if (tc->inmsg_cnt != 0) { in tool_setup_dbgfs()
1531 for (midx = 0; midx < tc->inmsg_cnt; midx++) { in tool_setup_dbgfs()
1533 debugfs_create_file(buf, 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1534 &tc->inmsgs[midx], &tool_inmsg_fops); in tool_setup_dbgfs()
1537 debugfs_create_file("msg_sts", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1538 tc, &tool_msg_sts_fops); in tool_setup_dbgfs()
1540 debugfs_create_file("msg_inbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1541 tc, &tool_msg_inbits_fops); in tool_setup_dbgfs()
1543 debugfs_create_file("msg_outbits", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1544 tc, &tool_msg_outbits_fops); in tool_setup_dbgfs()
1546 debugfs_create_file("msg_mask", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1547 tc, &tool_msg_mask_fops); in tool_setup_dbgfs()
1549 debugfs_create_file("msg_event", 0600, tc->dbgfs_dir, in tool_setup_dbgfs()
1550 tc, &tool_msg_event_fops); in tool_setup_dbgfs()
1553 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_setup_dbgfs()
1555 tc->peers[pidx].dbgfs_dir = in tool_setup_dbgfs()
1556 debugfs_create_dir(buf, tc->dbgfs_dir); in tool_setup_dbgfs()
1559 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1560 &tc->peers[pidx], &tool_peer_port_fops); in tool_setup_dbgfs()
1563 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1564 &tc->peers[pidx], &tool_peer_link_fops); in tool_setup_dbgfs()
1567 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1568 &tc->peers[pidx], &tool_peer_link_event_fops); in tool_setup_dbgfs()
1570 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1573 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1574 &tc->peers[pidx].inmws[widx], in tool_setup_dbgfs()
1578 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) { in tool_setup_dbgfs()
1581 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1582 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()
1586 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_setup_dbgfs()
1590 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1591 &tc->peers[pidx].outspads[sidx], in tool_setup_dbgfs()
1595 for (midx = 0; midx < tc->peers[pidx].outmsg_cnt; midx++) { in tool_setup_dbgfs()
1598 tc->peers[pidx].dbgfs_dir, in tool_setup_dbgfs()
1599 &tc->peers[pidx].outmsgs[midx], in tool_setup_dbgfs()
1605 static void tool_clear_dbgfs(struct tool_ctx *tc) in tool_clear_dbgfs() argument
1607 debugfs_remove_recursive(tc->dbgfs_dir); in tool_clear_dbgfs()
1612 struct tool_ctx *tc; in tool_probe() local
1615 tc = tool_create_data(ntb); in tool_probe()
1616 if (IS_ERR(tc)) in tool_probe()
1617 return PTR_ERR(tc); in tool_probe()
1619 ret = tool_init_peers(tc); in tool_probe()
1623 ret = tool_init_mws(tc); in tool_probe()
1627 ret = tool_init_spads(tc); in tool_probe()
1631 ret = tool_init_msgs(tc); in tool_probe()
1635 ret = tool_init_ntb(tc); in tool_probe()
1639 tool_setup_dbgfs(tc); in tool_probe()
1644 tool_clear_mws(tc); in tool_probe()
1647 tool_clear_data(tc); in tool_probe()
1654 struct tool_ctx *tc = ntb->ctx; in tool_remove() local
1656 tool_clear_dbgfs(tc); in tool_remove()
1658 tool_clear_ntb(tc); in tool_remove()
1660 tool_clear_mws(tc); in tool_remove()
1662 tool_clear_data(tc); in tool_remove()