Lines Matching refs:n2rng
46 n2rng_ksinit(n2rng_t *n2rng) in n2rng_ksinit() argument
53 if (ddi_getprop(DDI_DEV_T_ANY, n2rng->n_dip, in n2rng_ksinit()
62 instance = ddi_get_instance(n2rng->n_dip); in n2rng_ksinit()
67 n2rng->n_ksp = kstat_create(DRIVER, instance, NULL, "misc", in n2rng_ksinit()
71 if (n2rng->n_ksp == NULL) { in n2rng_ksinit()
72 n2rng_error(n2rng, "unable to create kstats"); in n2rng_ksinit()
74 n2rng_stat_t *dkp = (n2rng_stat_t *)n2rng->n_ksp->ks_data; in n2rng_ksinit()
83 if (n2rng_iscontrol(n2rng)) { in n2rng_ksinit()
85 for (i = 0; i < n2rng->n_ctl_data->n_num_rngs; i++) { in n2rng_ksinit()
103 n2rng->n_ksp->ks_update = n2rng_ksupdate; in n2rng_ksinit()
104 n2rng->n_ksp->ks_private = n2rng; in n2rng_ksinit()
106 kstat_install(n2rng->n_ksp); in n2rng_ksinit()
114 n2rng_ksdeinit(n2rng_t *n2rng) in n2rng_ksdeinit() argument
117 if (n2rng->n_ksp != NULL) { in n2rng_ksdeinit()
118 kstat_delete(n2rng->n_ksp); in n2rng_ksdeinit()
119 n2rng->n_ksp = NULL; in n2rng_ksdeinit()
129 n2rng_t *n2rng; in n2rng_ksupdate() local
134 n2rng = (n2rng_t *)ksp->ks_private; in n2rng_ksupdate()
139 n2rng->n_stats[i] = dkp->ns_algs[i].value.ull; in n2rng_ksupdate()
143 if (n2rng_isfailed(n2rng)) { in n2rng_ksupdate()
146 } else if (!n2rng_isconfigured(n2rng)) { in n2rng_ksupdate()
155 dkp->ns_algs[i].value.ull = n2rng->n_stats[i]; in n2rng_ksupdate()
158 if (n2rng_iscontrol(n2rng)) { in n2rng_ksupdate()
161 for (i = 0; i < n2rng->n_ctl_data->n_num_rngs; i++) { in n2rng_ksupdate()
163 rng = &n2rng->n_ctl_data->n_rngs[i]; in n2rng_ksupdate()