Lines Matching defs:dma

495 nvme_check_dma_hdl(nvme_dma_t *dma)
499 if (dma == NULL)
502 ddi_fm_dma_err_get(dma->nd_dmah, &error, DDI_FME_VERSION);
511 nvme_free_dma_common(nvme_dma_t *dma)
513 if (dma->nd_dmah != NULL)
514 (void) ddi_dma_unbind_handle(dma->nd_dmah);
515 if (dma->nd_acch != NULL)
516 ddi_dma_mem_free(&dma->nd_acch);
517 if (dma->nd_dmah != NULL)
518 ddi_dma_free_handle(&dma->nd_dmah);
522 nvme_free_dma(nvme_dma_t *dma)
524 nvme_free_dma_common(dma);
525 kmem_free(dma, sizeof (*dma));
532 nvme_dma_t *dma = (nvme_dma_t *)buf;
534 nvme_free_dma_common(dma);
538 nvme_alloc_dma_common(nvme_t *nvme, nvme_dma_t *dma,
542 &dma->nd_dmah) != DDI_SUCCESS) {
557 (void) ddi_dma_mem_alloc(dma->nd_dmah, len, &nvme->n_reg_acc_attr,
558 DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, &dma->nd_memp,
559 &dma->nd_len, &dma->nd_acch);
561 if (ddi_dma_addr_bind_handle(dma->nd_dmah, NULL, dma->nd_memp,
562 dma->nd_len, flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL,
563 &dma->nd_cookie, &dma->nd_ncookie) != DDI_DMA_MAPPED) {
567 nvme_free_dma_common(dma);
578 nvme_dma_t *dma = kmem_zalloc(sizeof (nvme_dma_t), KM_SLEEP);
580 if (nvme_alloc_dma_common(nvme, dma, len, flags, dma_attr) !=
583 kmem_free(dma, sizeof (nvme_dma_t));
587 bzero(dma->nd_memp, dma->nd_len);
589 *ret = dma;
597 nvme_dma_t *dma = (nvme_dma_t *)buf;
600 dma->nd_dmah = NULL;
601 dma->nd_acch = NULL;
603 if (nvme_alloc_dma_common(nvme, dma, nvme->n_pagesize,
608 ASSERT(dma->nd_ncookie == 1);
610 dma->nd_cached = B_TRUE;
617 uint_t flags, nvme_dma_t **dma)
626 if (nvme_zalloc_dma(nvme, len, flags, &q_dma_attr, dma)
633 if ((*dma)->nd_ncookie != 1) {
642 if (*dma) {
643 nvme_free_dma(*dma);
644 *dma = NULL;