Lines Matching defs: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;
91 debug_data->stats_count = n;
92 spin_unlock(&debug_data->lock);
93 wake_up(&debug_data->stats_queue);
96 static void smsdvb_print_isdb_stats(struct smsdvb_debugfs *debug_data,
102 spin_lock(&debug_data->lock);
103 if (debug_data->stats_count) {
104 spin_unlock(&debug_data->lock);
108 buf = debug_data->stats_data;
155 debug_data->stats_count = n;
156 spin_unlock(&debug_data->lock);
157 wake_up(&debug_data->stats_queue);
160 static void smsdvb_print_isdb_stats_ex(struct smsdvb_debugfs *debug_data,
166 spin_lock(&debug_data->lock);
167 if (debug_data->stats_count) {
168 spin_unlock(&debug_data->lock);
172 buf = debug_data->stats_data;
221 debug_data->stats_count = n;
222 spin_unlock(&debug_data->lock);
224 wake_up(&debug_data->stats_queue);
230 struct smsdvb_debugfs *debug_data = client->debug_data;
232 kref_get(&debug_data->refcount);
234 spin_lock(&debug_data->lock);
235 debug_data->stats_count = 0;
236 debug_data->stats_was_read = false;
237 spin_unlock(&debug_data->lock);
239 file->private_data = debug_data;
246 struct smsdvb_debugfs *debug_data;
248 debug_data = container_of(ref, struct smsdvb_debugfs, refcount);
249 kfree(debug_data);
252 static int smsdvb_stats_wait_read(struct smsdvb_debugfs *debug_data)
256 spin_lock(&debug_data->lock);
258 if (debug_data->stats_was_read)
261 rc = debug_data->stats_count;
264 spin_unlock(&debug_data->lock);
270 struct smsdvb_debugfs *debug_data = file->private_data;
273 kref_get(&debug_data->refcount);
275 poll_wait(file, &debug_data->stats_queue, wait);
277 rc = smsdvb_stats_wait_read(debug_data);
278 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
287 struct smsdvb_debugfs *debug_data = file->private_data;
289 kref_get(&debug_data->refcount);
292 rc = smsdvb_stats_wait_read(debug_data);
298 rc = wait_event_interruptible(debug_data->stats_queue,
299 smsdvb_stats_wait_read(debug_data));
304 if (debug_data->stats_was_read) {
309 len = debug_data->stats_count - *ppos;
312 debug_data->stats_data, len);
316 if (*ppos >= debug_data->stats_count) {
317 spin_lock(&debug_data->lock);
318 debug_data->stats_was_read = true;
319 spin_unlock(&debug_data->lock);
322 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
328 struct smsdvb_debugfs *debug_data = file->private_data;
330 spin_lock(&debug_data->lock);
331 debug_data->stats_was_read = true; /* return EOF to read() */
332 spin_unlock(&debug_data->lock);
333 wake_up_interruptible_sync(&debug_data->stats_queue);
335 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
356 struct smsdvb_debugfs *debug_data;
361 debug_data = kzalloc(sizeof(*client->debug_data), GFP_KERNEL);
362 if (!debug_data)
371 client->debug_data = debug_data;
376 init_waitqueue_head(&debug_data->stats_queue);
377 spin_lock_init(&debug_data->lock);
378 kref_init(&debug_data->refcount);
393 kref_put(&client->debug_data->refcount, smsdvb_debugfs_data_release);
395 client->debug_data = NULL;