Lines Matching refs:device
155 static void dcopy_device_cleanup(dcopy_device_handle_t device,
328 dcopy_device_handle_t device; in dcopy_free() local
349 device = (*channel)->ch_device; in dcopy_free()
350 mutex_enter(&device->dc_devchan_list.dl_mutex); in dcopy_free()
351 device->dc_removing_cnt--; in dcopy_free()
352 if (device->dc_removing_cnt == 0) { in dcopy_free()
355 mutex_exit(&device->dc_devchan_list.dl_mutex); in dcopy_free()
365 dcopy_device_cleanup(device, B_TRUE); in dcopy_free()
605 struct dcopy_device_s *device; in dcopy_device_register() local
611 device = kmem_zalloc(sizeof (*device), KM_SLEEP); in dcopy_device_register()
612 device->dc_device_private = device_private; in dcopy_device_register()
613 device->dc_info = *info; in dcopy_device_register()
614 device->dc_removing_cnt = 0; in dcopy_device_register()
615 device->dc_cb = info->di_cb; in dcopy_device_register()
621 e = dcopy_list_init(&device->dc_devchan_list, in dcopy_device_register()
634 channel->ch_device = device; in dcopy_device_register()
666 dcopy_list_push(&device->dc_devchan_list, channel); in dcopy_device_register()
670 dcopy_list_push(&dcopy_statep->d_device_list, device); in dcopy_device_register()
678 channel = list_head(&device->dc_devchan_list.dl_list); in dcopy_device_register()
683 channel = list_next(&device->dc_devchan_list.dl_list, channel); in dcopy_device_register()
688 *handle = device; in dcopy_device_register()
696 channel = list_head(&device->dc_devchan_list.dl_list); in dcopy_device_register()
699 channel = dcopy_list_pop(&device->dc_devchan_list); in dcopy_device_register()
708 dcopy_list_fini(&device->dc_devchan_list); in dcopy_device_register()
710 kmem_free(device, sizeof (*device)); in dcopy_device_register()
724 dcopy_device_handle_t device; in dcopy_device_unregister() local
730 device = *handle; in dcopy_device_unregister()
738 mutex_enter(&device->dc_devchan_list.dl_mutex); in dcopy_device_unregister()
739 channel = list_head(&device->dc_devchan_list.dl_list); in dcopy_device_unregister()
749 device->dc_removing_cnt++; in dcopy_device_unregister()
753 channel = list_next(&device->dc_devchan_list.dl_list, channel); in dcopy_device_unregister()
755 mutex_exit(&device->dc_devchan_list.dl_mutex); in dcopy_device_unregister()
766 dcopy_device_cleanup(device, B_FALSE); in dcopy_device_unregister()
777 dcopy_device_cleanup(dcopy_device_handle_t device, boolean_t do_callback) in dcopy_device_cleanup() argument
786 channel = list_head(&device->dc_devchan_list.dl_list); in dcopy_device_cleanup()
788 device->dc_devchan_list.dl_cnt--; in dcopy_device_cleanup()
789 list_remove(&device->dc_devchan_list.dl_list, channel); in dcopy_device_cleanup()
794 channel = list_head(&device->dc_devchan_list.dl_list); in dcopy_device_cleanup()
798 list_remove(&dcopy_statep->d_device_list.dl_list, device); in dcopy_device_cleanup()
807 device->dc_cb->cb_unregister_complete( in dcopy_device_cleanup()
808 device->dc_device_private, DCOPY_SUCCESS); in dcopy_device_cleanup()
811 dcopy_list_fini(&device->dc_devchan_list); in dcopy_device_cleanup()
812 kmem_free(device, sizeof (*device)); in dcopy_device_cleanup()