Lines Matching refs:fmhdl

344 	struct i_ddi_fmhdl	*fmhdl = NULL;  in fm_dev_ereport_postv()  local
382 fmhdl = DEVI(eqdip)->devi_fmhdl; in fm_dev_ereport_postv()
383 ASSERT(fmhdl); in fm_dev_ereport_postv()
384 eqep = errorq_reserve(fmhdl->fh_errorq); in fm_dev_ereport_postv()
388 ereport = errorq_elem_nvl(fmhdl->fh_errorq, eqep); in fm_dev_ereport_postv()
389 nva = errorq_elem_nva(fmhdl->fh_errorq, eqep); in fm_dev_ereport_postv()
451 errorq_commit(fmhdl->fh_errorq, eqep, ERRORQ_ASYNC); in fm_dev_ereport_postv()
457 err: if (fmhdl) in fm_dev_ereport_postv()
458 atomic_inc_64(&fmhdl->fh_kstat.fek_erpt_dropped.value.ui64); in fm_dev_ereport_postv()
688 struct i_ddi_fmhdl *fmhdl; in ddi_fm_init() local
720 fmhdl = kmem_zalloc(sizeof (struct i_ddi_fmhdl), KM_SLEEP); in ddi_fm_init()
722 if ((fmhdl->fh_ksp = kstat_create((char *)ddi_driver_name(dip), in ddi_fm_init()
726 mutex_destroy(&fmhdl->fh_lock); in ddi_fm_init()
727 kmem_free(fmhdl, sizeof (struct i_ddi_fmhdl)); in ddi_fm_init()
732 bcopy(&ddifm_kstat_template, &fmhdl->fh_kstat, in ddi_fm_init()
734 fmhdl->fh_ksp->ks_data = &fmhdl->fh_kstat; in ddi_fm_init()
735 fmhdl->fh_ksp->ks_private = fmhdl; in ddi_fm_init()
736 kstat_install(fmhdl->fh_ksp); in ddi_fm_init()
738 fmhdl->fh_dma_cache = NULL; in ddi_fm_init()
739 fmhdl->fh_acc_cache = NULL; in ddi_fm_init()
740 fmhdl->fh_tgts = NULL; in ddi_fm_init()
741 fmhdl->fh_dip = dip; in ddi_fm_init()
742 fmhdl->fh_ibc = ibc; in ddi_fm_init()
743 mutex_init(&fmhdl->fh_lock, NULL, MUTEX_DRIVER, fmhdl->fh_ibc); in ddi_fm_init()
744 devi->devi_fmhdl = fmhdl; in ddi_fm_init()
750 fmhdl->fh_errorq = ereport_errorq; in ddi_fm_init()
777 i_ndi_fmc_create(&fmhdl->fh_dma_cache, 2, ibc); in ddi_fm_init()
789 i_ndi_fmc_create(&fmhdl->fh_acc_cache, 2, ibc); in ddi_fm_init()
803 fmhdl->fh_cap = newcap; in ddi_fm_init()
821 struct i_ddi_fmhdl *fmhdl = DEVI(dip)->devi_fmhdl; in ddi_fm_fini() local
823 ASSERT(fmhdl); in ddi_fm_fini()
830 kstat_delete(fmhdl->fh_ksp); in ddi_fm_fini()
832 if (DDI_FM_EREPORT_CAP(fmhdl->fh_cap)) { in ddi_fm_fini()
838 if (DDI_FM_ERRCB_CAP(fmhdl->fh_cap)) { in ddi_fm_fini()
844 if (DDI_FM_DMA_ERR_CAP(fmhdl->fh_cap) || in ddi_fm_fini()
845 DDI_FM_ACC_ERR_CAP(fmhdl->fh_cap)) { in ddi_fm_fini()
846 if (fmhdl->fh_dma_cache != NULL) { in ddi_fm_fini()
847 i_ndi_fmc_destroy(fmhdl->fh_dma_cache); in ddi_fm_fini()
851 if (fmhdl->fh_acc_cache != NULL) { in ddi_fm_fini()
852 i_ndi_fmc_destroy(fmhdl->fh_acc_cache); in ddi_fm_fini()
861 kmem_free(fmhdl, sizeof (struct i_ddi_fmhdl)); in ddi_fm_fini()
873 struct i_ddi_fmhdl *fmhdl = DEVI(dip)->devi_fmhdl; in ddi_fm_capable() local
875 if (fmhdl == NULL) in ddi_fm_capable()
878 return (fmhdl->fh_cap); in ddi_fm_capable()
1017 struct i_ddi_fmhdl *fmhdl = DEVI(hdlp->ah_dip)->devi_fmhdl; in i_ddi_fm_acc_err_set() local
1022 atomic_inc_64(&fmhdl->fh_kstat.fek_acc_err.value.ui64); in i_ddi_fm_acc_err_set()
1030 struct i_ddi_fmhdl *fmhdl = DEVI(hdlp->dmai_rdip)->devi_fmhdl; in i_ddi_fm_dma_err_set() local
1035 atomic_inc_64(&fmhdl->fh_kstat.fek_dma_err.value.ui64); in i_ddi_fm_dma_err_set()