Lines Matching refs:mem
59 pci_unmap_sg(dev->persist->pdev, chunk->mem, chunk->npages, in mlx4_free_icm_pages()
63 __free_pages(sg_page(&chunk->mem[i]), in mlx4_free_icm_pages()
64 get_order(chunk->mem[i].length)); in mlx4_free_icm_pages()
73 chunk->mem[i].length, in mlx4_free_icm_coherent()
74 lowmem_page_address(sg_page(&chunk->mem[i])), in mlx4_free_icm_coherent()
75 sg_dma_address(&chunk->mem[i])); in mlx4_free_icm_coherent()
97 static int mlx4_alloc_icm_pages(struct scatterlist *mem, int order, in mlx4_alloc_icm_pages() argument
109 sg_set_page(mem, page, PAGE_SIZE << order, 0); in mlx4_alloc_icm_pages()
113 static int mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem, in mlx4_alloc_icm_coherent() argument
117 &sg_dma_address(mem), gfp_mask); in mlx4_alloc_icm_coherent()
121 sg_set_buf(mem, buf, PAGE_SIZE << order); in mlx4_alloc_icm_coherent()
122 BUG_ON(mem->offset); in mlx4_alloc_icm_coherent()
123 sg_dma_len(mem) = PAGE_SIZE << order; in mlx4_alloc_icm_coherent()
167 sg_init_table(chunk->mem, MLX4_ICM_CHUNK_LEN); in mlx4_alloc_icm()
178 &chunk->mem[chunk->npages], in mlx4_alloc_icm()
181 ret = mlx4_alloc_icm_pages(&chunk->mem[chunk->npages], in mlx4_alloc_icm()
197 chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem, in mlx4_alloc_icm()
212 chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem, in mlx4_alloc_icm()
330 if (sg_dma_len(&chunk->mem[i]) > dma_offset) in mlx4_table_find()
331 *dma_handle = sg_dma_address(&chunk->mem[i]) + in mlx4_table_find()
333 dma_offset -= sg_dma_len(&chunk->mem[i]); in mlx4_table_find()
340 if (chunk->mem[i].length > offset) { in mlx4_table_find()
341 page = sg_page(&chunk->mem[i]); in mlx4_table_find()
344 offset -= chunk->mem[i].length; in mlx4_table_find()