Пример #1
0
static void
ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw)
{
	struct ntb_transport_mw *mw = &nt->mw_vec[num_mw];

	if (mw->virt_addr == NULL)
		return;

	ntb_mw_clear_trans(nt->ntb, num_mw);
	contigfree(mw->virt_addr, mw->xlat_size, M_NTB_IF);
	mw->xlat_size = 0;
	mw->buff_size = 0;
	mw->virt_addr = NULL;
}
Пример #2
0
static void perf_free_mw(struct perf_ctx *perf)
{
	struct perf_mw *mw = &perf->mw;
	struct pci_dev *pdev = perf->ntb->pdev;

	if (!mw->virt_addr)
		return;

	ntb_mw_clear_trans(perf->ntb, 0);
	dma_free_coherent(&pdev->dev, mw->buf_size,
			  mw->virt_addr, mw->dma_addr);
	mw->xlat_size = 0;
	mw->buf_size = 0;
	mw->virt_addr = NULL;
}
Пример #3
0
static void tool_free_mw(struct tool_ctx *tc, int idx)
{
	struct tool_mw *mw = &tc->mws[idx];

	if (mw->peer) {
		ntb_mw_clear_trans(tc->ntb, PIDX, idx);
		dma_free_coherent(&tc->ntb->pdev->dev, mw->size,
				  mw->peer,
				  mw->peer_dma);
	}

	mw->peer = NULL;
	mw->peer_dma = 0;

	debugfs_remove(mw->peer_dbg_file);

	mw->peer_dbg_file = NULL;
}