Lines Matching refs:debug_data
34 static void smsdvb_print_dvb_stats(struct smsdvb_debugfs *debug_data, in smsdvb_print_dvb_stats() argument
40 spin_lock(&debug_data->lock); in smsdvb_print_dvb_stats()
41 if (debug_data->stats_count) { in smsdvb_print_dvb_stats()
42 spin_unlock(&debug_data->lock); in smsdvb_print_dvb_stats()
46 buf = debug_data->stats_data; in smsdvb_print_dvb_stats()
132 debug_data->stats_count = n; in smsdvb_print_dvb_stats()
133 spin_unlock(&debug_data->lock); in smsdvb_print_dvb_stats()
134 wake_up(&debug_data->stats_queue); in smsdvb_print_dvb_stats()
137 static void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data, in smsdvb_print_isdb_stats() argument
143 spin_lock(&debug_data->lock); in smsdvb_print_isdb_stats()
144 if (debug_data->stats_count) { in smsdvb_print_isdb_stats()
145 spin_unlock(&debug_data->lock); in smsdvb_print_isdb_stats()
149 buf = debug_data->stats_data; in smsdvb_print_isdb_stats()
225 debug_data->stats_count = n; in smsdvb_print_isdb_stats()
226 spin_unlock(&debug_data->lock); in smsdvb_print_isdb_stats()
227 wake_up(&debug_data->stats_queue); in smsdvb_print_isdb_stats()
230 static void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data, in smsdvb_print_isdb_stats_ex() argument
236 spin_lock(&debug_data->lock); in smsdvb_print_isdb_stats_ex()
237 if (debug_data->stats_count) { in smsdvb_print_isdb_stats_ex()
238 spin_unlock(&debug_data->lock); in smsdvb_print_isdb_stats_ex()
242 buf = debug_data->stats_data; in smsdvb_print_isdb_stats_ex()
321 debug_data->stats_count = n; in smsdvb_print_isdb_stats_ex()
322 spin_unlock(&debug_data->lock); in smsdvb_print_isdb_stats_ex()
324 wake_up(&debug_data->stats_queue); in smsdvb_print_isdb_stats_ex()
330 struct smsdvb_debugfs *debug_data = client->debug_data; in smsdvb_stats_open() local
332 kref_get(&debug_data->refcount); in smsdvb_stats_open()
334 spin_lock(&debug_data->lock); in smsdvb_stats_open()
335 debug_data->stats_count = 0; in smsdvb_stats_open()
336 debug_data->stats_was_read = false; in smsdvb_stats_open()
337 spin_unlock(&debug_data->lock); in smsdvb_stats_open()
339 file->private_data = debug_data; in smsdvb_stats_open()
346 struct smsdvb_debugfs *debug_data; in smsdvb_debugfs_data_release() local
348 debug_data = container_of(ref, struct smsdvb_debugfs, refcount); in smsdvb_debugfs_data_release()
349 kfree(debug_data); in smsdvb_debugfs_data_release()
352 static int smsdvb_stats_wait_read(struct smsdvb_debugfs *debug_data) in smsdvb_stats_wait_read() argument
356 spin_lock(&debug_data->lock); in smsdvb_stats_wait_read()
358 if (debug_data->stats_was_read) in smsdvb_stats_wait_read()
361 rc = debug_data->stats_count; in smsdvb_stats_wait_read()
364 spin_unlock(&debug_data->lock); in smsdvb_stats_wait_read()
370 struct smsdvb_debugfs *debug_data = file->private_data; in smsdvb_stats_poll() local
373 kref_get(&debug_data->refcount); in smsdvb_stats_poll()
375 poll_wait(file, &debug_data->stats_queue, wait); in smsdvb_stats_poll()
377 rc = smsdvb_stats_wait_read(debug_data); in smsdvb_stats_poll()
378 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); in smsdvb_stats_poll()
387 struct smsdvb_debugfs *debug_data = file->private_data; in smsdvb_stats_read() local
389 kref_get(&debug_data->refcount); in smsdvb_stats_read()
392 rc = smsdvb_stats_wait_read(debug_data); in smsdvb_stats_read()
398 rc = wait_event_interruptible(debug_data->stats_queue, in smsdvb_stats_read()
399 smsdvb_stats_wait_read(debug_data)); in smsdvb_stats_read()
404 if (debug_data->stats_was_read) { in smsdvb_stats_read()
409 len = debug_data->stats_count - *ppos; in smsdvb_stats_read()
412 debug_data->stats_data, len); in smsdvb_stats_read()
416 if (*ppos >= debug_data->stats_count) { in smsdvb_stats_read()
417 spin_lock(&debug_data->lock); in smsdvb_stats_read()
418 debug_data->stats_was_read = true; in smsdvb_stats_read()
419 spin_unlock(&debug_data->lock); in smsdvb_stats_read()
422 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); in smsdvb_stats_read()
428 struct smsdvb_debugfs *debug_data = file->private_data; in smsdvb_stats_release() local
430 spin_lock(&debug_data->lock); in smsdvb_stats_release()
431 debug_data->stats_was_read = true; /* return EOF to read() */ in smsdvb_stats_release()
432 spin_unlock(&debug_data->lock); in smsdvb_stats_release()
433 wake_up_interruptible_sync(&debug_data->stats_queue); in smsdvb_stats_release()
435 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); in smsdvb_stats_release()
457 struct smsdvb_debugfs *debug_data; in smsdvb_debugfs_create() local
477 debug_data = kzalloc(sizeof(*client->debug_data), GFP_KERNEL); in smsdvb_debugfs_create()
478 if (!debug_data) in smsdvb_debugfs_create()
481 client->debug_data = debug_data; in smsdvb_debugfs_create()
486 init_waitqueue_head(&debug_data->stats_queue); in smsdvb_debugfs_create()
487 spin_lock_init(&debug_data->lock); in smsdvb_debugfs_create()
488 kref_init(&debug_data->refcount); in smsdvb_debugfs_create()
503 kref_put(&client->debug_data->refcount, smsdvb_debugfs_data_release); in smsdvb_debugfs_release()
505 client->debug_data = NULL; in smsdvb_debugfs_release()