Lines Matching refs:ntwdt_ptr

144 static void ntwdt_start_timer(ntwdt_state_t *ntwdt_ptr);
240 ntwdt_state_t *ntwdt_ptr = NULL; /* pointer to ntwdt_runstatep */ in ntwdt_attach() local
265 ntwdt_ptr = ddi_get_soft_state(ntwdt_statep, instance); in ntwdt_attach()
266 ASSERT(ntwdt_ptr != NULL); in ntwdt_attach()
270 ntwdt_ptr->ntwdt_dip = dip; in ntwdt_attach()
271 ntwdt_ptr->ntwdt_cycl_id = CYCLIC_NONE; in ntwdt_attach()
272 mutex_init(&ntwdt_ptr->ntwdt_mutex, NULL, in ntwdt_attach()
278 ntwdt_ptr->ntwdt_run_state = in ntwdt_attach()
280 ntwdt_runstatep = ntwdt_ptr->ntwdt_run_state; in ntwdt_attach()
305 NULL, NULL, ntwdt_cyclic_softint, (caddr_t)ntwdt_ptr) in ntwdt_attach()
335 ntwdt_ptr->ntwdt_run_state = NULL; in ntwdt_attach()
336 mutex_destroy(&ntwdt_ptr->ntwdt_mutex); in ntwdt_attach()
380 ntwdt_state_t *ntwdt_ptr = NULL; in ntwdt_detach() local
382 ntwdt_ptr = ddi_get_soft_state(ntwdt_statep, instance); in ntwdt_detach()
383 if (ntwdt_ptr == NULL) { in ntwdt_detach()
397 ntwdt_stop_timer_lock((void *)ntwdt_ptr); in ntwdt_detach()
401 &ntwdt_ptr->ntwdt_run_state->ntwdt_runstate_mutex); in ntwdt_detach()
402 kmem_free(ntwdt_ptr->ntwdt_run_state, in ntwdt_detach()
404 ntwdt_ptr->ntwdt_run_state = NULL; in ntwdt_detach()
406 mutex_destroy(&ntwdt_ptr->ntwdt_mutex); in ntwdt_detach()
424 ntwdt_state_t *ntwdt_ptr = getstate(instance); in ntwdt_open() local
426 if (ntwdt_ptr == NULL) { in ntwdt_open()
437 mutex_enter(&ntwdt_ptr->ntwdt_mutex); in ntwdt_open()
438 if (ntwdt_ptr->ntwdt_open_flag) { in ntwdt_open()
441 ntwdt_ptr->ntwdt_open_flag = 1; in ntwdt_open()
443 mutex_exit(&ntwdt_ptr->ntwdt_mutex); in ntwdt_open()
453 ntwdt_state_t *ntwdt_ptr = getstate(instance); in ntwdt_close() local
455 if (ntwdt_ptr == NULL) { in ntwdt_close()
459 mutex_enter(&ntwdt_ptr->ntwdt_mutex); in ntwdt_close()
460 ntwdt_ptr->ntwdt_open_flag = 0; in ntwdt_close()
461 mutex_exit(&ntwdt_ptr->ntwdt_mutex); in ntwdt_close()
473 ntwdt_state_t *ntwdt_ptr = NULL; in ntwdt_ioctl() local
479 if ((ntwdt_ptr = getstate(instance)) == NULL) { in ntwdt_ioctl()
483 ntwdt_state = ntwdt_ptr->ntwdt_run_state; in ntwdt_ioctl()
550 ntwdt_start_timer(ntwdt_ptr); in ntwdt_ioctl()
559 ntwdt_stop_timer(ntwdt_ptr); in ntwdt_ioctl()
652 ntwdt_state_t *ntwdt_ptr = (ntwdt_state_t *)arg; in ntwdt_cyclic_softint() local
655 ntwdt_state = ntwdt_ptr->ntwdt_run_state; in ntwdt_cyclic_softint()
665 (ntwdt_ptr->ntwdt_cycl_id == CYCLIC_NONE) || in ntwdt_cyclic_softint()
699 (void) timeout(ntwdt_stop_timer_lock, ntwdt_ptr, 0); in ntwdt_cyclic_softint()
724 ntwdt_start_timer(ntwdt_state_t *ntwdt_ptr) in ntwdt_start_timer() argument
726 ntwdt_runstate_t *ntwdt_state = ntwdt_ptr->ntwdt_run_state; in ntwdt_start_timer()
740 if (ntwdt_ptr->ntwdt_cycl_id == CYCLIC_NONE) { in ntwdt_start_timer()
741 ntwdt_ptr->ntwdt_cycl_id = cyclic_add(hdlr, when); in ntwdt_start_timer()
751 ntwdt_state_t *ntwdt_ptr = (ntwdt_state_t *)arg; in ntwdt_stop_timer() local
752 ntwdt_runstate_t *ntwdt_state = ntwdt_ptr->ntwdt_run_state; in ntwdt_stop_timer()
755 if (ntwdt_ptr->ntwdt_cycl_id != CYCLIC_NONE) { in ntwdt_stop_timer()
756 cyclic_remove(ntwdt_ptr->ntwdt_cycl_id); in ntwdt_stop_timer()
762 ntwdt_ptr->ntwdt_cycl_id = CYCLIC_NONE; in ntwdt_stop_timer()
774 ntwdt_state_t *ntwdt_ptr = (ntwdt_state_t *)arg; in ntwdt_stop_timer_lock() local
776 mutex_enter(&ntwdt_ptr->ntwdt_run_state->ntwdt_runstate_mutex); in ntwdt_stop_timer_lock()
778 mutex_exit(&ntwdt_ptr->ntwdt_run_state->ntwdt_runstate_mutex); in ntwdt_stop_timer_lock()