Lines Matching refs:dma

635 nvme_check_dma_hdl(nvme_dma_t *dma)  in nvme_check_dma_hdl()  argument
639 if (dma == NULL) in nvme_check_dma_hdl()
642 ddi_fm_dma_err_get(dma->nd_dmah, &error, DDI_FME_VERSION); in nvme_check_dma_hdl()
651 nvme_free_dma_common(nvme_dma_t *dma) in nvme_free_dma_common() argument
653 if (dma->nd_dmah != NULL) in nvme_free_dma_common()
654 (void) ddi_dma_unbind_handle(dma->nd_dmah); in nvme_free_dma_common()
655 if (dma->nd_acch != NULL) in nvme_free_dma_common()
656 ddi_dma_mem_free(&dma->nd_acch); in nvme_free_dma_common()
657 if (dma->nd_dmah != NULL) in nvme_free_dma_common()
658 ddi_dma_free_handle(&dma->nd_dmah); in nvme_free_dma_common()
662 nvme_free_dma(nvme_dma_t *dma) in nvme_free_dma() argument
664 nvme_free_dma_common(dma); in nvme_free_dma()
665 kmem_free(dma, sizeof (*dma)); in nvme_free_dma()
672 nvme_dma_t *dma = (nvme_dma_t *)buf; in nvme_prp_dma_destructor() local
674 nvme_free_dma_common(dma); in nvme_prp_dma_destructor()
678 nvme_alloc_dma_common(nvme_t *nvme, nvme_dma_t *dma, in nvme_alloc_dma_common() argument
682 &dma->nd_dmah) != DDI_SUCCESS) { in nvme_alloc_dma_common()
697 (void) ddi_dma_mem_alloc(dma->nd_dmah, len, &nvme->n_reg_acc_attr, in nvme_alloc_dma_common()
698 DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, &dma->nd_memp, in nvme_alloc_dma_common()
699 &dma->nd_len, &dma->nd_acch); in nvme_alloc_dma_common()
701 if (ddi_dma_addr_bind_handle(dma->nd_dmah, NULL, dma->nd_memp, in nvme_alloc_dma_common()
702 dma->nd_len, flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, in nvme_alloc_dma_common()
703 &dma->nd_cookie, &dma->nd_ncookie) != DDI_DMA_MAPPED) { in nvme_alloc_dma_common()
707 nvme_free_dma_common(dma); in nvme_alloc_dma_common()
718 nvme_dma_t *dma = kmem_zalloc(sizeof (nvme_dma_t), KM_SLEEP); in nvme_zalloc_dma() local
720 if (nvme_alloc_dma_common(nvme, dma, len, flags, dma_attr) != in nvme_zalloc_dma()
723 kmem_free(dma, sizeof (nvme_dma_t)); in nvme_zalloc_dma()
727 bzero(dma->nd_memp, dma->nd_len); in nvme_zalloc_dma()
729 *ret = dma; in nvme_zalloc_dma()
737 nvme_dma_t *dma = (nvme_dma_t *)buf; in nvme_prp_dma_constructor() local
740 dma->nd_dmah = NULL; in nvme_prp_dma_constructor()
741 dma->nd_acch = NULL; in nvme_prp_dma_constructor()
743 if (nvme_alloc_dma_common(nvme, dma, nvme->n_pagesize, in nvme_prp_dma_constructor()
748 ASSERT(dma->nd_ncookie == 1); in nvme_prp_dma_constructor()
750 dma->nd_cached = B_TRUE; in nvme_prp_dma_constructor()
757 uint_t flags, nvme_dma_t **dma) in nvme_zalloc_queue_dma() argument
766 if (nvme_zalloc_dma(nvme, len, flags, &q_dma_attr, dma) in nvme_zalloc_queue_dma()
773 if ((*dma)->nd_ncookie != 1) { in nvme_zalloc_queue_dma()
782 if (*dma) { in nvme_zalloc_queue_dma()
783 nvme_free_dma(*dma); in nvme_zalloc_queue_dma()
784 *dma = NULL; in nvme_zalloc_queue_dma()