Lines Matching defs:widx

206 	int widx;
569 static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
573 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx];
580 ret = ntb_mw_get_align(tc->ntb, pidx, widx, &addr_align,
598 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size);
602 snprintf(buf, sizeof(buf), "mw%d", widx);
619 static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx)
621 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx];
626 ntb_mw_clear_trans(tc->ntb, pidx, widx);
654 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx,
661 inmw->widx);
710 tool_free_mw(inmw->tc, inmw->pidx, inmw->widx);
712 ret = tool_setup_mw(inmw->tc, inmw->pidx, inmw->widx, val);
804 static int tool_setup_peer_mw(struct tool_ctx *tc, int pidx, int widx,
807 struct tool_mw *outmw = &tc->outmws[widx];
816 ret = ntb_peer_mw_get_addr(tc->ntb, widx, &map_base, &map_size);
820 ret = ntb_peer_mw_set_trans(tc->ntb, pidx, widx, req_addr, req_size);
834 snprintf(buf, sizeof(buf), "peer_mw%d", widx);
842 ntb_peer_mw_clear_trans(tc->ntb, pidx, widx);
847 static void tool_free_peer_mw(struct tool_ctx *tc, int widx)
849 struct tool_mw *outmw = &tc->outmws[widx];
854 iounmap(tc->outmws[widx].io_base);
855 ntb_peer_mw_clear_trans(tc->ntb, outmw->pidx, widx);
877 ret = ntb_peer_mw_get_addr(outmw->tc->ntb, outmw->widx,
889 "Outbound MW: \t%d\n", outmw->widx);
943 tool_free_peer_mw(outmw->tc, outmw->widx);
946 outmw->widx, addr, wsize);
960 int widx, pidx;
969 for (widx = 0; widx < tc->outmw_cnt; widx++) {
970 tc->outmws[widx].widx = widx;
971 tc->outmws[widx].pidx = -1;
972 tc->outmws[widx].tc = tc;
984 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) {
985 tc->peers[pidx].inmws[widx].widx = widx;
986 tc->peers[pidx].inmws[widx].pidx = pidx;
987 tc->peers[pidx].inmws[widx].tc = tc;
997 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) {
998 tc->peers[pidx].outmws[widx].pidx = pidx;
999 tc->peers[pidx].outmws[widx].mw = &tc->outmws[widx];
1008 int widx, pidx;
1011 for (widx = 0; widx < tc->outmw_cnt; widx++)
1012 tool_free_peer_mw(tc, widx);
1016 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++)
1017 tool_free_mw(tc, pidx, widx);
1480 int pidx, widx, sidx, midx;
1565 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) {
1566 snprintf(buf, sizeof(buf), "mw_trans%d", widx);
1569 &tc->peers[pidx].inmws[widx],
1573 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) {
1574 snprintf(buf, sizeof(buf), "peer_mw_trans%d", widx);
1577 &tc->peers[pidx].outmws[widx],