Lines Matching refs:widx

206 	int widx;  member
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()
605 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size); in tool_setup_mw()
609 snprintf(buf, sizeof(buf), "mw%d", widx); 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()
661 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx, in tool_mw_trans_read()
668 inmw->widx); 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()
841 snprintf(buf, sizeof(buf), "peer_mw%d", widx); 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()
896 "Outbound MW: \t%d\n", outmw->widx); in tool_peer_mw_trans_read()
950 tool_free_peer_mw(outmw->tc, outmw->widx); in tool_peer_mw_trans_write()
953 outmw->widx, addr, wsize); in tool_peer_mw_trans_write()
967 int widx, pidx; in tool_init_mws() local
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()
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()
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()
1013 int widx, pidx; in tool_clear_mws() local
1016 for (widx = 0; widx < tc->outmw_cnt; widx++) in tool_clear_mws()
1017 tool_free_peer_mw(tc, widx); 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()
1485 int pidx, widx, sidx, midx; in tool_setup_dbgfs() local
1572 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_dbgfs()
1573 snprintf(buf, sizeof(buf), "mw_trans%d", widx); 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()
1581 snprintf(buf, sizeof(buf), "peer_mw_trans%d", widx); in tool_setup_dbgfs()
1584 &tc->peers[pidx].outmws[widx], in tool_setup_dbgfs()