]> rtime.felk.cvut.cz Git - socketcan-devel.git/blob - kernel/2.6/net/can/proc.c
Added locking to CAN core proc_fs output.
[socketcan-devel.git] / kernel / 2.6 / net / can / proc.c
1 /*
2  * proc.c - procfs support for Protocol family CAN core module
3  *
4  * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions, the following disclaimer and
12  *    the referenced file 'COPYING'.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of Volkswagen nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * Alternatively, provided that this notice is retained in full, this
21  * software may be distributed under the terms of the GNU General
22  * Public License ("GPL") version 2 as distributed in the 'COPYING'
23  * file from the main directory of the linux kernel source.
24  *
25  * The provided data structures and external interfaces from this code
26  * are not restricted to be used by modules with a GPL compatible license.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
39  * DAMAGE.
40  *
41  * Send feedback to <socketcan-users@lists.berlios.de>
42  *
43  */
44
45 #include <linux/module.h>
46 #include <linux/proc_fs.h>
47 #include <linux/list.h>
48 #include <linux/rcupdate.h>
49
50 #include <linux/can/core.h>
51 #include "af_can.h"
52
53 #include <linux/can/version.h> /* for RCSID. Removed by mkpatch script */
54 RCSID("$Id$");
55
56 /*
57  * proc filenames for the PF_CAN core
58  */
59
60 #define CAN_PROC_VERSION     "version"
61 #define CAN_PROC_STATS       "stats"
62 #define CAN_PROC_RESET_STATS "reset_stats"
63 #define CAN_PROC_RCVLIST_ALL "rcvlist_all"
64 #define CAN_PROC_RCVLIST_FIL "rcvlist_fil"
65 #define CAN_PROC_RCVLIST_INV "rcvlist_inv"
66 #define CAN_PROC_RCVLIST_SFF "rcvlist_sff"
67 #define CAN_PROC_RCVLIST_EFF "rcvlist_eff"
68 #define CAN_PROC_RCVLIST_ERR "rcvlist_err"
69
70 static struct proc_dir_entry *can_dir         = NULL;
71 static struct proc_dir_entry *pde_version     = NULL;
72 static struct proc_dir_entry *pde_stats       = NULL;
73 static struct proc_dir_entry *pde_reset_stats = NULL;
74 static struct proc_dir_entry *pde_rcvlist_all = NULL;
75 static struct proc_dir_entry *pde_rcvlist_fil = NULL;
76 static struct proc_dir_entry *pde_rcvlist_inv = NULL;
77 static struct proc_dir_entry *pde_rcvlist_sff = NULL;
78 static struct proc_dir_entry *pde_rcvlist_eff = NULL;
79 static struct proc_dir_entry *pde_rcvlist_err = NULL;
80
81 static int user_reset = 0;
82
83 /* 
84  * af_can statistics stuff
85  */
86
87 static void can_init_stats(void)
88 {
89         /*
90          * This memset function is called from a timer context (when
91          * stattimer is active which is the default) OR in a process
92          * context (reading the proc_fs when stattimer is disabled).
93          */
94         spin_lock(&stats_lock);
95         memset(&stats, 0, sizeof(stats));
96         stats.jiffies_init = jiffies;
97         spin_unlock(&stats_lock);
98
99         pstats.stats_reset++;
100
101         if (user_reset) {
102                 user_reset = 0;
103                 pstats.user_reset++;
104         }
105 }
106
107 static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
108                                unsigned long count)
109 {
110         unsigned long ret = 0;
111
112         if (oldjif == newjif)
113                 return 0;
114
115         /* see can_rcv() - this should NEVER happen! */
116         if (count > (ULONG_MAX / HZ)) {
117                 printk(KERN_ERR "can: calc_rate: count exceeded! %ld\n",
118                        count);
119                 return 99999999;
120         }
121
122         ret = (count * HZ) / (newjif - oldjif);
123
124         return ret;
125 }
126
127 void can_stat_update(unsigned long data)
128 {
129         unsigned long j = jiffies; /* snapshot */
130
131         /* restart counting in timer context on user request */
132         if (user_reset)
133                 can_init_stats();
134
135         /* restart counting on jiffies overflow */
136         if (j < stats.jiffies_init)
137                 can_init_stats();
138
139         /* stats.rx_frames is the definitively max. statistic value */
140
141         /* prevent overflow in calc_rate() */
142         if (stats.rx_frames > (ULONG_MAX / HZ))
143                 can_init_stats();
144
145         /* matches overflow - very improbable */
146         if (stats.matches > (ULONG_MAX / 100))
147                 can_init_stats();
148
149         /* calc total values */
150         if (stats.rx_frames)
151                 stats.total_rx_match_ratio = (stats.matches * 100) / 
152                                                 stats.rx_frames;
153
154         stats.total_tx_rate = calc_rate(stats.jiffies_init, j,
155                                         stats.tx_frames);
156         stats.total_rx_rate = calc_rate(stats.jiffies_init, j,
157                                         stats.rx_frames);
158
159         /* calc current values */
160         if (stats.rx_frames_delta)
161                 stats.current_rx_match_ratio =
162                         (stats.matches_delta * 100) / stats.rx_frames_delta;
163
164         stats.current_tx_rate = calc_rate(0, HZ, stats.tx_frames_delta);
165         stats.current_rx_rate = calc_rate(0, HZ, stats.rx_frames_delta);
166
167         /* check / update maximum values */
168         if (stats.max_tx_rate < stats.current_tx_rate)
169                 stats.max_tx_rate = stats.current_tx_rate;
170
171         if (stats.max_rx_rate < stats.current_rx_rate)
172                 stats.max_rx_rate = stats.current_rx_rate;
173
174         if (stats.max_rx_match_ratio < stats.current_rx_match_ratio)
175                 stats.max_rx_match_ratio = stats.current_rx_match_ratio;
176
177         /* clear values for 'current rate' calculation */
178         stats.tx_frames_delta = 0;
179         stats.rx_frames_delta = 0;
180         stats.matches_delta   = 0;
181
182         /* restart timer (one second) */
183         stattimer.expires = jiffies + HZ;
184         add_timer(&stattimer);
185 }
186
187 /* 
188  * proc read functions
189  */
190
191 static int can_print_rcvlist(char *page, int len, struct hlist_head *rx_list,
192                              struct net_device *dev)
193 {
194         struct receiver *r;
195         struct hlist_node *n;
196
197         rcu_read_lock();
198         hlist_for_each_entry_rcu(r, n, rx_list, list) {
199                 char *fmt = (r->can_id & CAN_EFF_FLAG)?
200                         "   %-5s  %08X  %08x  %08x  %08x  %8ld  %s\n" :
201                         "   %-5s     %03X    %08x  %08x  %08x  %8ld  %s\n";
202
203                 len += snprintf(page + len, PAGE_SIZE - len, fmt,
204                                 DNAME(dev), r->can_id, r->mask,
205                                 (unsigned int)r->func, (unsigned int)r->data,
206                                 r->matches, r->ident);
207
208                 /* does a typical line fit into the current buffer? */
209
210                 /* 100 Bytes before end of buffer */
211                 if (len > PAGE_SIZE - 100) {
212                         /* mark output cut off */
213                         len += snprintf(page + len, PAGE_SIZE - len,
214                                         "   (..)\n");
215                         break;
216                 }
217         }
218         rcu_read_unlock();
219
220         return len;
221 }
222
223 static int can_print_recv_banner(char *page, int len)
224 {
225         /*
226          *                  can1.  00000000  00000000  00000000
227          *                 .......          0  tp20
228          */
229         len += snprintf(page + len, PAGE_SIZE - len,
230                         "  device   can_id   can_mask  function"
231                         "  userdata   matches  ident\n");
232
233         return len;
234 }
235
236 static int can_proc_read_stats(char *page, char **start, off_t off,
237                                int count, int *eof, void *data)
238 {
239         int len = 0;
240
241         len += snprintf(page + len, PAGE_SIZE - len, "\n");
242         len += snprintf(page + len, PAGE_SIZE - len,
243                         " %8ld transmitted frames (TXF)\n", stats.tx_frames);
244         len += snprintf(page + len, PAGE_SIZE - len,
245                         " %8ld received frames (RXF)\n", stats.rx_frames);
246         len += snprintf(page + len, PAGE_SIZE - len,
247                         " %8ld matched frames (RXMF)\n", stats.matches);
248
249         len += snprintf(page + len, PAGE_SIZE - len, "\n");
250
251         if (stattimer.function == can_stat_update) {
252                 len += snprintf(page + len, PAGE_SIZE - len,
253                                 " %8ld %% total match ratio (RXMR)\n",
254                                 stats.total_rx_match_ratio);
255
256                 len += snprintf(page + len, PAGE_SIZE - len,
257                                 " %8ld frames/s total tx rate (TXR)\n",
258                                 stats.total_tx_rate);
259                 len += snprintf(page + len, PAGE_SIZE - len,
260                                 " %8ld frames/s total rx rate (RXR)\n",
261                                 stats.total_rx_rate);
262
263                 len += snprintf(page + len, PAGE_SIZE - len, "\n");
264
265                 len += snprintf(page + len, PAGE_SIZE - len,
266                                 " %8ld %% current match ratio (CRXMR)\n",
267                                 stats.current_rx_match_ratio);
268
269                 len += snprintf(page + len, PAGE_SIZE - len,
270                                 " %8ld frames/s current tx rate (CTXR)\n",
271                                 stats.current_tx_rate);
272                 len += snprintf(page + len, PAGE_SIZE - len,
273                                 " %8ld frames/s current rx rate (CRXR)\n",
274                                 stats.current_rx_rate);
275
276                 len += snprintf(page + len, PAGE_SIZE - len, "\n");
277
278                 len += snprintf(page + len, PAGE_SIZE - len,
279                                 " %8ld %% max match ratio (MRXMR)\n",
280                                 stats.max_rx_match_ratio);
281
282                 len += snprintf(page + len, PAGE_SIZE - len,
283                                 " %8ld frames/s max tx rate (MTXR)\n",
284                                 stats.max_tx_rate);
285                 len += snprintf(page + len, PAGE_SIZE - len,
286                                 " %8ld frames/s max rx rate (MRXR)\n",
287                                 stats.max_rx_rate);
288
289                 len += snprintf(page + len, PAGE_SIZE - len, "\n");
290         }
291
292         len += snprintf(page + len, PAGE_SIZE - len,
293                         " %8ld current receive list entries (CRCV)\n",
294                         pstats.rcv_entries);
295         len += snprintf(page + len, PAGE_SIZE - len,
296                         " %8ld maximum receive list entries (MRCV)\n",
297                         pstats.rcv_entries_max);
298
299         if (pstats.stats_reset)
300                 len += snprintf(page + len, PAGE_SIZE - len,
301                                 "\n %8ld statistic resets (STR)\n",
302                                 pstats.stats_reset);
303
304         if (pstats.user_reset)
305                 len += snprintf(page + len, PAGE_SIZE - len,
306                                 " %8ld user statistic resets (USTR)\n",
307                                 pstats.user_reset);
308
309         len += snprintf(page + len, PAGE_SIZE - len, "\n");
310
311         *eof = 1;
312         return len;
313 }
314
315 static int can_proc_read_reset_stats(char *page, char **start, off_t off,
316                                      int count, int *eof, void *data)
317 {
318         int len = 0;
319
320         user_reset = 1;
321
322         if (stattimer.function == can_stat_update) {
323                 len += snprintf(page + len, PAGE_SIZE - len,
324                                 "Scheduled statistic reset #%ld.\n",
325                                 pstats.stats_reset + 1);
326
327         } else {
328                 if (stats.jiffies_init != jiffies)
329                         can_init_stats();
330
331                 len += snprintf(page + len, PAGE_SIZE - len,
332                                 "Performed statistic reset #%ld.\n",
333                                 pstats.stats_reset);
334         }
335
336         *eof = 1;
337         return len;
338 }
339
340 static int can_proc_read_version(char *page, char **start, off_t off,
341                                  int count, int *eof, void *data)
342 {
343         int len = 0;
344
345         len += snprintf(page + len, PAGE_SIZE - len, "%s\n",
346                         CAN_VERSION_STRING);
347         *eof = 1;
348         return len;
349 }
350
351 static int can_proc_read_rcvlist_all(char *page, char **start, off_t off,
352                                      int count, int *eof, void *data)
353 {
354         int len = 0;
355         struct dev_rcv_lists *d;
356         struct hlist_node *n;
357
358         /* RX_ALL */
359         len += snprintf(page + len, PAGE_SIZE - len,
360                         "\nreceive list 'rx_all':\n");
361
362         /* find receive list for this device */
363         rcu_read_lock();
364         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
365
366                 if (!hlist_empty(&d->rx_all)) {
367                         len = can_print_recv_banner(page, len);
368                         len = can_print_rcvlist(page, len, &d->rx_all, d->dev);
369                 } else
370                         len += snprintf(page + len, PAGE_SIZE - len,
371                                         "  (%s: no entry)\n", DNAME(d->dev));
372
373                 /* exit on end of buffer? */
374                 if (len > PAGE_SIZE - 100)
375                         break;
376         }
377         rcu_read_unlock();
378
379         len += snprintf(page + len, PAGE_SIZE - len, "\n");
380
381         *eof = 1;
382         return len;
383 }
384
385 static int can_proc_read_rcvlist_fil(char *page, char **start, off_t off,
386                                      int count, int *eof, void *data)
387 {
388         int len = 0;
389         struct dev_rcv_lists *d;
390         struct hlist_node *n;
391
392         /* RX_FIL */
393         len += snprintf(page + len, PAGE_SIZE - len,
394                         "\nreceive list 'rx_fil':\n");
395
396         /* find receive list for this device */
397         rcu_read_lock();
398         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
399
400                 if (!hlist_empty(&d->rx_fil)) {
401                         len = can_print_recv_banner(page, len);
402                         len = can_print_rcvlist(page, len, &d->rx_fil, d->dev);
403                 } else
404                         len += snprintf(page + len, PAGE_SIZE - len,
405                                         "  (%s: no entry)\n", DNAME(d->dev));
406
407                 /* exit on end of buffer? */
408                 if (len > PAGE_SIZE - 100)
409                         break;
410         }
411         rcu_read_unlock();
412
413         len += snprintf(page + len, PAGE_SIZE - len, "\n");
414
415         *eof = 1;
416         return len;
417 }
418
419 static int can_proc_read_rcvlist_inv(char *page, char **start, off_t off,
420                                      int count, int *eof, void *data)
421 {
422         int len = 0;
423         struct dev_rcv_lists *d;
424         struct hlist_node *n;
425
426         /* RX_INV */
427         len += snprintf(page + len, PAGE_SIZE - len,
428                         "\nreceive list 'rx_inv':\n");
429
430         /* find receive list for this device */
431         rcu_read_lock();
432         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
433
434                 if (!hlist_empty(&d->rx_inv)) {
435                         len = can_print_recv_banner(page, len);
436                         len = can_print_rcvlist(page, len, &d->rx_inv, d->dev);
437                 } else
438                         len += snprintf(page + len, PAGE_SIZE - len,
439                                         "  (%s: no entry)\n", DNAME(d->dev));
440
441                 /* exit on end of buffer? */
442                 if (len > PAGE_SIZE - 100)
443                         break;
444         }
445         rcu_read_unlock();
446
447         len += snprintf(page + len, PAGE_SIZE - len, "\n");
448
449         *eof = 1;
450         return len;
451 }
452
453 static int can_proc_read_rcvlist_sff(char *page, char **start, off_t off,
454                                      int count, int *eof, void *data)
455 {
456         int len = 0;
457         struct dev_rcv_lists *d;
458         struct hlist_node *n;
459
460         /* RX_SFF */
461         len += snprintf(page + len, PAGE_SIZE - len,
462                         "\nreceive list 'rx_sff':\n");
463
464         /* find receive list for this device */
465         rcu_read_lock();
466         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
467                 int i, all_empty = 1;
468                 /* check wether at least one list is non-empty */
469                 for (i = 0; i < 0x800; i++)
470                         if (!hlist_empty(&d->rx_sff[i])) {
471                                 all_empty = 0;
472                                 break;
473                         }
474
475                 if (!all_empty) {
476                         len = can_print_recv_banner(page, len);
477                         for (i = 0; i < 0x800; i++) {
478                                 if (!hlist_empty(&d->rx_sff[i]) &&
479                                     len < PAGE_SIZE - 100)
480                                         len = can_print_rcvlist(page, len,
481                                                                 &d->rx_sff[i],
482                                                                 d->dev);
483                         }
484                 } else
485                         len += snprintf(page + len, PAGE_SIZE - len,
486                                         "  (%s: no entry)\n", DNAME(d->dev));
487
488                 /* exit on end of buffer? */
489                 if (len > PAGE_SIZE - 100)
490                         break;
491         }
492         rcu_read_unlock();
493
494         len += snprintf(page + len, PAGE_SIZE - len, "\n");
495
496         *eof = 1;
497         return len;
498 }
499
500 static int can_proc_read_rcvlist_eff(char *page, char **start, off_t off,
501                                      int count, int *eof, void *data)
502 {
503         int len = 0;
504         struct dev_rcv_lists *d;
505         struct hlist_node *n;
506
507         /* RX_EFF */
508         len += snprintf(page + len, PAGE_SIZE - len,
509                         "\nreceive list 'rx_eff':\n");
510
511         /* find receive list for this device */
512         rcu_read_lock();
513         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
514
515                 if (!hlist_empty(&d->rx_eff)) {
516                         len = can_print_recv_banner(page, len);
517                         len = can_print_rcvlist(page, len, &d->rx_eff, d->dev);
518                 } else
519                         len += snprintf(page + len, PAGE_SIZE - len,
520                                         "  (%s: no entry)\n", DNAME(d->dev));
521
522                 /* exit on end of buffer? */
523                 if (len > PAGE_SIZE - 100)
524                         break;
525         }
526         rcu_read_unlock();
527
528         len += snprintf(page + len, PAGE_SIZE - len, "\n");
529
530         *eof = 1;
531         return len;
532 }
533
534 static int can_proc_read_rcvlist_err(char *page, char **start, off_t off,
535                                      int count, int *eof, void *data)
536 {
537         int len = 0;
538         struct dev_rcv_lists *d;
539         struct hlist_node *n;
540
541         /* RX_ERR */
542         len += snprintf(page + len, PAGE_SIZE - len,
543                         "\nreceive list 'rx_err':\n");
544
545         /* find receive list for this device */
546         rcu_read_lock();
547         hlist_for_each_entry_rcu(d, n, &rx_dev_list, list) {
548
549                 if (!hlist_empty(&d->rx_err)) {
550                         len = can_print_recv_banner(page, len);
551                         len = can_print_rcvlist(page, len, &d->rx_err, d->dev);
552                 } else
553                         len += snprintf(page + len, PAGE_SIZE - len,
554                                         "  (%s: no entry)\n", DNAME(d->dev));
555
556                 /* exit on end of buffer? */
557                 if (len > PAGE_SIZE - 100)
558                         break;
559         }
560         rcu_read_unlock();
561
562         len += snprintf(page + len, PAGE_SIZE - len, "\n");
563
564         *eof = 1;
565         return len;
566 }
567
568 /*
569  * proc utility functions
570  */
571
572 static struct proc_dir_entry *can_create_proc_readentry(const char *name,
573                                                         mode_t mode,
574                                                         read_proc_t* read_proc,
575                                                         void *data)
576 {
577         if (can_dir)
578                 return create_proc_read_entry(name, mode, can_dir, read_proc,
579                                               data);
580         else
581                 return NULL;
582 }
583
584 static void can_remove_proc_readentry(const char *name)
585 {
586         if (can_dir)
587                 remove_proc_entry(name, can_dir);
588 }
589
590 /*
591  * can_init_proc - create main CAN proc directory and procfs entries
592  */
593 void can_init_proc(void)
594 {
595         /* create /proc/net/can directory */
596         can_dir = proc_mkdir(CAN_PROC_DIR, NULL);
597
598         if (!can_dir) {
599                 printk(KERN_INFO "can: failed to create /proc/%s . "
600                        "CONFIG_PROC_FS missing?\n", CAN_PROC_DIR);
601                 return;
602         }
603
604         can_dir->owner = THIS_MODULE;
605
606         /* own procfs entries from the AF_CAN core */
607         pde_version     = can_create_proc_readentry(CAN_PROC_VERSION,
608                                         0644, can_proc_read_version, NULL);
609         pde_stats       = can_create_proc_readentry(CAN_PROC_STATS,
610                                         0644, can_proc_read_stats, NULL);
611         pde_reset_stats = can_create_proc_readentry(CAN_PROC_RESET_STATS,
612                                         0644, can_proc_read_reset_stats, NULL);
613         pde_rcvlist_all = can_create_proc_readentry(CAN_PROC_RCVLIST_ALL,
614                                         0644, can_proc_read_rcvlist_all, NULL);
615         pde_rcvlist_fil = can_create_proc_readentry(CAN_PROC_RCVLIST_FIL,
616                                         0644, can_proc_read_rcvlist_fil, NULL);
617         pde_rcvlist_inv = can_create_proc_readentry(CAN_PROC_RCVLIST_INV,
618                                         0644, can_proc_read_rcvlist_inv, NULL);
619         pde_rcvlist_sff = can_create_proc_readentry(CAN_PROC_RCVLIST_SFF,
620                                         0644, can_proc_read_rcvlist_sff, NULL);
621         pde_rcvlist_eff = can_create_proc_readentry(CAN_PROC_RCVLIST_EFF,
622                                         0644, can_proc_read_rcvlist_eff, NULL);
623         pde_rcvlist_err = can_create_proc_readentry(CAN_PROC_RCVLIST_ERR,
624                                         0644, can_proc_read_rcvlist_err, NULL);
625 }
626
627 /*
628  * can_remove_proc - remove procfs entries and main CAN proc directory
629  */
630 void can_remove_proc(void)
631 {
632         if (pde_version)
633                 can_remove_proc_readentry(CAN_PROC_VERSION);
634
635         if (pde_stats)
636                 can_remove_proc_readentry(CAN_PROC_STATS);
637
638         if (pde_reset_stats)
639                 can_remove_proc_readentry(CAN_PROC_RESET_STATS);
640
641         if (pde_rcvlist_all)
642                 can_remove_proc_readentry(CAN_PROC_RCVLIST_ALL);
643
644         if (pde_rcvlist_fil)
645                 can_remove_proc_readentry(CAN_PROC_RCVLIST_FIL);
646
647         if (pde_rcvlist_inv)
648                 can_remove_proc_readentry(CAN_PROC_RCVLIST_INV);
649
650         if (pde_rcvlist_sff)
651                 can_remove_proc_readentry(CAN_PROC_RCVLIST_SFF);
652
653         if (pde_rcvlist_eff)
654                 can_remove_proc_readentry(CAN_PROC_RCVLIST_EFF);
655
656         if (pde_rcvlist_err)
657                 can_remove_proc_readentry(CAN_PROC_RCVLIST_ERR);
658
659         if (can_dir)
660                 remove_proc_entry(CAN_PROC_DIR, NULL);
661 }