Lines Matching refs:debug_data

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