Lines Matching refs:mw
171 struct ntb_transport_mw *mw; member
511 WARN_ON(nt->mw[mw_num].virt_addr == NULL); in ntb_transport_setup_qp_mw()
518 rx_size = (unsigned int) nt->mw[mw_num].size / num_qps_mw; in ntb_transport_setup_qp_mw()
519 qp->rx_buff = nt->mw[mw_num].virt_addr + qp_num / mw_max * rx_size; in ntb_transport_setup_qp_mw()
545 struct ntb_transport_mw *mw = &nt->mw[num_mw]; in ntb_free_mw() local
548 if (!mw->virt_addr) in ntb_free_mw()
551 dma_free_coherent(&pdev->dev, mw->size, mw->virt_addr, mw->dma_addr); in ntb_free_mw()
552 mw->virt_addr = NULL; in ntb_free_mw()
557 struct ntb_transport_mw *mw = &nt->mw[num_mw]; in ntb_set_mw() local
561 if (mw->size == ALIGN(size, 4096)) in ntb_set_mw()
564 if (mw->size != 0) in ntb_set_mw()
568 mw->size = ALIGN(size, 4096); in ntb_set_mw()
570 mw->virt_addr = dma_alloc_coherent(&pdev->dev, mw->size, &mw->dma_addr, in ntb_set_mw()
572 if (!mw->virt_addr) { in ntb_set_mw()
573 mw->size = 0; in ntb_set_mw()
575 (int) mw->size); in ntb_set_mw()
585 if (!IS_ALIGNED(mw->dma_addr, mw->size)) { in ntb_set_mw()
587 &mw->dma_addr); in ntb_set_mw()
593 ntb_set_mw_addr(nt->ndev, num_mw, mw->dma_addr); in ntb_set_mw()
935 nt->mw = kcalloc(ntb_max_mw(nt->ndev), sizeof(struct ntb_transport_mw), in ntb_transport_init()
937 if (!nt->mw) { in ntb_transport_init()
985 kfree(nt->mw); in ntb_transport_init()
1018 kfree(nt->mw); in ntb_transport_free()