Lines Matching refs:mem_desc

5293 	struct dma_memory_desc *mem_desc;  in mpi3mr_free_ioctl_dma_memory()  local
5296 mem_desc = &sc->ioctl_sge[i]; in mpi3mr_free_ioctl_dma_memory()
5297 if (mem_desc->addr && mem_desc->dma_addr) { in mpi3mr_free_ioctl_dma_memory()
5298 bus_dmamap_unload(mem_desc->tag, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5299 bus_dmamem_free(mem_desc->tag, mem_desc->addr, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5300 mem_desc->addr = NULL; in mpi3mr_free_ioctl_dma_memory()
5301 if (mem_desc->tag != NULL) in mpi3mr_free_ioctl_dma_memory()
5302 bus_dma_tag_destroy(mem_desc->tag); in mpi3mr_free_ioctl_dma_memory()
5306 mem_desc = &sc->ioctl_chain_sge; in mpi3mr_free_ioctl_dma_memory()
5307 if (mem_desc->addr && mem_desc->dma_addr) { in mpi3mr_free_ioctl_dma_memory()
5308 bus_dmamap_unload(mem_desc->tag, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5309 bus_dmamem_free(mem_desc->tag, mem_desc->addr, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5310 mem_desc->addr = NULL; in mpi3mr_free_ioctl_dma_memory()
5311 if (mem_desc->tag != NULL) in mpi3mr_free_ioctl_dma_memory()
5312 bus_dma_tag_destroy(mem_desc->tag); in mpi3mr_free_ioctl_dma_memory()
5315 mem_desc = &sc->ioctl_resp_sge; in mpi3mr_free_ioctl_dma_memory()
5316 if (mem_desc->addr && mem_desc->dma_addr) { in mpi3mr_free_ioctl_dma_memory()
5317 bus_dmamap_unload(mem_desc->tag, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5318 bus_dmamem_free(mem_desc->tag, mem_desc->addr, mem_desc->dmamap); in mpi3mr_free_ioctl_dma_memory()
5319 mem_desc->addr = NULL; in mpi3mr_free_ioctl_dma_memory()
5320 if (mem_desc->tag != NULL) in mpi3mr_free_ioctl_dma_memory()
5321 bus_dma_tag_destroy(mem_desc->tag); in mpi3mr_free_ioctl_dma_memory()
5338 struct dma_memory_desc *mem_desc; in mpi3mr_alloc_ioctl_dma_memory() local
5342 mem_desc = &sc->ioctl_sge[i]; in mpi3mr_alloc_ioctl_dma_memory()
5343 mem_desc->size = MPI3MR_IOCTL_SGE_SIZE; in mpi3mr_alloc_ioctl_dma_memory()
5350 mem_desc->size, /* maxsize */ in mpi3mr_alloc_ioctl_dma_memory()
5352 mem_desc->size, /* maxsegsize */ in mpi3mr_alloc_ioctl_dma_memory()
5355 &mem_desc->tag)) { in mpi3mr_alloc_ioctl_dma_memory()
5360 if (bus_dmamem_alloc(mem_desc->tag, (void **)&mem_desc->addr, in mpi3mr_alloc_ioctl_dma_memory()
5361 BUS_DMA_NOWAIT, &mem_desc->dmamap)) { in mpi3mr_alloc_ioctl_dma_memory()
5365 bzero(mem_desc->addr, mem_desc->size); in mpi3mr_alloc_ioctl_dma_memory()
5366 bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, in mpi3mr_alloc_ioctl_dma_memory()
5367 mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); in mpi3mr_alloc_ioctl_dma_memory()
5369 if (!mem_desc->addr) in mpi3mr_alloc_ioctl_dma_memory()
5373 mem_desc = &sc->ioctl_chain_sge; in mpi3mr_alloc_ioctl_dma_memory()
5374 mem_desc->size = MPI3MR_4K_PGSZ; in mpi3mr_alloc_ioctl_dma_memory()
5380 mem_desc->size, /* maxsize */ in mpi3mr_alloc_ioctl_dma_memory()
5382 mem_desc->size, /* maxsegsize */ in mpi3mr_alloc_ioctl_dma_memory()
5385 &mem_desc->tag)) { in mpi3mr_alloc_ioctl_dma_memory()
5390 if (bus_dmamem_alloc(mem_desc->tag, (void **)&mem_desc->addr, in mpi3mr_alloc_ioctl_dma_memory()
5391 BUS_DMA_NOWAIT, &mem_desc->dmamap)) { in mpi3mr_alloc_ioctl_dma_memory()
5395 bzero(mem_desc->addr, mem_desc->size); in mpi3mr_alloc_ioctl_dma_memory()
5396 bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, in mpi3mr_alloc_ioctl_dma_memory()
5397 mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); in mpi3mr_alloc_ioctl_dma_memory()
5399 if (!mem_desc->addr) in mpi3mr_alloc_ioctl_dma_memory()
5402 mem_desc = &sc->ioctl_resp_sge; in mpi3mr_alloc_ioctl_dma_memory()
5403 mem_desc->size = MPI3MR_4K_PGSZ; in mpi3mr_alloc_ioctl_dma_memory()
5409 mem_desc->size, /* maxsize */ in mpi3mr_alloc_ioctl_dma_memory()
5411 mem_desc->size, /* maxsegsize */ in mpi3mr_alloc_ioctl_dma_memory()
5414 &mem_desc->tag)) { in mpi3mr_alloc_ioctl_dma_memory()
5419 if (bus_dmamem_alloc(mem_desc->tag, (void **)&mem_desc->addr, in mpi3mr_alloc_ioctl_dma_memory()
5420 BUS_DMA_NOWAIT, &mem_desc->dmamap)) { in mpi3mr_alloc_ioctl_dma_memory()
5424 bzero(mem_desc->addr, mem_desc->size); in mpi3mr_alloc_ioctl_dma_memory()
5425 bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, in mpi3mr_alloc_ioctl_dma_memory()
5426 mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); in mpi3mr_alloc_ioctl_dma_memory()
5428 if (!mem_desc->addr) in mpi3mr_alloc_ioctl_dma_memory()
5442 struct dma_memory_desc *mem_desc) in mpi3mr_free_dma_mem() argument
5444 if (mem_desc->dma_addr) in mpi3mr_free_dma_mem()
5445 bus_dmamap_unload(mem_desc->tag, mem_desc->dmamap); in mpi3mr_free_dma_mem()
5447 if (mem_desc->addr != NULL) { in mpi3mr_free_dma_mem()
5448 bus_dmamem_free(mem_desc->tag, mem_desc->addr, mem_desc->dmamap); in mpi3mr_free_dma_mem()
5449 mem_desc->addr = NULL; in mpi3mr_free_dma_mem()
5452 if (mem_desc->tag != NULL) in mpi3mr_free_dma_mem()
5453 bus_dma_tag_destroy(mem_desc->tag); in mpi3mr_free_dma_mem()
5458 struct dma_memory_desc *mem_desc) in mpi3mr_alloc_dma_mem() argument
5467 mem_desc->size, /* maxsize */ in mpi3mr_alloc_dma_mem()
5469 mem_desc->size, /* maxsize */ in mpi3mr_alloc_dma_mem()
5472 &mem_desc->tag)) { in mpi3mr_alloc_dma_mem()
5477 if (bus_dmamem_alloc(mem_desc->tag, (void **)&mem_desc->addr, in mpi3mr_alloc_dma_mem()
5478 BUS_DMA_NOWAIT, &mem_desc->dmamap)) { in mpi3mr_alloc_dma_mem()
5484 bzero(mem_desc->addr, mem_desc->size); in mpi3mr_alloc_dma_mem()
5486 bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, in mpi3mr_alloc_dma_mem()
5487 mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); in mpi3mr_alloc_dma_mem()
5489 if (!mem_desc->addr) { in mpi3mr_alloc_dma_mem()
5496 mpi3mr_free_dma_mem(sc, mem_desc); in mpi3mr_alloc_dma_mem()
5565 struct dma_memory_desc mem_desc = {0}; in mpi3mr_process_cfg_req() local
5568 mem_desc.size = sizeof(Mpi3ConfigPageHeader_t); in mpi3mr_process_cfg_req()
5570 mem_desc.size = le16toh(cfg_hdr->PageLength) * 4; in mpi3mr_process_cfg_req()
5575 retval = mpi3mr_alloc_dma_mem(sc, &mem_desc); in mpi3mr_process_cfg_req()
5582 mem_desc.size, mem_desc.dma_addr); in mpi3mr_process_cfg_req()
5588 memcpy(cfg_buf, mem_desc.addr, min(mem_desc.size, cfg_buf_sz)); in mpi3mr_process_cfg_req()
5590 mpi3mr_free_dma_mem(sc, &mem_desc); in mpi3mr_process_cfg_req()