33
33
#include "card_base.h"
34
34
#include "card_ddcb.h"
35
35
36
- #define GENWQE_DEBUGFS_RO (_name , _showfn ) \
37
- static int genwqe_debugfs_##_name##_open(struct inode *inode, \
38
- struct file *file) \
39
- { \
40
- return single_open(file, _showfn, inode->i_private); \
41
- } \
42
- static const struct file_operations genwqe_##_name##_fops = { \
43
- .open = genwqe_debugfs_##_name##_open, \
44
- .read = seq_read, \
45
- .llseek = seq_lseek, \
46
- .release = single_release, \
47
- }
48
-
49
36
static void dbg_uidn_show (struct seq_file * s , struct genwqe_reg * regs ,
50
37
int entries )
51
38
{
@@ -87,26 +74,26 @@ static int curr_dbg_uidn_show(struct seq_file *s, void *unused, int uid)
87
74
return 0 ;
88
75
}
89
76
90
- static int genwqe_curr_dbg_uid0_show (struct seq_file * s , void * unused )
77
+ static int curr_dbg_uid0_show (struct seq_file * s , void * unused )
91
78
{
92
79
return curr_dbg_uidn_show (s , unused , 0 );
93
80
}
94
81
95
- GENWQE_DEBUGFS_RO (curr_dbg_uid0 , genwqe_curr_dbg_uid0_show );
82
+ DEFINE_SHOW_ATTRIBUTE (curr_dbg_uid0 );
96
83
97
- static int genwqe_curr_dbg_uid1_show (struct seq_file * s , void * unused )
84
+ static int curr_dbg_uid1_show (struct seq_file * s , void * unused )
98
85
{
99
86
return curr_dbg_uidn_show (s , unused , 1 );
100
87
}
101
88
102
- GENWQE_DEBUGFS_RO (curr_dbg_uid1 , genwqe_curr_dbg_uid1_show );
89
+ DEFINE_SHOW_ATTRIBUTE (curr_dbg_uid1 );
103
90
104
- static int genwqe_curr_dbg_uid2_show (struct seq_file * s , void * unused )
91
+ static int curr_dbg_uid2_show (struct seq_file * s , void * unused )
105
92
{
106
93
return curr_dbg_uidn_show (s , unused , 2 );
107
94
}
108
95
109
- GENWQE_DEBUGFS_RO (curr_dbg_uid2 , genwqe_curr_dbg_uid2_show );
96
+ DEFINE_SHOW_ATTRIBUTE (curr_dbg_uid2 );
110
97
111
98
static int prev_dbg_uidn_show (struct seq_file * s , void * unused , int uid )
112
99
{
@@ -116,28 +103,28 @@ static int prev_dbg_uidn_show(struct seq_file *s, void *unused, int uid)
116
103
return 0 ;
117
104
}
118
105
119
- static int genwqe_prev_dbg_uid0_show (struct seq_file * s , void * unused )
106
+ static int prev_dbg_uid0_show (struct seq_file * s , void * unused )
120
107
{
121
108
return prev_dbg_uidn_show (s , unused , 0 );
122
109
}
123
110
124
- GENWQE_DEBUGFS_RO (prev_dbg_uid0 , genwqe_prev_dbg_uid0_show );
111
+ DEFINE_SHOW_ATTRIBUTE (prev_dbg_uid0 );
125
112
126
- static int genwqe_prev_dbg_uid1_show (struct seq_file * s , void * unused )
113
+ static int prev_dbg_uid1_show (struct seq_file * s , void * unused )
127
114
{
128
115
return prev_dbg_uidn_show (s , unused , 1 );
129
116
}
130
117
131
- GENWQE_DEBUGFS_RO (prev_dbg_uid1 , genwqe_prev_dbg_uid1_show );
118
+ DEFINE_SHOW_ATTRIBUTE (prev_dbg_uid1 );
132
119
133
- static int genwqe_prev_dbg_uid2_show (struct seq_file * s , void * unused )
120
+ static int prev_dbg_uid2_show (struct seq_file * s , void * unused )
134
121
{
135
122
return prev_dbg_uidn_show (s , unused , 2 );
136
123
}
137
124
138
- GENWQE_DEBUGFS_RO (prev_dbg_uid2 , genwqe_prev_dbg_uid2_show );
125
+ DEFINE_SHOW_ATTRIBUTE (prev_dbg_uid2 );
139
126
140
- static int genwqe_curr_regs_show (struct seq_file * s , void * unused )
127
+ static int curr_regs_show (struct seq_file * s , void * unused )
141
128
{
142
129
struct genwqe_dev * cd = s -> private ;
143
130
unsigned int i ;
@@ -164,9 +151,9 @@ static int genwqe_curr_regs_show(struct seq_file *s, void *unused)
164
151
return 0 ;
165
152
}
166
153
167
- GENWQE_DEBUGFS_RO (curr_regs , genwqe_curr_regs_show );
154
+ DEFINE_SHOW_ATTRIBUTE (curr_regs );
168
155
169
- static int genwqe_prev_regs_show (struct seq_file * s , void * unused )
156
+ static int prev_regs_show (struct seq_file * s , void * unused )
170
157
{
171
158
struct genwqe_dev * cd = s -> private ;
172
159
unsigned int i ;
@@ -188,9 +175,9 @@ static int genwqe_prev_regs_show(struct seq_file *s, void *unused)
188
175
return 0 ;
189
176
}
190
177
191
- GENWQE_DEBUGFS_RO (prev_regs , genwqe_prev_regs_show );
178
+ DEFINE_SHOW_ATTRIBUTE (prev_regs );
192
179
193
- static int genwqe_jtimer_show (struct seq_file * s , void * unused )
180
+ static int jtimer_show (struct seq_file * s , void * unused )
194
181
{
195
182
struct genwqe_dev * cd = s -> private ;
196
183
unsigned int vf_num ;
@@ -209,9 +196,9 @@ static int genwqe_jtimer_show(struct seq_file *s, void *unused)
209
196
return 0 ;
210
197
}
211
198
212
- GENWQE_DEBUGFS_RO (jtimer , genwqe_jtimer_show );
199
+ DEFINE_SHOW_ATTRIBUTE (jtimer );
213
200
214
- static int genwqe_queue_working_time_show (struct seq_file * s , void * unused )
201
+ static int queue_working_time_show (struct seq_file * s , void * unused )
215
202
{
216
203
struct genwqe_dev * cd = s -> private ;
217
204
unsigned int vf_num ;
@@ -227,9 +214,9 @@ static int genwqe_queue_working_time_show(struct seq_file *s, void *unused)
227
214
return 0 ;
228
215
}
229
216
230
- GENWQE_DEBUGFS_RO (queue_working_time , genwqe_queue_working_time_show );
217
+ DEFINE_SHOW_ATTRIBUTE (queue_working_time );
231
218
232
- static int genwqe_ddcb_info_show (struct seq_file * s , void * unused )
219
+ static int ddcb_info_show (struct seq_file * s , void * unused )
233
220
{
234
221
struct genwqe_dev * cd = s -> private ;
235
222
unsigned int i ;
@@ -300,9 +287,9 @@ static int genwqe_ddcb_info_show(struct seq_file *s, void *unused)
300
287
return 0 ;
301
288
}
302
289
303
- GENWQE_DEBUGFS_RO (ddcb_info , genwqe_ddcb_info_show );
290
+ DEFINE_SHOW_ATTRIBUTE (ddcb_info );
304
291
305
- static int genwqe_info_show (struct seq_file * s , void * unused )
292
+ static int info_show (struct seq_file * s , void * unused )
306
293
{
307
294
struct genwqe_dev * cd = s -> private ;
308
295
u64 app_id , slu_id , bitstream = -1 ;
@@ -335,7 +322,7 @@ static int genwqe_info_show(struct seq_file *s, void *unused)
335
322
return 0 ;
336
323
}
337
324
338
- GENWQE_DEBUGFS_RO (info , genwqe_info_show );
325
+ DEFINE_SHOW_ATTRIBUTE (info );
339
326
340
327
int genwqe_init_debugfs (struct genwqe_dev * cd )
341
328
{
@@ -356,14 +343,14 @@ int genwqe_init_debugfs(struct genwqe_dev *cd)
356
343
357
344
/* non privileged interfaces are done here */
358
345
file = debugfs_create_file ("ddcb_info" , S_IRUGO , root , cd ,
359
- & genwqe_ddcb_info_fops );
346
+ & ddcb_info_fops );
360
347
if (!file ) {
361
348
ret = - ENOMEM ;
362
349
goto err1 ;
363
350
}
364
351
365
352
file = debugfs_create_file ("info" , S_IRUGO , root , cd ,
366
- & genwqe_info_fops );
353
+ & info_fops );
367
354
if (!file ) {
368
355
ret = - ENOMEM ;
369
356
goto err1 ;
@@ -396,56 +383,56 @@ int genwqe_init_debugfs(struct genwqe_dev *cd)
396
383
}
397
384
398
385
file = debugfs_create_file ("curr_regs" , S_IRUGO , root , cd ,
399
- & genwqe_curr_regs_fops );
386
+ & curr_regs_fops );
400
387
if (!file ) {
401
388
ret = - ENOMEM ;
402
389
goto err1 ;
403
390
}
404
391
405
392
file = debugfs_create_file ("curr_dbg_uid0" , S_IRUGO , root , cd ,
406
- & genwqe_curr_dbg_uid0_fops );
393
+ & curr_dbg_uid0_fops );
407
394
if (!file ) {
408
395
ret = - ENOMEM ;
409
396
goto err1 ;
410
397
}
411
398
412
399
file = debugfs_create_file ("curr_dbg_uid1" , S_IRUGO , root , cd ,
413
- & genwqe_curr_dbg_uid1_fops );
400
+ & curr_dbg_uid1_fops );
414
401
if (!file ) {
415
402
ret = - ENOMEM ;
416
403
goto err1 ;
417
404
}
418
405
419
406
file = debugfs_create_file ("curr_dbg_uid2" , S_IRUGO , root , cd ,
420
- & genwqe_curr_dbg_uid2_fops );
407
+ & curr_dbg_uid2_fops );
421
408
if (!file ) {
422
409
ret = - ENOMEM ;
423
410
goto err1 ;
424
411
}
425
412
426
413
file = debugfs_create_file ("prev_regs" , S_IRUGO , root , cd ,
427
- & genwqe_prev_regs_fops );
414
+ & prev_regs_fops );
428
415
if (!file ) {
429
416
ret = - ENOMEM ;
430
417
goto err1 ;
431
418
}
432
419
433
420
file = debugfs_create_file ("prev_dbg_uid0" , S_IRUGO , root , cd ,
434
- & genwqe_prev_dbg_uid0_fops );
421
+ & prev_dbg_uid0_fops );
435
422
if (!file ) {
436
423
ret = - ENOMEM ;
437
424
goto err1 ;
438
425
}
439
426
440
427
file = debugfs_create_file ("prev_dbg_uid1" , S_IRUGO , root , cd ,
441
- & genwqe_prev_dbg_uid1_fops );
428
+ & prev_dbg_uid1_fops );
442
429
if (!file ) {
443
430
ret = - ENOMEM ;
444
431
goto err1 ;
445
432
}
446
433
447
434
file = debugfs_create_file ("prev_dbg_uid2" , S_IRUGO , root , cd ,
448
- & genwqe_prev_dbg_uid2_fops );
435
+ & prev_dbg_uid2_fops );
449
436
if (!file ) {
450
437
ret = - ENOMEM ;
451
438
goto err1 ;
@@ -463,14 +450,14 @@ int genwqe_init_debugfs(struct genwqe_dev *cd)
463
450
}
464
451
465
452
file = debugfs_create_file ("jobtimer" , S_IRUGO , root , cd ,
466
- & genwqe_jtimer_fops );
453
+ & jtimer_fops );
467
454
if (!file ) {
468
455
ret = - ENOMEM ;
469
456
goto err1 ;
470
457
}
471
458
472
459
file = debugfs_create_file ("queue_working_time" , S_IRUGO , root , cd ,
473
- & genwqe_queue_working_time_fops );
460
+ & queue_working_time_fops );
474
461
if (!file ) {
475
462
ret = - ENOMEM ;
476
463
goto err1 ;
0 commit comments