Lines Matching refs:widx

206 	int widx;  member
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()
598 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
602 snprintf(buf, sizeof(buf), "mw%d", widx); 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()
654 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
661 inmw->widx); 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()
834 snprintf(buf, sizeof(buf), "peer_mw%d", widx); 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()
889 "Outbound MW: \t%d\n", outmw->widx); in tool_peer_mw_trans_read()
943 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
946 outmw->widx, addr, wsize); in tool_peer_mw_trans_write()
960 int widx, pidx; in tool_init_mws() local
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()
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()
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()
1008 int widx, pidx; in tool_clear_mws() local
1011 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1012 tool_free_peer_mw(tc, widx); 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()
1480 int pidx, widx, sidx, midx; in tool_setup_dbgfs() local
1565 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1566 snprintf(buf, sizeof(buf), "mw_trans%d", widx); 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()
1574 snprintf(buf, sizeof(buf), "peer_mw_trans%d", widx); in tool_setup_dbgfs()
1577 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()