Lines Matching refs:gmi
154 struct gdma_mem_info *gmi) in mana_gd_alloc_memory() argument
162 gmi->dev = gc->dev; in mana_gd_alloc_memory()
163 buf = dma_alloc_coherent(gmi->dev, length, &dma_handle, GFP_KERNEL); in mana_gd_alloc_memory()
167 gmi->dma_handle = dma_handle; in mana_gd_alloc_memory()
168 gmi->virt_addr = buf; in mana_gd_alloc_memory()
169 gmi->length = length; in mana_gd_alloc_memory()
174 void mana_gd_free_memory(struct gdma_mem_info *gmi) in mana_gd_free_memory() argument
176 dma_free_coherent(gmi->dev, gmi->length, gmi->virt_addr, in mana_gd_free_memory()
177 gmi->dma_handle); in mana_gd_free_memory()
632 struct gdma_mem_info *gmi; in mana_gd_create_hwc_queue() local
640 gmi = &queue->mem_info; in mana_gd_create_hwc_queue()
641 err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); in mana_gd_create_hwc_queue()
647 queue->queue_mem_ptr = gmi->virt_addr; in mana_gd_create_hwc_queue()
664 mana_gd_free_memory(gmi); in mana_gd_create_hwc_queue()
690 struct gdma_mem_info *gmi) in mana_gd_create_dma_region() argument
692 unsigned int num_page = gmi->length / PAGE_SIZE; in mana_gd_create_dma_region()
697 u32 length = gmi->length; in mana_gd_create_dma_region()
705 if (offset_in_page(gmi->virt_addr) != 0) in mana_gd_create_dma_region()
726 req->page_addr_list[i] = gmi->dma_handle + i * PAGE_SIZE; in mana_gd_create_dma_region()
739 gmi->gdma_region = resp.gdma_region; in mana_gd_create_dma_region()
750 struct gdma_mem_info *gmi; in mana_gd_create_mana_eq() local
761 gmi = &queue->mem_info; in mana_gd_create_mana_eq()
762 err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); in mana_gd_create_mana_eq()
766 err = mana_gd_create_dma_region(gd, gmi); in mana_gd_create_mana_eq()
772 queue->queue_mem_ptr = gmi->virt_addr; in mana_gd_create_mana_eq()
785 mana_gd_free_memory(gmi); in mana_gd_create_mana_eq()
796 struct gdma_mem_info *gmi; in mana_gd_create_mana_wq_cq() local
808 gmi = &queue->mem_info; in mana_gd_create_mana_wq_cq()
809 err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); in mana_gd_create_mana_wq_cq()
813 err = mana_gd_create_dma_region(gd, gmi); in mana_gd_create_mana_wq_cq()
819 queue->queue_mem_ptr = gmi->virt_addr; in mana_gd_create_mana_wq_cq()
831 mana_gd_free_memory(gmi); in mana_gd_create_mana_wq_cq()
839 struct gdma_mem_info *gmi = &queue->mem_info; in mana_gd_destroy_queue() local
862 mana_gd_destroy_dma_region(gc, gmi->gdma_region); in mana_gd_destroy_queue()
863 mana_gd_free_memory(gmi); in mana_gd_destroy_queue()