Lines Matching defs:busp

245 static void hpc_slot_event_dispatcher(hpc_bus_entry_t *busp);
322 hpc_bus_entry_t *busp;
330 busp = hpc_find_bus_by_name(bus_path);
331 if (busp == NULL) {
338 busp = hpc_alloc_bus_entry();
339 busp->bus_dip = dip;
340 busp->bus_registered = B_TRUE;
341 (void) strcpy(busp->bus_name, bus_path);
342 mutex_init(&busp->bus_mutex, NULL, MUTEX_DRIVER, NULL);
343 busp->bus_callback = callback;
344 busp->bus_slot_list = NULL;
345 busp->bus_next = hpc_bus_list_head;
346 hpc_bus_list_head = busp;
356 mutex_enter(&busp->bus_mutex);
357 if (busp->bus_registered == B_TRUE) {
358 mutex_exit(&busp->bus_mutex);
362 busp->bus_dip = dip;
363 busp->bus_callback = callback;
364 busp->bus_registered = B_TRUE;
366 mutex_exit(&busp->bus_mutex);
370 for (slotp = busp->bus_slot_list; slotp;
386 hpc_bus_entry_t *busp, *busp_prev;
395 for (busp = hpc_bus_list_head; busp != NULL; busp_prev = busp,
396 busp = busp->bus_next) {
397 if (busp->bus_dip == dip)
400 if (busp == NULL) {
409 mutex_enter(&busp->bus_mutex);
410 if (busp->bus_slot_list == NULL) {
411 if (busp == hpc_bus_list_head)
412 hpc_bus_list_head = busp->bus_next;
414 busp_prev->bus_next = busp->bus_next;
415 mutex_exit(&busp->bus_mutex);
416 mutex_destroy(&busp->bus_mutex);
417 hpc_free_bus_entry(busp);
425 for (slotp = busp->bus_slot_list; slotp != NULL;
430 busp->bus_registered = B_FALSE;
431 mutex_exit(&busp->bus_mutex);
443 hpc_bus_entry_t *busp;
464 busp = hpc_find_bus_by_name(bus);
465 if (busp == NULL) {
472 busp = hpc_alloc_bus_entry();
473 busp->bus_registered = B_FALSE;
474 (void) strcpy(busp->bus_name, bus);
475 mutex_init(&busp->bus_mutex, NULL, MUTEX_DRIVER, NULL);
476 busp->bus_slot_list = NULL;
477 busp->bus_next = hpc_bus_list_head;
478 hpc_bus_list_head = busp;
481 if (busp->bus_registered == B_TRUE) {
483 callback = busp->bus_callback;
484 dip = busp->bus_dip;
488 mutex_enter(&busp->bus_mutex);
489 slot_list_head = busp->bus_slot_list;
498 cv_init(&busp->bus_thread_cv, NULL, CV_DRIVER, NULL);
499 busp->bus_thread_exit = B_FALSE;
501 (caddr_t)busp, 0, &p0, TS_RUN, minclsyspri);
502 busp->bus_thread = t;
513 slotp->slot_bus = busp;
516 busp->bus_slot_list = slotp;
520 mutex_exit(&busp->bus_mutex);
551 hpc_bus_entry_t *busp, *busp_prev;
573 busp = slotp->slot_bus;
575 if (busp == NULL) {
584 callback = busp->bus_callback;
585 run_callback = (busp->bus_registered == B_TRUE) && (callback != NULL);
586 dip = busp->bus_dip;
587 bus_name = busp->bus_name;
606 mutex_enter(&busp->bus_mutex);
608 busp->bus_slot_list);
613 if (slotp == busp->bus_slot_list)
614 busp->bus_slot_list = slotp->slot_next;
627 if (busp->bus_slot_list == NULL) {
629 busp->bus_thread_exit = B_TRUE;
630 cv_signal(&busp->bus_thread_cv);
632 cv_wait(&busp->bus_thread_cv, &busp->bus_mutex);
634 cv_destroy(&busp->bus_thread_cv);
641 if (busp->bus_registered == B_FALSE && busp->bus_slot_list == NULL) {
643 for (busp = hpc_bus_list_head; busp != NULL; busp_prev = busp,
644 busp = busp->bus_next)
645 if (strcmp(bus_name, busp->bus_name) == 0)
648 if (busp == hpc_bus_list_head)
649 hpc_bus_list_head = busp->bus_next;
651 busp_prev->bus_next = busp->bus_next;
653 mutex_exit(&busp->bus_mutex);
654 mutex_destroy(&busp->bus_mutex);
655 hpc_free_bus_entry(busp);
657 mutex_exit(&busp->bus_mutex);
673 hpc_bus_entry_t *busp;
679 busp = slotp->slot_bus;
681 mutex_enter(&busp->bus_mutex);
685 mutex_exit(&busp->bus_mutex);
694 hpc_bus_entry_t *busp;
700 busp = slotp->slot_bus;
701 mutex_enter(&busp->bus_mutex);
705 mutex_exit(&busp->bus_mutex);
715 hpc_bus_entry_t *busp;
742 busp = slotp->slot_bus;
743 mutex_enter(&busp->bus_mutex);
745 if (busp->bus_slot_event_list_head == NULL) {
746 eventp = busp->bus_slot_event_list_head =
749 for (eventp = busp->bus_slot_event_list_head;
758 DEBUG2("hpc_slot_event_notify: busp=%x event=%x", busp, event);
759 cv_signal(&busp->bus_thread_cv);
760 mutex_exit(&busp->bus_mutex);
839 hpc_slot_event_dispatcher(hpc_bus_entry_t *busp)
852 DEBUG1("hpc_slot_event_dispatcher: busp=%x", busp);
854 CALLB_CPR_INIT(&cprinfo, &busp->bus_mutex, callb_generic_cpr,
857 mutex_enter(&busp->bus_mutex);
869 if (busp->bus_slot_event_list_head == NULL) {
871 cv_wait(&busp->bus_thread_cv, &busp->bus_mutex);
872 CALLB_CPR_SAFE_END(&cprinfo, &busp->bus_mutex);
873 if (busp->bus_thread_exit)
885 eventp = busp->bus_slot_event_list_head;
890 busp->bus_slot_event_list_head = eventp->next;
892 mutex_exit(&busp->bus_mutex);
894 mutex_enter(&busp->bus_mutex);
896 if (busp->bus_thread_exit)
901 cv_signal(&busp->bus_thread_cv);
910 hpc_bus_entry_t *busp;
912 for (busp = hpc_bus_list_head; busp != NULL; busp = busp->bus_next) {
913 if (strcmp(path, busp->bus_name) == 0)
916 return (busp);
923 hpc_bus_entry_t *busp;
926 busp = slotp->slot_bus;
927 return (busp->bus_registered);