Lines Matching refs:widx

206 	int widx;  member
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()
603 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
607 snprintf(buf, sizeof(buf), "mw%d", widx); 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()
659 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
666 inmw->widx); 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()
839 snprintf(buf, sizeof(buf), "peer_mw%d", widx); 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()
894 "Outbound MW: \t%d\n", outmw->widx); in tool_peer_mw_trans_read()
948 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
951 outmw->widx, addr, wsize); in tool_peer_mw_trans_write()
965 int widx, pidx; in tool_init_mws() local
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()
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()
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()
1011 int widx, pidx; in tool_clear_mws() local
1014 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1015 tool_free_peer_mw(tc, widx); 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()
1483 int pidx, widx, sidx, midx; in tool_setup_dbgfs() local
1570 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1571 snprintf(buf, sizeof(buf), "mw_trans%d", widx); 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()
1579 snprintf(buf, sizeof(buf), "peer_mw_trans%d", widx); in tool_setup_dbgfs()
1582 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()