Lines Matching defs:drctlp

149 static struct drctl_unit *drctlp = &drctl_state;
156 drctlp->drc_inst = -1;
157 mutex_init(&drctlp->drc_lock, NULL, MUTEX_DRIVER, NULL);
158 cv_init(&drctlp->drc_busy_cv, NULL, CV_DRIVER, NULL);
161 mutex_destroy(&drctlp->drc_lock);
174 cv_destroy(&drctlp->drc_busy_cv);
175 mutex_destroy(&drctlp->drc_lock);
198 if (drctlp->drc_inst != -1) {
202 drctlp->drc_inst = ddi_get_instance(dip);
205 drctlp->drc_inst, DDI_PSEUDO, 0);
208 drctlp->drc_inst = -1;
212 drctlp->drc_dip = dip;
238 drctlp->drc_inst = -1;
461 mutex_enter(&drctlp->drc_lock);
462 if (drctlp->drc_busy != NULL) {
463 mutex_exit(&drctlp->drc_lock);
473 drctlp->drc_busy = (drctl_cookie_t)-1;
474 mutex_exit(&drctlp->drc_lock);
488 drctlp->drc_busy = NULL;
489 cv_broadcast(&drctlp->drc_busy_cv);
491 drctlp->drc_busy = ck;
492 drctlp->drc_cmd = cmd;
493 drctlp->drc_flags = flags;
510 drctlp->drc_cmd = -1;
511 drctlp->drc_flags = 0;
512 drctlp->drc_busy = NULL;
513 cv_broadcast(&drctlp->drc_busy_cv);
529 mutex_enter(&drctlp->drc_lock);
530 if (drctlp->drc_busy != ck) {
531 mutex_exit(&drctlp->drc_lock);
534 mutex_exit(&drctlp->drc_lock);
536 flags = drctlp->drc_flags;
541 switch (drctlp->drc_cmd) {
570 "drctl_config_fini: bad cmd %d\n", drctlp->drc_cmd);
579 drctlp->drc_cmd = -1;
580 drctlp->drc_flags = 0;
581 drctlp->drc_busy = NULL;
582 cv_broadcast(&drctlp->drc_busy_cv);
707 mutex_enter(&drctlp->drc_lock);
709 if (!should_block && drctlp->drc_busy != NULL) {
710 mutex_exit(&drctlp->drc_lock);
715 while (drctlp->drc_busy != NULL)
716 (void) cv_wait_sig(&drctlp->drc_busy_cv, &drctlp->drc_lock);
719 drctlp->drc_busy = (drctl_cookie_t)-1;
720 drctlp->drc_cmd = DRCTL_DRC_BLOCK;
721 drctlp->drc_flags = 0;
722 mutex_exit(&drctlp->drc_lock);
752 mutex_enter(&drctlp->drc_lock);
753 drctlp->drc_cmd = -1;
754 drctlp->drc_flags = 0;
755 drctlp->drc_busy = NULL;
756 cv_broadcast(&drctlp->drc_busy_cv);
757 mutex_exit(&drctlp->drc_lock);