Lines Matching refs:mw

619 	struct ntb_transport_mw *mw;
631 mw = &nt->mw_vec[mw_num];
633 if (!mw->virt_addr)
641 rx_size = (unsigned int)mw->xlat_size / num_qps_mw;
642 qp->rx_buff = mw->virt_addr + rx_size * (qp_num / mw_count);
795 struct ntb_transport_mw *mw = &nt->mw_vec[num_mw];
798 if (!mw->virt_addr)
802 dma_free_coherent(&pdev->dev, mw->alloc_size,
803 mw->alloc_addr, mw->dma_addr);
804 mw->xlat_size = 0;
805 mw->buff_size = 0;
806 mw->alloc_size = 0;
807 mw->alloc_addr = NULL;
808 mw->virt_addr = NULL;
811 static int ntb_alloc_mw_buffer(struct ntb_transport_mw *mw,
818 alloc_addr = dma_alloc_coherent(dma_dev, mw->alloc_size,
822 mw->alloc_size);
834 if (mw->alloc_size > mw->buff_size) {
843 mw->alloc_addr = alloc_addr;
844 mw->virt_addr = virt_addr;
845 mw->dma_addr = dma_addr;
850 dma_free_coherent(dma_dev, mw->alloc_size, alloc_addr, dma_addr);
858 struct ntb_transport_mw *mw = &nt->mw_vec[num_mw];
877 if (mw->xlat_size == xlat_size)
880 if (mw->buff_size)
884 mw->xlat_size = xlat_size;
885 mw->buff_size = buff_size;
886 mw->alloc_size = buff_size;
888 rc = ntb_alloc_mw_buffer(mw, &pdev->dev, xlat_align);
890 mw->alloc_size *= 2;
891 rc = ntb_alloc_mw_buffer(mw, &pdev->dev, xlat_align);
895 mw->xlat_size = 0;
896 mw->buff_size = 0;
897 mw->alloc_size = 0;
903 rc = ntb_mw_set_trans(nt->ndev, PIDX, num_mw, mw->dma_addr,
904 mw->xlat_size);
906 dev_err(&pdev->dev, "Unable to set mw%d translation", num_mw);
1253 struct ntb_transport_mw *mw;
1319 mw = &nt->mw_vec[i];
1321 rc = ntb_peer_mw_get_addr(ndev, i, &mw->phys_addr,
1322 &mw->phys_size);
1326 mw->vbase = ioremap_wc(mw->phys_addr, mw->phys_size);
1327 if (!mw->vbase) {
1332 mw->buff_size = 0;
1333 mw->xlat_size = 0;
1334 mw->virt_addr = NULL;
1335 mw->dma_addr = 0;
1401 mw = &nt->mw_vec[i];
1402 iounmap(mw->vbase);