Lines Matching defs:widx
206 int widx;
576 static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
580 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx];
587 ret = ntb_mw_get_align(tc->ntb, pidx, widx, &addr_align,
605 ret = ntb_mw_set_trans(tc->ntb, pidx, widx, inmw->dma_base, inmw->size);
609 snprintf(buf, sizeof(buf), "mw%d", widx);
626 static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx)
628 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx];
633 ntb_mw_clear_trans(tc->ntb, pidx, widx);
661 ret = ntb_mw_get_align(inmw->tc->ntb, inmw->pidx, inmw->widx,
668 inmw->widx);
717 tool_free_mw(inmw->tc, inmw->pidx, inmw->widx);
719 ret = tool_setup_mw(inmw->tc, inmw->pidx, inmw->widx, val);
811 static int tool_setup_peer_mw(struct tool_ctx *tc, int pidx, int widx,
814 struct tool_mw *outmw = &tc->outmws[widx];
823 ret = ntb_peer_mw_get_addr(tc->ntb, widx, &map_base, &map_size);
827 ret = ntb_peer_mw_set_trans(tc->ntb, pidx, widx, req_addr, req_size);
841 snprintf(buf, sizeof(buf), "peer_mw%d", widx);
849 ntb_peer_mw_clear_trans(tc->ntb, pidx, widx);
854 static void tool_free_peer_mw(struct tool_ctx *tc, int widx)
856 struct tool_mw *outmw = &tc->outmws[widx];
861 iounmap(tc->outmws[widx].io_base);
862 ntb_peer_mw_clear_trans(tc->ntb, outmw->pidx, widx);
884 ret = ntb_peer_mw_get_addr(outmw->tc->ntb, outmw->widx,
896 "Outbound MW: \t%d\n", outmw->widx);
950 tool_free_peer_mw(outmw->tc, outmw->widx);
953 outmw->widx, addr, wsize);
967 int widx, pidx;
976 for (widx = 0; widx < tc->outmw_cnt; widx++) {
977 tc->outmws[widx].widx = widx;
978 tc->outmws[widx].pidx = -1;
979 tc->outmws[widx].tc = tc;
991 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) {
992 tc->peers[pidx].inmws[widx].widx = widx;
993 tc->peers[pidx].inmws[widx].pidx = pidx;
994 tc->peers[pidx].inmws[widx].tc = tc;
1004 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) {
1005 tc->peers[pidx].outmws[widx].pidx = pidx;
1006 tc->peers[pidx].outmws[widx].mw = &tc->outmws[widx];
1015 int widx, pidx;
1018 for (widx = 0; widx < tc->outmw_cnt; widx++)
1019 tool_free_peer_mw(tc, widx);
1023 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++)
1024 tool_free_mw(tc, pidx, widx);
1487 int pidx, widx, sidx, midx;
1574 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) {
1575 snprintf(buf, sizeof(buf), "mw_trans%d", widx);
1578 &tc->peers[pidx].inmws[widx],
1582 for (widx = 0; widx < tc->peers[pidx].outmw_cnt; widx++) {
1583 snprintf(buf, sizeof(buf), "peer_mw_trans%d", widx);
1586 &tc->peers[pidx].outmws[widx],